Status: | Merged |
---|---|
Merged at revision: | 126 |
Proposed branch: | lp:~barry/apturl/py3 |
Merge into: | lp:apturl |
Diff against target: |
1084 lines (+219/-210) 21 files modified
AptUrl/AptUrl.py (+31/-30) AptUrl/Helpers.py (+18/-8) AptUrl/Parser.py (+2/-2) AptUrl/UI.py (+0/-1) AptUrl/gtk/GtkUI.py (+23/-16) AptUrl/gtk/backend/__init__.py (+2/-2) AptUrl/kde/KdeUI.py (+27/-41) apturl-gtk (+2/-3) apturl-kde (+7/-8) debian/apturl-common.install (+2/-2) debian/apturl-kde.install (+1/-1) debian/apturl.install (+2/-2) debian/changelog (+21/-0) debian/compat (+1/-1) debian/control (+16/-15) debian/pycompat (+0/-1) debian/rules (+7/-4) po/apturl.pot (+40/-41) setup.py (+5/-5) tests/test_apturl_parse.py (+9/-17) tests/test_helpers.py (+3/-10) |
To merge this branch: | bzr merge lp:~barry/apturl/py3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stéphane Graber | Approve | ||
Michael Vogt | Pending | ||
Review via email: mp+109949@code.launchpad.net |
Commit message
Description of the change
A working port to Python 3.
Barry Warsaw (barry) wrote : | # |
On Jun 12, 2012, at 10:42 PM, Stéphane Graber wrote:
>Things that I can't easily check just through the proposal:
> - Does the package actually build? The concern here being the use of "python3 ./setup.py install --install-
I'm testing this now, but it requires unreleased versions of update-manager
and aptdaemon, so it's a bit tricky. :) I certainly won't upload it until
both those are released and the apturl build is tested.
> - "#desc = "%s\n\n%s" % (summary, Helpers.
You can't tell from the diff, but there's other code commented out below that
references it. I suppose I should just remove all the commented out code
instead.
>Besides that, the rest looks good, so with an answer to these two, +1
Thanks!
- 133. By Barry Warsaw
-
+ Port setup.py to Python 3.
+ Fix python3-update- manager dependencies.
+ override_dh_auto_ build to build with Python 3.
+ python3 setup.py install needs --root
Barry Warsaw (barry) wrote : | # |
With the new uploads of update-manager and aptdaemon, this should be ready to go.
- 134. By Barry Warsaw
-
apturl now must require python3-
aptdaemon. gtk3widgets (i.e. not |
synaptic) due to the Python 3 port of update-manager.
Barry Warsaw (barry) wrote : | # |
<xnox> then why Except: #Python 3 [20:44]
<xnox> 204 - homepage = pkgobj.homepage
<xnox> 205 + try:
<xnox> 206 + homepage = pkgobj.homepage
<xnox> 207 + except AttributeError:
<xnox> 208 + # Python 3
<xnox> 209 + homepage = pkgobj.
<xnox> then I would expect universal_
you were playing it safe ;-) [20:45]
<xnox> +from __future__ import print_function
<xnox> 460 - desc = "%s\n\n%s" % (summary,
<xnox> 461 + #desc = "%s\n\n%s" % (summary,
<xnox> intentional comment out?
<xnox> are we meant to install 597
<xnox> ok.
<xnox> barry: debian/compat == 8
<xnox> use 9
<xnox> 8 was really a temp thing.
<xnox> and precise has 9 [20:48]
Barry Warsaw (barry) wrote : | # |
<cjwatson> barry: The new apt API exists for py2 as well, and it's important
to port to it because the old one is slated to go away
<cjwatson> (given that the new one has been around since lucid)
<barry> cjwatson: agreed. i'll get rid of the old api
<barry> (or mostly the try/excepts around the old api calls) [20:52]
<cjwatson> (Also, pkgobj.
<cjwatson> + verStr = self.cache[
<cjwatson> that looks wrong, .candidate.version perhaps
Barry Warsaw (barry) wrote : | # |
<cjwatson> + # be locked via apt_pkg.GetLock()
<cjwatson> whitespace change only here in a comment, but maybe update the
comment to .get_lock()
- 135. By Barry Warsaw
-
Change debian/compat == 9
Preview Diff
1 | === modified file 'AptUrl/AptUrl.py' | |||
2 | --- AptUrl/AptUrl.py 2012-06-11 20:34:59 +0000 | |||
3 | +++ AptUrl/AptUrl.py 2012-06-14 00:37:19 +0000 | |||
4 | @@ -20,17 +20,15 @@ | |||
5 | 20 | # along with AptUrl; if not, write to the Free Software | 20 | # along with AptUrl; if not, write to the Free Software |
6 | 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7 | 22 | 22 | ||
8 | 23 | import sys | ||
9 | 24 | import apt | 23 | import apt |
10 | 25 | import apt_pkg | 24 | import apt_pkg |
11 | 26 | import gettext | ||
12 | 27 | 25 | ||
13 | 28 | import aptsources.distro | 26 | import aptsources.distro |
14 | 29 | from . import Parser | 27 | from . import Parser |
15 | 30 | from . import Helpers | 28 | from . import Helpers |
16 | 31 | from .Helpers import _ | 29 | from .Helpers import _ |
17 | 32 | 30 | ||
19 | 33 | from aptsources.sourceslist import SourcesList, is_mirror | 31 | from aptsources.sourceslist import SourcesList |
20 | 34 | from optparse import OptionParser | 32 | from optparse import OptionParser |
21 | 35 | 33 | ||
22 | 36 | import os | 34 | import os |
23 | @@ -55,8 +53,6 @@ | |||
24 | 55 | self.ui = ui | 53 | self.ui = ui |
25 | 56 | 54 | ||
26 | 57 | def enableSection(self, apturl): | 55 | def enableSection(self, apturl): |
27 | 58 | added = False | ||
28 | 59 | |||
29 | 60 | # parse sources.list | 56 | # parse sources.list |
30 | 61 | sourceslist = SourcesList() | 57 | sourceslist = SourcesList() |
31 | 62 | distro = aptsources.distro.get_distro() | 58 | distro = aptsources.distro.get_distro() |
32 | @@ -74,7 +70,8 @@ | |||
33 | 74 | if not self.ui.askEnableSections(apturl.section): | 70 | if not self.ui.askEnableSections(apturl.section): |
34 | 75 | return RESULT_CANCELT | 71 | return RESULT_CANCELT |
35 | 76 | if not self.ui.doEnableSection(apturl.section): | 72 | if not self.ui.doEnableSection(apturl.section): |
37 | 77 | self.ui.error(_("Enabling '%s' failed") % ", ".join(apturl.section)) | 73 | self.ui.error(_("Enabling '%s' failed") % |
38 | 74 | ", ".join(apturl.section)) | ||
39 | 78 | return RESULT_ERROR | 75 | return RESULT_ERROR |
40 | 79 | self.ui.doUpdate() | 76 | self.ui.doUpdate() |
41 | 80 | self.openCache() | 77 | self.openCache() |
42 | @@ -114,9 +111,9 @@ | |||
43 | 114 | raise | 111 | raise |
44 | 115 | self.ui.error(_("Invalid /etc/apt/sources.list file"), strerr) | 112 | self.ui.error(_("Invalid /etc/apt/sources.list file"), strerr) |
45 | 116 | return False | 113 | return False |
47 | 117 | if self.cache._depcache.BrokenCount > 0: | 114 | if self.cache._depcache.broken_count > 0: |
48 | 118 | err_header = _("Software index is broken") | 115 | err_header = _("Software index is broken") |
50 | 119 | err_body = _("This is a major failure of your software " | 116 | err_body = _("This is a major failure of your software " |
51 | 120 | "management system. Please check for broken packages " | 117 | "management system. Please check for broken packages " |
52 | 121 | "with synaptic, check the file permissions and " | 118 | "with synaptic, check the file permissions and " |
53 | 122 | "correctness of the file '/etc/apt/sources.list' and " | 119 | "correctness of the file '/etc/apt/sources.list' and " |
54 | @@ -126,7 +123,7 @@ | |||
55 | 126 | self.ui.error(err_header, err_body) | 123 | self.ui.error(err_header, err_body) |
56 | 127 | return False | 124 | return False |
57 | 128 | return True | 125 | return True |
59 | 129 | 126 | ||
60 | 130 | def parseArgs(self): | 127 | def parseArgs(self): |
61 | 131 | parser = OptionParser() | 128 | parser = OptionParser() |
62 | 132 | parser.add_option("-p", "--http-proxy", dest="http_proxy", | 129 | parser.add_option("-p", "--http-proxy", dest="http_proxy", |
63 | @@ -151,15 +148,15 @@ | |||
64 | 151 | str(e)) | 148 | str(e)) |
65 | 152 | return [] | 149 | return [] |
66 | 153 | return (apturl_list) | 150 | return (apturl_list) |
68 | 154 | 151 | ||
69 | 155 | def verifyInstall(self, apturl): | 152 | def verifyInstall(self, apturl): |
70 | 156 | " verify that the install package actually is installed " | 153 | " verify that the install package actually is installed " |
71 | 157 | # check if the package got actually installed | 154 | # check if the package got actually installed |
72 | 158 | self.openCache() | 155 | self.openCache() |
73 | 159 | pkg = self.cache[apturl.package] | 156 | pkg = self.cache[apturl.package] |
77 | 160 | if (not pkg.isInstalled or | 157 | if (not pkg.is_installed or |
78 | 161 | pkg._pkg.CurrentState != apt_pkg.CurStateInstalled or | 158 | pkg._pkg.current_state != apt_pkg.CURSTATE_INSTALLED or |
79 | 162 | self.cache._depcache.BrokenCount > 0): | 159 | self.cache._depcache.broken_count > 0): |
80 | 163 | return False | 160 | return False |
81 | 164 | return True | 161 | return True |
82 | 165 | 162 | ||
83 | @@ -167,12 +164,12 @@ | |||
84 | 167 | # global return code | 164 | # global return code |
85 | 168 | ret = RESULT_OK | 165 | ret = RESULT_OK |
86 | 169 | ui = self.ui | 166 | ui = self.ui |
88 | 170 | 167 | ||
89 | 171 | # parse arguments | 168 | # parse arguments |
90 | 172 | apturl_list = self.parseArgs() | 169 | apturl_list = self.parseArgs() |
91 | 173 | if not apturl_list: | 170 | if not apturl_list: |
92 | 174 | return RESULT_BADARGS | 171 | return RESULT_BADARGS |
94 | 175 | 172 | ||
95 | 176 | # open cache | 173 | # open cache |
96 | 177 | if not self.openCache(): | 174 | if not self.openCache(): |
97 | 178 | return RESULT_ERROR | 175 | return RESULT_ERROR |
98 | @@ -183,7 +180,8 @@ | |||
99 | 183 | # evalAptUrl() | 180 | # evalAptUrl() |
100 | 184 | 181 | ||
101 | 185 | if not apturl.schema in ("apt", "apt+http"): | 182 | if not apturl.schema in ("apt", "apt+http"): |
103 | 186 | self.ui.error(_("Can not deal with protocol '%s' ") % apturl.schema) | 183 | self.ui.error(_("Can not deal with protocol '%s' ") |
104 | 184 | % apturl.schema) | ||
105 | 187 | continue | 185 | continue |
106 | 188 | 186 | ||
107 | 189 | if apturl.section: | 187 | if apturl.section: |
108 | @@ -196,7 +194,7 @@ | |||
109 | 196 | ui.doUpdate() | 194 | ui.doUpdate() |
110 | 197 | if not self.openCache(): | 195 | if not self.openCache(): |
111 | 198 | return RESULT_ERROR | 196 | return RESULT_ERROR |
113 | 199 | 197 | ||
114 | 200 | # now check the package | 198 | # now check the package |
115 | 201 | if apturl.package not in self.cache: | 199 | if apturl.package not in self.cache: |
116 | 202 | try: | 200 | try: |
117 | @@ -207,11 +205,14 @@ | |||
118 | 207 | ui.error(_("Package '%s' is virtual.") % apturl.package) | 205 | ui.error(_("Package '%s' is virtual.") % apturl.package) |
119 | 208 | continue | 206 | continue |
120 | 209 | else: | 207 | else: |
122 | 210 | ui.error(_("Could not find package '%s'.") % apturl.package) | 208 | ui.error(_("Could not find package '%s'.") |
123 | 209 | % apturl.package) | ||
124 | 211 | continue | 210 | continue |
128 | 212 | 211 | ||
129 | 213 | if self.cache[apturl.package].isInstalled and apturl.minver is None: | 212 | if (self.cache[apturl.package].is_installed and |
130 | 214 | ui.message(_("Package '%s' is already installed") % apturl.package) | 213 | apturl.minver is None): |
131 | 214 | ui.message(_("Package '%s' is already installed") | ||
132 | 215 | % apturl.package) | ||
133 | 215 | continue | 216 | continue |
134 | 216 | 217 | ||
135 | 217 | # ask the user | 218 | # ask the user |
136 | @@ -220,20 +221,21 @@ | |||
137 | 220 | if not ui.askInstallPackage(apturl.package, sum, desc, homepage): | 221 | if not ui.askInstallPackage(apturl.package, sum, desc, homepage): |
138 | 221 | ret = RESULT_CANCELT | 222 | ret = RESULT_CANCELT |
139 | 222 | continue | 223 | continue |
141 | 223 | 224 | ||
142 | 224 | # try to install it | 225 | # try to install it |
143 | 225 | try: | 226 | try: |
145 | 226 | self.cache[apturl.package].markInstall() | 227 | self.cache[apturl.package].mark_install() |
146 | 227 | except SystemError as e: | 228 | except SystemError as e: |
147 | 228 | ui.error(_("Can not install '%s' (%s) ") % (apturl.package, e)) | 229 | ui.error(_("Can not install '%s' (%s) ") % (apturl.package, e)) |
148 | 229 | continue | 230 | continue |
149 | 230 | if apturl.minver is not None: | 231 | if apturl.minver is not None: |
156 | 231 | verStr = self.cache[apturl.package].candidateVersion | 232 | verStr = self.cache[apturl.package].candidate_version |
157 | 232 | if apt_pkg.VersionCompare(verStr, apturl.minver) < 1: | 233 | if apt_pkg.version_compare(verStr, apturl.minver) < 1: |
158 | 233 | ui.error(_("Package '%s' requests minimal version '%s', but " | 234 | ui.error(_( |
159 | 234 | "only '%s' is available") % (apturl.package, | 235 | "Package '%s' requests minimal version '%s', but " |
160 | 235 | apturl.minver, | 236 | "only '%s' is available") % (apturl.package, |
161 | 236 | verStr)) | 237 | apturl.minver, |
162 | 238 | verStr)) | ||
163 | 237 | continue | 239 | continue |
164 | 238 | 240 | ||
165 | 239 | # install it | 241 | # install it |
166 | @@ -244,4 +246,3 @@ | |||
167 | 244 | 246 | ||
168 | 245 | # return values | 247 | # return values |
169 | 246 | return ret | 248 | return ret |
170 | 247 | |||
171 | 248 | 249 | ||
172 | === modified file 'AptUrl/Helpers.py' | |||
173 | --- AptUrl/Helpers.py 2012-06-11 21:35:40 +0000 | |||
174 | +++ AptUrl/Helpers.py 2012-06-14 00:37:19 +0000 | |||
175 | @@ -39,25 +39,35 @@ | |||
176 | 39 | return str | 39 | return str |
177 | 40 | 40 | ||
178 | 41 | def get_dist(): | 41 | def get_dist(): |
180 | 42 | return subprocess.Popen(["lsb_release","-c","-s"],stdout=subprocess.PIPE).communicate()[0].strip() | 42 | return subprocess.Popen(["lsb_release","-c","-s"], |
181 | 43 | stdout=subprocess.PIPE).communicate()[0].strip() | ||
182 | 43 | 44 | ||
183 | 44 | 45 | ||
184 | 45 | def parse_pkg(pkgobj): | 46 | def parse_pkg(pkgobj): |
185 | 46 | summary = "" | 47 | summary = "" |
186 | 47 | description = "" | 48 | description = "" |
189 | 48 | if pkgobj.description.count("\n") > 0: | 49 | try: |
190 | 49 | summary, description = pkgobj.description.split('\n', 1) | 50 | pkg_description = pkgobj.description |
191 | 51 | except AttributeError: | ||
192 | 52 | # Python 3 | ||
193 | 53 | pkg_description = pkgobj.versions[0].description | ||
194 | 54 | if pkg_description.count("\n") > 0: | ||
195 | 55 | summary, description = pkg_description.split('\n', 1) | ||
196 | 50 | else: | 56 | else: |
198 | 51 | summary = pkgobj.description | 57 | summary = pkg_description |
199 | 52 | lines = description.rstrip('\n').split('\n') | 58 | lines = description.rstrip('\n').split('\n') |
200 | 53 | if len(lines) > 1 and lines[-1].startswith('Homepage: '): | 59 | if len(lines) > 1 and lines[-1].startswith('Homepage: '): |
201 | 54 | homepage = lines[-1].split(' ', 1)[1] | 60 | homepage = lines[-1].split(' ', 1)[1] |
202 | 55 | description = '\n'.join(lines[:-1]) | 61 | description = '\n'.join(lines[:-1]) |
203 | 56 | else: | 62 | else: |
205 | 57 | homepage = pkgobj.homepage | 63 | try: |
206 | 64 | homepage = pkgobj.homepage | ||
207 | 65 | except AttributeError: | ||
208 | 66 | # Python 3 | ||
209 | 67 | homepage = pkgobj.versions[0].homepage | ||
210 | 58 | return (summary, description, homepage) | 68 | return (summary, description, homepage) |
211 | 59 | 69 | ||
212 | 60 | def format_description(description): | 70 | def format_description(description): |
216 | 61 | const = 'APTURL_DOUBLE_EMPTY_LINE_PLACEHOLDER' | 71 | const = 'APTURL_DOUBLE_EMPTY_LINE_PLACEHOLDER' |
217 | 62 | return description.replace('\n\n', const).replace('\n', ' ').replace( | 72 | return description.replace('\n\n', const).replace('\n', ' ').replace( |
218 | 63 | const, '\n\n') | 73 | const, '\n\n') |
219 | 64 | 74 | ||
220 | === modified file 'AptUrl/Parser.py' | |||
221 | --- AptUrl/Parser.py 2012-06-11 21:35:40 +0000 | |||
222 | +++ AptUrl/Parser.py 2012-06-14 00:37:19 +0000 | |||
223 | @@ -23,7 +23,6 @@ | |||
224 | 23 | import os | 23 | import os |
225 | 24 | import string | 24 | import string |
226 | 25 | from string import Template | 25 | from string import Template |
227 | 26 | from subprocess import Popen, PIPE | ||
228 | 27 | from .Helpers import get_dist | 26 | from .Helpers import get_dist |
229 | 28 | from .Helpers import _ | 27 | from .Helpers import _ |
230 | 29 | 28 | ||
231 | @@ -82,7 +81,8 @@ | |||
232 | 82 | " test if the url matches the internal whitelist " | 81 | " test if the url matches the internal whitelist " |
233 | 83 | for char in raw_url: | 82 | for char in raw_url: |
234 | 84 | if not char in whitelist: | 83 | if not char in whitelist: |
236 | 85 | raise InvalidUrlException(raw_url, _("Non whitelist char in the uri")) | 84 | raise InvalidUrlException( |
237 | 85 | raw_url, _("Non whitelist char in the uri")) | ||
238 | 86 | return True | 86 | return True |
239 | 87 | 87 | ||
240 | 88 | def set_value(apt_url, s): | 88 | def set_value(apt_url, s): |
241 | 89 | 89 | ||
242 | === modified file 'AptUrl/UI.py' | |||
243 | --- AptUrl/UI.py 2012-06-11 20:34:59 +0000 | |||
244 | +++ AptUrl/UI.py 2012-06-14 00:37:19 +0000 | |||
245 | @@ -1,5 +1,4 @@ | |||
246 | 1 | 1 | ||
247 | 2 | from . import Helpers | ||
248 | 3 | from .Helpers import _, _n | 2 | from .Helpers import _, _n |
249 | 4 | 3 | ||
250 | 5 | class AbstractUI(object): | 4 | class AbstractUI(object): |
251 | 6 | 5 | ||
252 | === modified file 'AptUrl/gtk/GtkUI.py' | |||
253 | --- AptUrl/gtk/GtkUI.py 2012-06-11 20:34:59 +0000 | |||
254 | +++ AptUrl/gtk/GtkUI.py 2012-06-14 00:37:19 +0000 | |||
255 | @@ -5,14 +5,11 @@ | |||
256 | 5 | from gi.repository import Gdk | 5 | from gi.repository import Gdk |
257 | 6 | from gi.repository import GObject | 6 | from gi.repository import GObject |
258 | 7 | GObject.threads_init() | 7 | GObject.threads_init() |
260 | 8 | import subprocess | 8 | |
261 | 9 | import os | ||
262 | 9 | import sys | 10 | import sys |
263 | 10 | |||
264 | 11 | import os | ||
265 | 12 | import os.path | ||
266 | 13 | |||
267 | 14 | import apt_pkg | 11 | import apt_pkg |
269 | 15 | 12 | import subprocess | |
270 | 16 | 13 | ||
271 | 17 | from AptUrl.UI import AbstractUI | 14 | from AptUrl.UI import AbstractUI |
272 | 18 | from AptUrl import Helpers | 15 | from AptUrl import Helpers |
273 | @@ -20,13 +17,22 @@ | |||
274 | 20 | 17 | ||
275 | 21 | from .backend import get_backend | 18 | from .backend import get_backend |
276 | 22 | 19 | ||
277 | 20 | |||
278 | 21 | APTURL_UI_FILE = os.environ.get( | ||
279 | 22 | # Set this envar to use a test .ui file. | ||
280 | 23 | 'APTURL_UI_FILE', | ||
281 | 24 | # System file to use if the envar is not set. | ||
282 | 25 | '/usr/share/apturl/apturl-gtk.ui' | ||
283 | 26 | ) | ||
284 | 27 | |||
285 | 28 | |||
286 | 23 | class GtkUI(AbstractUI): | 29 | class GtkUI(AbstractUI): |
287 | 24 | def __init__(self): | 30 | def __init__(self): |
288 | 25 | Gtk.init_check(sys.argv) | 31 | Gtk.init_check(sys.argv) |
289 | 26 | # create empty dialog | 32 | # create empty dialog |
290 | 27 | self.dia_xml = Gtk.Builder() | 33 | self.dia_xml = Gtk.Builder() |
291 | 28 | self.dia_xml.set_translation_domain("apturl") | 34 | self.dia_xml.set_translation_domain("apturl") |
293 | 29 | self.dia_xml.add_from_file('/usr/share/apturl/apturl-gtk.ui') | 35 | self.dia_xml.add_from_file(APTURL_UI_FILE) |
294 | 30 | self.dia = self.dia_xml.get_object('confirmation_dialog') | 36 | self.dia = self.dia_xml.get_object('confirmation_dialog') |
295 | 31 | self.dia.realize() | 37 | self.dia.realize() |
296 | 32 | self.backend = get_backend(self.dia) | 38 | self.backend = get_backend(self.dia) |
297 | @@ -37,7 +43,8 @@ | |||
298 | 37 | Gtk.main_quit() | 43 | Gtk.main_quit() |
299 | 38 | 44 | ||
300 | 39 | # generic dialogs | 45 | # generic dialogs |
302 | 40 | def _get_dialog(self, dialog_type, summary, msg="", buttons=Gtk.ButtonsType.CLOSE): | 46 | def _get_dialog(self, dialog_type, summary, msg="", |
303 | 47 | buttons=Gtk.ButtonsType.CLOSE): | ||
304 | 41 | " internal helper for dialog construction " | 48 | " internal helper for dialog construction " |
305 | 42 | d = Gtk.MessageDialog(parent=self.dia, | 49 | d = Gtk.MessageDialog(parent=self.dia, |
306 | 43 | flags=Gtk.DialogFlags.MODAL, | 50 | flags=Gtk.DialogFlags.MODAL, |
307 | @@ -50,7 +57,7 @@ | |||
308 | 50 | d.realize() | 57 | d.realize() |
309 | 51 | d.get_window().set_functions(Gdk.WMFunction.MOVE) | 58 | d.get_window().set_functions(Gdk.WMFunction.MOVE) |
310 | 52 | return d | 59 | return d |
312 | 53 | 60 | ||
313 | 54 | def error(self, summary, msg=""): | 61 | def error(self, summary, msg=""): |
314 | 55 | d = self._get_dialog(Gtk.MessageType.ERROR, summary, msg) | 62 | d = self._get_dialog(Gtk.MessageType.ERROR, summary, msg) |
315 | 56 | d.run() | 63 | d.run() |
316 | @@ -73,7 +80,7 @@ | |||
317 | 73 | if res != Gtk.ResponseType.YES: | 80 | if res != Gtk.ResponseType.YES: |
318 | 74 | return False | 81 | return False |
319 | 75 | return True | 82 | return True |
321 | 76 | 83 | ||
322 | 77 | # specific dialogs | 84 | # specific dialogs |
323 | 78 | def askEnableChannel(self, channel, channel_info_html): | 85 | def askEnableChannel(self, channel, channel_info_html): |
324 | 79 | summary = _("Enable additional software channel") | 86 | summary = _("Enable additional software channel") |
325 | @@ -115,7 +122,7 @@ | |||
326 | 115 | return False | 122 | return False |
327 | 116 | return True | 123 | return True |
328 | 117 | 124 | ||
330 | 118 | 125 | ||
331 | 119 | def doEnableChannel(self, channelpath, channelkey): | 126 | def doEnableChannel(self, channelpath, channelkey): |
332 | 120 | cmd = ["gksu", | 127 | cmd = ["gksu", |
333 | 121 | "--desktop", "/usr/share/applications/gnome-app-install.desktop", | 128 | "--desktop", "/usr/share/applications/gnome-app-install.desktop", |
334 | @@ -155,25 +162,25 @@ | |||
335 | 155 | tbuf.set_text(desc) | 162 | tbuf.set_text(desc) |
336 | 156 | description_text_view.set_buffer(tbuf) | 163 | description_text_view.set_buffer(tbuf) |
337 | 157 | dia.set_icon(Gtk.IconTheme.get_default().load_icon('deb', 16, False)) | 164 | dia.set_icon(Gtk.IconTheme.get_default().load_icon('deb', 16, False)) |
339 | 158 | 165 | ||
340 | 159 | # check if another package manager is already running | 166 | # check if another package manager is already running |
341 | 160 | # FIXME: just checking for the existance of the file is | 167 | # FIXME: just checking for the existance of the file is |
342 | 161 | # not sufficient, it need to be tested if it can | 168 | # not sufficient, it need to be tested if it can |
345 | 162 | # be locked via apt_pkg.GetLock() | 169 | # be locked via apt_pkg.GetLock() |
346 | 163 | # - but that needs to run as root | 170 | # - but that needs to run as root |
347 | 164 | # - a dbus helper might be the best answer here | 171 | # - a dbus helper might be the best answer here |
348 | 165 | #args = (update_button_status, dia_xml.get_object("yes_button"), | 172 | #args = (update_button_status, dia_xml.get_object("yes_button"), |
349 | 166 | # dia_xml.get_object("infolabel")) | 173 | # dia_xml.get_object("infolabel")) |
350 | 167 | #args[0](*args[1:]) | 174 | #args[0](*args[1:]) |
351 | 168 | #timer_id = GObject.timeout_add(750, *args ) | 175 | #timer_id = GObject.timeout_add(750, *args ) |
353 | 169 | 176 | ||
354 | 170 | # show the dialog | 177 | # show the dialog |
355 | 171 | res = dia.run() | 178 | res = dia.run() |
356 | 172 | #GObject.source_remove(timer_id) | 179 | #GObject.source_remove(timer_id) |
357 | 173 | if res != Gtk.ResponseType.YES: | 180 | if res != Gtk.ResponseType.YES: |
358 | 174 | dia.hide() | 181 | dia.hide() |
359 | 175 | return False | 182 | return False |
361 | 176 | 183 | ||
362 | 177 | # don't set on-top while installing | 184 | # don't set on-top while installing |
363 | 178 | dia.set_keep_above(False) | 185 | dia.set_keep_above(False) |
364 | 179 | return True | 186 | return True |
365 | 180 | 187 | ||
366 | === modified file 'AptUrl/gtk/backend/__init__.py' | |||
367 | --- AptUrl/gtk/backend/__init__.py 2011-07-22 12:04:26 +0000 | |||
368 | +++ AptUrl/gtk/backend/__init__.py 2012-06-14 00:37:19 +0000 | |||
369 | @@ -45,7 +45,7 @@ | |||
370 | 45 | not "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" in os.environ): | 45 | not "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" in os.environ): |
371 | 46 | # check if the gtkwidgets are installed as well | 46 | # check if the gtkwidgets are installed as well |
372 | 47 | try: | 47 | try: |
374 | 48 | from InstallBackendAptdaemon import InstallBackendAptdaemon | 48 | from .InstallBackendAptdaemon import InstallBackendAptdaemon |
375 | 49 | return InstallBackendAptdaemon(*args, **kwargs) | 49 | return InstallBackendAptdaemon(*args, **kwargs) |
376 | 50 | except ImportError: | 50 | except ImportError: |
377 | 51 | import logging | 51 | import logging |
378 | @@ -53,7 +53,7 @@ | |||
379 | 53 | # try synaptic | 53 | # try synaptic |
380 | 54 | if (os.path.exists("/usr/sbin/synaptic") and | 54 | if (os.path.exists("/usr/sbin/synaptic") and |
381 | 55 | not "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" in os.environ): | 55 | not "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" in os.environ): |
383 | 56 | from InstallBackendSynaptic import InstallBackendSynaptic | 56 | from .InstallBackendSynaptic import InstallBackendSynaptic |
384 | 57 | return InstallBackendSynaptic(*args, **kwargs) | 57 | return InstallBackendSynaptic(*args, **kwargs) |
385 | 58 | # nothing found, raise | 58 | # nothing found, raise |
386 | 59 | raise Exception("No working backend found, please try installing " | 59 | raise Exception("No working backend found, please try installing " |
387 | 60 | 60 | ||
388 | === modified file 'AptUrl/kde/KdeUI.py' | |||
389 | --- AptUrl/kde/KdeUI.py 2012-06-11 20:34:59 +0000 | |||
390 | +++ AptUrl/kde/KdeUI.py 2012-06-14 00:37:19 +0000 | |||
391 | @@ -1,6 +1,6 @@ | |||
392 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
393 | 2 | 2 | ||
395 | 3 | from __future__ import print_funcion | 3 | from __future__ import print_function |
396 | 4 | 4 | ||
397 | 5 | from PyQt4.QtCore import * | 5 | from PyQt4.QtCore import * |
398 | 6 | from PyQt4.QtGui import * | 6 | from PyQt4.QtGui import * |
399 | @@ -9,19 +9,20 @@ | |||
400 | 9 | from PyKDE4.kdeui import * | 9 | from PyKDE4.kdeui import * |
401 | 10 | from PyKDE4.kdecore import * | 10 | from PyKDE4.kdecore import * |
402 | 11 | 11 | ||
403 | 12 | import subprocess | ||
404 | 13 | from tempfile import NamedTemporaryFile | ||
405 | 14 | |||
406 | 15 | import os | 12 | import os |
407 | 16 | import os.path | ||
408 | 17 | |||
409 | 18 | import time | ||
410 | 19 | import thread | ||
411 | 20 | import apt_pkg | 13 | import apt_pkg |
412 | 14 | import subprocess | ||
413 | 21 | 15 | ||
414 | 22 | from AptUrl.UI import AbstractUI | 16 | from AptUrl.UI import AbstractUI |
417 | 23 | from AptUrl import Helpers | 17 | from AptUrl.Helpers import _ |
418 | 24 | from AptUrl.Helpers import utf8, _, _n | 18 | |
419 | 19 | APTURL_UI_FILE = os.environ.get( | ||
420 | 20 | # Set this envar to use a test .ui file. | ||
421 | 21 | 'APTURL_UI_FILE', | ||
422 | 22 | # System file to use if the envar is not set. | ||
423 | 23 | '/usr/share/apturl/apturl-qt.ui' | ||
424 | 24 | ) | ||
425 | 25 | |||
426 | 25 | 26 | ||
427 | 26 | class AptUrlDialog(KDialog): | 27 | class AptUrlDialog(KDialog): |
428 | 27 | def __init__(self,parent=None): | 28 | def __init__(self,parent=None): |
429 | @@ -34,6 +35,7 @@ | |||
430 | 34 | else: | 35 | else: |
431 | 35 | KDialog.reject(self) | 36 | KDialog.reject(self) |
432 | 36 | 37 | ||
433 | 38 | |||
434 | 37 | class KdeUI(AbstractUI): | 39 | class KdeUI(AbstractUI): |
435 | 38 | def __init__(self): | 40 | def __init__(self): |
436 | 39 | self.dialog = AptUrlDialog() | 41 | self.dialog = AptUrlDialog() |
437 | @@ -41,7 +43,7 @@ | |||
438 | 41 | self.d = QWidget(self.dialog) | 43 | self.d = QWidget(self.dialog) |
439 | 42 | self.dialog.setMainWidget(self.d) | 44 | self.dialog.setMainWidget(self.d) |
440 | 43 | 45 | ||
442 | 44 | uic.loadUi('/usr/share/apturl/apturl-qt.ui', self.d) | 46 | uic.loadUi(APTURL_UI_FILE, self.d) |
443 | 45 | self.d.image_label.setPixmap(KIcon("application-x-deb").pixmap(64,64)) | 47 | self.d.image_label.setPixmap(KIcon("application-x-deb").pixmap(64,64)) |
444 | 46 | 48 | ||
445 | 47 | # generic dialogs | 49 | # generic dialogs |
446 | @@ -97,7 +99,8 @@ | |||
447 | 97 | "software-properties-kde", | 99 | "software-properties-kde", |
448 | 98 | "--enable-component", "%s" % ' '.join(sections)] | 100 | "--enable-component", "%s" % ' '.join(sections)] |
449 | 99 | try: | 101 | try: |
451 | 100 | output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] | 102 | output = subprocess.Popen( |
452 | 103 | cmd, stdout=subprocess.PIPE).communicate()[0] | ||
453 | 101 | except OSError as e: | 104 | except OSError as e: |
454 | 102 | print("Execution failed: %s" % e, file=sys.stderr) | 105 | print("Execution failed: %s" % e, file=sys.stderr) |
455 | 103 | return True | 106 | return True |
456 | @@ -129,7 +132,7 @@ | |||
457 | 129 | def askInstallPackage(self, package, summary, description, homepage): | 132 | def askInstallPackage(self, package, summary, description, homepage): |
458 | 130 | header = "<h2>" + _("Install additional software?") + "</h2>" | 133 | header = "<h2>" + _("Install additional software?") + "</h2>" |
459 | 131 | body = _("Do you want to install package '%s'?") % package | 134 | body = _("Do you want to install package '%s'?") % package |
461 | 132 | desc = "%s\n\n%s" % (summary, Helpers.format_description(description)) | 135 | #desc = "%s\n\n%s" % (summary, Helpers.format_description(description)) |
462 | 133 | 136 | ||
463 | 134 | self.d.header_label.setText(header) | 137 | self.d.header_label.setText(header) |
464 | 135 | self.d.body_label.setText(body) | 138 | self.d.body_label.setText(body) |
465 | @@ -145,36 +148,19 @@ | |||
466 | 145 | 148 | ||
467 | 146 | # progress etc | 149 | # progress etc |
468 | 147 | def doUpdate(self): | 150 | def doUpdate(self): |
474 | 148 | p = subprocess.Popen(['qapt-batch', | 151 | subprocess.check_call([ |
475 | 149 | '--attach', str(self.dialog.winId()), | 152 | 'qapt-batch', |
476 | 150 | '--update' | 153 | '--attach', str(self.dialog.winId()), |
477 | 151 | ]) | 154 | '--update' |
478 | 152 | self._wait_for_install_package(p) | 155 | ]) |
479 | 153 | 156 | ||
480 | 154 | def doInstall(self, apturl): | 157 | def doInstall(self, apturl): |
504 | 155 | p = subprocess.Popen(['qapt-batch', | 158 | subprocess.check_call([ |
505 | 156 | '--attach', str(self.dialog.winId()), | 159 | 'qapt-batch', |
506 | 157 | '--install', | 160 | '--attach', str(self.dialog.winId()), |
507 | 158 | apturl.package | 161 | '--install', |
508 | 159 | ]) | 162 | apturl.package |
509 | 160 | self._wait_for_install_package(p) | 163 | ]) |
487 | 161 | return True | ||
488 | 162 | |||
489 | 163 | # helpers | ||
490 | 164 | def _wait_for_p(self, p, lock): | ||
491 | 165 | " helper for the thread to wait for process p to finish " | ||
492 | 166 | p.wait() | ||
493 | 167 | lock.release() | ||
494 | 168 | |||
495 | 169 | def _wait_for_install_package(self, p): | ||
496 | 170 | # wait for qapt-batch | ||
497 | 171 | lock = thread.allocate_lock() | ||
498 | 172 | lock.acquire() | ||
499 | 173 | thread.start_new_thread(self._wait_for_p, (p, lock)) | ||
500 | 174 | |||
501 | 175 | while lock.locked(): | ||
502 | 176 | time.sleep(0.01) | ||
503 | 177 | return True | ||
510 | 178 | 164 | ||
511 | 179 | 165 | ||
512 | 180 | if __name__ == "__main__": | 166 | if __name__ == "__main__": |
513 | 181 | 167 | ||
514 | === modified file 'apturl-gtk' | |||
515 | --- apturl-gtk 2012-06-11 20:34:59 +0000 | |||
516 | +++ apturl-gtk 2012-06-14 00:37:19 +0000 | |||
517 | @@ -1,4 +1,4 @@ | |||
519 | 1 | #!/usr/bin/python | 1 | #!/usr/bin/python3 |
520 | 2 | # | 2 | # |
521 | 3 | # Copyright (c) 2007-2008 Canonical | 3 | # Copyright (c) 2007-2008 Canonical |
522 | 4 | # | 4 | # |
523 | @@ -22,13 +22,12 @@ | |||
524 | 22 | # along with AptUrl; if not, write to the Free Software | 22 | # along with AptUrl; if not, write to the Free Software |
525 | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
526 | 24 | 24 | ||
527 | 25 | from __future__ import print_function | ||
528 | 25 | 26 | ||
529 | 26 | # ignore apt's "API not stable yet" warning | 27 | # ignore apt's "API not stable yet" warning |
530 | 27 | import warnings | 28 | import warnings |
531 | 28 | warnings.filterwarnings("ignore", category=FutureWarning, append=1) | 29 | warnings.filterwarnings("ignore", category=FutureWarning, append=1) |
532 | 29 | 30 | ||
533 | 30 | from __future__ import print_function | ||
534 | 31 | |||
535 | 32 | import sys | 31 | import sys |
536 | 33 | import gettext | 32 | import gettext |
537 | 34 | from gettext import gettext as _ | 33 | from gettext import gettext as _ |
538 | 35 | 34 | ||
539 | === modified file 'apturl-kde' | |||
540 | --- apturl-kde 2012-06-11 20:34:59 +0000 | |||
541 | +++ apturl-kde 2012-06-14 00:37:19 +0000 | |||
542 | @@ -1,4 +1,4 @@ | |||
544 | 1 | #!/usr/bin/python | 1 | #!/usr/bin/python3 |
545 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
546 | 3 | # | 3 | # |
547 | 4 | # Copyright © 2009 Harald Sitter <apachelogger@ubuntu.com> | 4 | # Copyright © 2009 Harald Sitter <apachelogger@ubuntu.com> |
548 | @@ -22,13 +22,12 @@ | |||
549 | 22 | # along with AptUrl; if not, write to the Free Software | 22 | # along with AptUrl; if not, write to the Free Software |
550 | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
551 | 24 | 24 | ||
552 | 25 | from __future__ import print_function | ||
553 | 25 | 26 | ||
554 | 26 | # ignore apt's "API not stable yet" warning | 27 | # ignore apt's "API not stable yet" warning |
555 | 27 | import warnings | 28 | import warnings |
556 | 28 | warnings.filterwarnings("ignore", category=FutureWarning, append=1) | 29 | warnings.filterwarnings("ignore", category=FutureWarning, append=1) |
557 | 29 | 30 | ||
558 | 30 | from __future__ import print_function | ||
559 | 31 | |||
560 | 32 | import sys | 31 | import sys |
561 | 33 | import gettext | 32 | import gettext |
562 | 34 | from gettext import gettext as _ | 33 | from gettext import gettext as _ |
563 | @@ -58,18 +57,18 @@ | |||
564 | 58 | if __name__ == "__main__": | 57 | if __name__ == "__main__": |
565 | 59 | appName = "apturl" | 58 | appName = "apturl" |
566 | 60 | catalog = "" | 59 | catalog = "" |
568 | 61 | programName = ki18n ("AptUrl") | 60 | programName = ki18n (b"AptUrl") |
569 | 62 | version = "1.0" | 61 | version = "1.0" |
571 | 63 | description = ki18n ("AptUrl for Kubuntu") | 62 | description = ki18n (b"AptUrl for Kubuntu") |
572 | 64 | license = KAboutData.License_GPL | 63 | license = KAboutData.License_GPL |
575 | 65 | copyright = ki18n ("© Harald Sitter") | 64 | copyright = ki18n ("© Harald Sitter".encode('utf-8')) |
576 | 66 | text = ki18n ("none") | 65 | text = ki18n (b"none") |
577 | 67 | homePage = "http://www.kubuntu.org/" | 66 | homePage = "http://www.kubuntu.org/" |
578 | 68 | bugEmail = "" | 67 | bugEmail = "" |
579 | 69 | 68 | ||
580 | 70 | about = KAboutData (appName, catalog, programName, version, description, | 69 | about = KAboutData (appName, catalog, programName, version, description, |
581 | 71 | license, copyright, text, homePage, bugEmail) | 70 | license, copyright, text, homePage, bugEmail) |
583 | 72 | about.addAuthor(ki18n("Harald Sitter"), KLocalizedString(), | 71 | about.addAuthor(ki18n(b"Harald Sitter"), KLocalizedString(), |
584 | 73 | "apachelogger@ubuntu.com") | 72 | "apachelogger@ubuntu.com") |
585 | 74 | KCmdLineArgs.init([""],about) | 73 | KCmdLineArgs.init([""],about) |
586 | 75 | 74 | ||
587 | 76 | 75 | ||
588 | === modified file 'debian/apturl-common.install' | |||
589 | --- debian/apturl-common.install 2011-03-30 13:46:50 +0000 | |||
590 | +++ debian/apturl-common.install 2012-06-14 00:37:19 +0000 | |||
591 | @@ -1,7 +1,7 @@ | |||
592 | 1 | etc/ | 1 | etc/ |
593 | 2 | usr/bin/apturl | 2 | usr/bin/apturl |
596 | 3 | usr/lib/python2.?/*-packages/AptUrl/*py* | 3 | usr/lib/python3/*-packages/AptUrl/*py* |
597 | 4 | usr/lib/python2.?/*-packages/apturl-*.egg-info | 4 | usr/lib/python3/*-packages/apturl-*.egg-info |
598 | 5 | usr/share/kde4/services | 5 | usr/share/kde4/services |
599 | 6 | usr/share/locale | 6 | usr/share/locale |
600 | 7 | usr/share/applications | 7 | usr/share/applications |
601 | 8 | 8 | ||
602 | === modified file 'debian/apturl-kde.install' | |||
603 | --- debian/apturl-kde.install 2010-12-17 14:42:22 +0000 | |||
604 | +++ debian/apturl-kde.install 2012-06-14 00:37:19 +0000 | |||
605 | @@ -1,3 +1,3 @@ | |||
606 | 1 | usr/bin/apturl-kde | 1 | usr/bin/apturl-kde |
608 | 2 | usr/lib/python2.?/*-packages/AptUrl/kde/*py* | 2 | usr/lib/python3/*-packages/AptUrl/kde/*py* |
609 | 3 | usr/share/apturl/*-qt.ui | 3 | usr/share/apturl/*-qt.ui |
610 | 4 | 4 | ||
611 | === modified file 'debian/apturl.install' | |||
612 | --- debian/apturl.install 2011-07-22 12:04:26 +0000 | |||
613 | +++ debian/apturl.install 2012-06-14 00:37:19 +0000 | |||
614 | @@ -1,5 +1,5 @@ | |||
615 | 1 | usr/bin/apturl-gtk | 1 | usr/bin/apturl-gtk |
618 | 2 | usr/lib/python2.?/*-packages/AptUrl/gtk/*py* | 2 | usr/lib/python3/*-packages/AptUrl/gtk/*py* |
619 | 3 | usr/lib/python2.?/*-packages/AptUrl/gtk/backend/ | 3 | usr/lib/python3/*-packages/AptUrl/gtk/backend/ |
620 | 4 | usr/share/apturl/*-gtk.ui | 4 | usr/share/apturl/*-gtk.ui |
621 | 5 | usr/share/gconf | 5 | usr/share/gconf |
622 | 6 | 6 | ||
623 | === modified file 'debian/changelog' | |||
624 | --- debian/changelog 2012-06-12 16:09:13 +0000 | |||
625 | +++ debian/changelog 2012-06-14 00:37:19 +0000 | |||
626 | @@ -12,6 +12,27 @@ | |||
627 | 12 | to avoid attempts to destroy it without a thread context. | 12 | to avoid attempts to destroy it without a thread context. |
628 | 13 | - Open temporary synaptic selections file in text mode. | 13 | - Open temporary synaptic selections file in text mode. |
629 | 14 | 14 | ||
630 | 15 | [ Barry Warsaw ] | ||
631 | 16 | * Additional Python 3 fixes: | ||
632 | 17 | + Port setup.py to Python 3. | ||
633 | 18 | + Use the new python-apt API since the legacy API is not available in | ||
634 | 19 | Python 3. | ||
635 | 20 | + ki18n() takes bytes. | ||
636 | 21 | + Fix relative imports so the code can be run from source. | ||
637 | 22 | + Fixed some additional packaging paths. | ||
638 | 23 | + Fix typos in __future__ imports. | ||
639 | 24 | + Change #! lines to use python3. | ||
640 | 25 | + Changed debian/control and debian/rules to use python3. | ||
641 | 26 | + Change debian/compat == 8 | ||
642 | 27 | + apturl now must require python3-aptdaemon.gtk3widgets (i.e. not | | ||
643 | 28 | synaptic) due to the Python 3 port of update-manager. | ||
644 | 29 | * Other changes: | ||
645 | 30 | + Remove the need for threads in the KDE front-end. | ||
646 | 31 | + Enable running the test suite via `python3 -m unittest discover` | ||
647 | 32 | + i18n updates. | ||
648 | 33 | + Various and sundry pyflakes, whitespace, style, line length, and | ||
649 | 34 | spelling fixes. | ||
650 | 35 | |||
651 | 15 | -- Brian Murray <brian@ubuntu.com> Mon, 11 Jun 2012 10:32:52 -0700 | 36 | -- Brian Murray <brian@ubuntu.com> Mon, 11 Jun 2012 10:32:52 -0700 |
652 | 16 | 37 | ||
653 | 17 | apturl (0.5.1ubuntu3) precise; urgency=low | 38 | apturl (0.5.1ubuntu3) precise; urgency=low |
654 | 18 | 39 | ||
655 | === modified file 'debian/compat' | |||
656 | --- debian/compat 2009-09-10 11:45:36 +0000 | |||
657 | +++ debian/compat 2012-06-14 00:37:19 +0000 | |||
658 | @@ -1,1 +1,1 @@ | |||
660 | 1 | 7 | 1 | 8 |
661 | 2 | 2 | ||
662 | === modified file 'debian/control' | |||
663 | --- debian/control 2012-03-13 18:45:45 +0000 | |||
664 | +++ debian/control 2012-06-14 00:37:19 +0000 | |||
665 | @@ -2,23 +2,26 @@ | |||
666 | 2 | Section: admin | 2 | Section: admin |
667 | 3 | Priority: optional | 3 | Priority: optional |
668 | 4 | Maintainer: Michael Vogt <mvo@ubuntu.com> | 4 | Maintainer: Michael Vogt <mvo@ubuntu.com> |
670 | 5 | Build-Depends: debhelper (>= 7.0.50~), | 5 | Build-Depends: debhelper (>= 8), |
671 | 6 | intltool, | 6 | intltool, |
675 | 7 | python-dev, | 7 | python3-dev, |
676 | 8 | python-distutils-extra | 8 | python3-distutils-extra, |
677 | 9 | XS-Python-Version: current | 9 | python3-update-manager, |
678 | 10 | python3-aptdaemon | ||
679 | 11 | X-Python3-Version: >= 3.2 | ||
680 | 10 | Standards-Version: 3.9.1 | 12 | Standards-Version: 3.9.1 |
681 | 11 | Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/ | 13 | Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/ |
682 | 12 | Vcs-Browser: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/files | 14 | Vcs-Browser: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/files |
683 | 13 | 15 | ||
684 | 14 | Package: apturl-common | 16 | Package: apturl-common |
685 | 15 | Architecture: any | 17 | Architecture: any |
687 | 16 | Depends: ${python:Depends}, | 18 | Depends: ${python3:Depends}, |
688 | 17 | ${shlibs:Depends}, | 19 | ${shlibs:Depends}, |
689 | 18 | ${misc:Depends}, | 20 | ${misc:Depends}, |
691 | 19 | python-apt | 21 | python3-apt, |
692 | 22 | python3-update-manager, | ||
693 | 23 | python3-aptdaemon | ||
694 | 20 | Replaces: apturl (<< 0.3.6ubuntu2) | 24 | Replaces: apturl (<< 0.3.6ubuntu2) |
695 | 21 | XB-Python-Version: ${python:Versions} | ||
696 | 22 | Description: install packages using the apt protocol - common data | 25 | Description: install packages using the apt protocol - common data |
697 | 23 | AptUrl is a simple graphical application that takes an URL (which follows the | 26 | AptUrl is a simple graphical application that takes an URL (which follows the |
698 | 24 | apt-protocol) as a command line option, parses it and carries out the | 27 | apt-protocol) as a command line option, parses it and carries out the |
699 | @@ -30,18 +33,17 @@ | |||
700 | 30 | 33 | ||
701 | 31 | Package: apturl | 34 | Package: apturl |
702 | 32 | Architecture: any | 35 | Architecture: any |
704 | 33 | Depends: ${python:Depends}, | 36 | Depends: ${python3:Depends}, |
705 | 34 | ${shlibs:Depends}, | 37 | ${shlibs:Depends}, |
706 | 35 | ${misc:Depends}, | 38 | ${misc:Depends}, |
707 | 36 | apturl-common (= ${binary:Version}), | 39 | apturl-common (= ${binary:Version}), |
708 | 37 | gnome-icon-theme (>= 2.14.0-1), | 40 | gnome-icon-theme (>= 2.14.0-1), |
710 | 38 | python-gi, | 41 | python3-gi, |
711 | 39 | software-properties-gtk, | 42 | software-properties-gtk, |
713 | 40 | python-aptdaemon.gtk3widgets | synaptic, | 43 | python3-aptdaemon.gtk3widgets, |
714 | 41 | gir1.2-gtk-3.0, | 44 | gir1.2-gtk-3.0, |
715 | 42 | gir1.2-webkit-3.0 | 45 | gir1.2-webkit-3.0 |
716 | 43 | Recommends: libgtk2-perl (>= 1:1.130) | 46 | Recommends: libgtk2-perl (>= 1:1.130) |
717 | 44 | XB-Python-Version: ${python:Versions} | ||
718 | 45 | Description: install packages using the apt protocol - GTK+ frontend | 47 | Description: install packages using the apt protocol - GTK+ frontend |
719 | 46 | AptUrl is a simple graphical application that takes an URL (which follows the | 48 | AptUrl is a simple graphical application that takes an URL (which follows the |
720 | 47 | apt-protocol) as a command line option, parses it and carries out the | 49 | apt-protocol) as a command line option, parses it and carries out the |
721 | @@ -53,16 +55,15 @@ | |||
722 | 53 | 55 | ||
723 | 54 | Package: apturl-kde | 56 | Package: apturl-kde |
724 | 55 | Architecture: any | 57 | Architecture: any |
726 | 56 | Depends: ${python:Depends}, | 58 | Depends: ${python3:Depends}, |
727 | 57 | ${shlibs:Depends}, | 59 | ${shlibs:Depends}, |
728 | 58 | ${misc:Depends}, | 60 | ${misc:Depends}, |
731 | 59 | python-qt4, | 61 | python3-pyqt4, |
732 | 60 | python-kde4, | 62 | python3-pykde4, |
733 | 61 | apturl-common (= ${binary:Version}), | 63 | apturl-common (= ${binary:Version}), |
734 | 62 | kdesudo, | 64 | kdesudo, |
735 | 63 | qapt-batch, | 65 | qapt-batch, |
736 | 64 | software-properties-kde (>= 0.75.2) | 66 | software-properties-kde (>= 0.75.2) |
737 | 65 | XB-Python-Version: ${python:Versions} | ||
738 | 66 | Description: install packages using the apt protocol - KDE frontend | 67 | Description: install packages using the apt protocol - KDE frontend |
739 | 67 | AptUrl is a simple graphical application that takes an URL (which follows the | 68 | AptUrl is a simple graphical application that takes an URL (which follows the |
740 | 68 | apt-protocol) as a command line option, parses it and carries out the | 69 | apt-protocol) as a command line option, parses it and carries out the |
741 | 69 | 70 | ||
742 | === removed file 'debian/pycompat' | |||
743 | --- debian/pycompat 2007-07-02 09:31:04 +0000 | |||
744 | +++ debian/pycompat 1970-01-01 00:00:00 +0000 | |||
745 | @@ -1,1 +0,0 @@ | |||
746 | 1 | 2 | ||
747 | 2 | \ No newline at end of file | 0 | \ No newline at end of file |
748 | 3 | 1 | ||
749 | === modified file 'debian/rules' | |||
750 | --- debian/rules 2010-12-17 14:42:22 +0000 | |||
751 | +++ debian/rules 2012-06-14 00:37:19 +0000 | |||
752 | @@ -1,15 +1,18 @@ | |||
753 | 1 | #!/usr/bin/make -f | 1 | #!/usr/bin/make -f |
754 | 2 | %: | 2 | %: |
756 | 3 | dh --with python2 $@ | 3 | dh $@ --with python3 |
757 | 4 | 4 | ||
758 | 5 | override_dh_auto_clean: | 5 | override_dh_auto_clean: |
759 | 6 | rm -f AptUrl/Version.py | 6 | rm -f AptUrl/Version.py |
760 | 7 | 7 | ||
761 | 8 | override_dh_auto_build: | ||
762 | 9 | python3 setup.py build | ||
763 | 10 | |||
764 | 8 | override_dh_auto_install: | 11 | override_dh_auto_install: |
766 | 9 | python ./setup.py install --prefix=$(CURDIR)/debian/tmp/usr | 12 | python3 ./setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb |
767 | 10 | 13 | ||
770 | 11 | override_dh_install: | 14 | override_dh_auto_test: |
771 | 12 | dh_install --sourcedir=debian/tmp --fail-missing | 15 | python3 -m unittest discover -vv |
772 | 13 | 16 | ||
773 | 14 | 17 | ||
774 | 15 | PKG=apturl | 18 | PKG=apturl |
775 | 16 | 19 | ||
776 | === modified file 'po/apturl.pot' | |||
777 | --- po/apturl.pot 2009-01-08 19:46:00 +0000 | |||
778 | +++ po/apturl.pot 2012-06-14 00:37:19 +0000 | |||
779 | @@ -8,47 +8,52 @@ | |||
780 | 8 | msgstr "" | 8 | msgstr "" |
781 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
782 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
784 | 11 | "POT-Creation-Date: 2009-01-08 20:26+0100\n" | 11 | "POT-Creation-Date: 2012-06-12 17:39-0400\n" |
785 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
786 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
787 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
788 | 15 | "Language: \n" | ||
789 | 15 | "MIME-Version: 1.0\n" | 16 | "MIME-Version: 1.0\n" |
790 | 16 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
791 | 17 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
792 | 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | ||
793 | 19 | 19 | ||
795 | 20 | #: ../apturl:50 | 20 | #: ../apturl-gtk:51 ../apturl-kde:54 |
796 | 21 | msgid "User requested interrupt." | 21 | msgid "User requested interrupt." |
797 | 22 | msgstr "" | 22 | msgstr "" |
798 | 23 | 23 | ||
800 | 24 | #: ../AptUrl/Parser.py:79 | 24 | #: ../AptUrl/Parser.py:85 |
801 | 25 | msgid "Non whitelist char in the uri" | 25 | msgid "Non whitelist char in the uri" |
802 | 26 | msgstr "" | 26 | msgstr "" |
803 | 27 | 27 | ||
809 | 28 | #: ../AptUrl/Parser.py:91 | 28 | #: ../AptUrl/Parser.py:93 |
805 | 29 | msgid "No ':' in the uri" | ||
806 | 30 | msgstr "" | ||
807 | 31 | |||
808 | 32 | #: ../AptUrl/Parser.py:117 | ||
810 | 33 | msgid "Whitespace in key=value" | 29 | msgid "Whitespace in key=value" |
811 | 34 | msgstr "" | 30 | msgstr "" |
812 | 35 | 31 | ||
814 | 36 | #: ../AptUrl/Parser.py:123 | 32 | #: ../AptUrl/Parser.py:99 |
815 | 37 | #, python-format | 33 | #, python-format |
816 | 38 | msgid "Exception '%s'" | 34 | msgid "Exception '%s'" |
817 | 39 | msgstr "" | 35 | msgstr "" |
818 | 40 | 36 | ||
820 | 41 | #: ../AptUrl/AptUrl.py:78 | 37 | #: ../AptUrl/Parser.py:109 |
821 | 38 | #, python-format | ||
822 | 39 | msgid "Url string '%s' too long" | ||
823 | 40 | msgstr "" | ||
824 | 41 | |||
825 | 42 | #: ../AptUrl/Parser.py:115 | ||
826 | 43 | msgid "No ':' in the uri" | ||
827 | 44 | msgstr "" | ||
828 | 45 | |||
829 | 46 | #: ../AptUrl/AptUrl.py:73 | ||
830 | 42 | #, python-format | 47 | #, python-format |
831 | 43 | msgid "Enabling '%s' failed" | 48 | msgid "Enabling '%s' failed" |
832 | 44 | msgstr "" | 49 | msgstr "" |
833 | 45 | 50 | ||
835 | 46 | #: ../AptUrl/AptUrl.py:94 | 51 | #: ../AptUrl/AptUrl.py:91 |
836 | 47 | #, python-format | 52 | #, python-format |
837 | 48 | msgid "Unknown channel '%s'" | 53 | msgid "Unknown channel '%s'" |
838 | 49 | msgstr "" | 54 | msgstr "" |
839 | 50 | 55 | ||
841 | 51 | #: ../AptUrl/AptUrl.py:95 | 56 | #: ../AptUrl/AptUrl.py:92 |
842 | 52 | #, python-format | 57 | #, python-format |
843 | 53 | msgid "The channel '%s' is not known" | 58 | msgid "The channel '%s' is not known" |
844 | 54 | msgstr "" | 59 | msgstr "" |
845 | @@ -88,74 +93,70 @@ | |||
846 | 88 | msgid "Can not deal with protocol '%s' " | 93 | msgid "Can not deal with protocol '%s' " |
847 | 89 | msgstr "" | 94 | msgstr "" |
848 | 90 | 95 | ||
850 | 91 | #: ../AptUrl/AptUrl.py:202 | 96 | #: ../AptUrl/AptUrl.py:205 |
851 | 92 | #, python-format | 97 | #, python-format |
852 | 93 | msgid "Package '%s' is virtual." | 98 | msgid "Package '%s' is virtual." |
853 | 94 | msgstr "" | 99 | msgstr "" |
854 | 95 | 100 | ||
856 | 96 | #: ../AptUrl/AptUrl.py:205 | 101 | #: ../AptUrl/AptUrl.py:208 |
857 | 97 | #, python-format | 102 | #, python-format |
858 | 98 | msgid "Could not find package '%s'." | 103 | msgid "Could not find package '%s'." |
859 | 99 | msgstr "" | 104 | msgstr "" |
860 | 100 | 105 | ||
862 | 101 | #: ../AptUrl/AptUrl.py:209 | 106 | #: ../AptUrl/AptUrl.py:214 |
863 | 102 | #, python-format | 107 | #, python-format |
864 | 103 | msgid "Package '%s' is already installed" | 108 | msgid "Package '%s' is already installed" |
865 | 104 | msgstr "" | 109 | msgstr "" |
866 | 105 | 110 | ||
868 | 106 | #: ../AptUrl/AptUrl.py:223 | 111 | #: ../AptUrl/AptUrl.py:229 |
869 | 107 | #, python-format | 112 | #, python-format |
870 | 108 | msgid "Can not install '%s' (%s) " | 113 | msgid "Can not install '%s' (%s) " |
871 | 109 | msgstr "" | 114 | msgstr "" |
872 | 110 | 115 | ||
874 | 111 | #: ../AptUrl/AptUrl.py:228 | 116 | #: ../AptUrl/AptUrl.py:235 |
875 | 112 | #, python-format | 117 | #, python-format |
876 | 113 | msgid "Package '%s' requests minimal version '%s', but only '%s' is available" | 118 | msgid "Package '%s' requests minimal version '%s', but only '%s' is available" |
877 | 114 | msgstr "" | 119 | msgstr "" |
878 | 115 | 120 | ||
880 | 116 | #: ../AptUrl/UI.py:17 | 121 | #: ../AptUrl/UI.py:16 |
881 | 117 | msgid "Enable additional components" | 122 | msgid "Enable additional components" |
882 | 118 | msgstr "" | 123 | msgstr "" |
883 | 119 | 124 | ||
892 | 120 | #: ../AptUrl/UI.py:18 | 125 | #: ../AptUrl/UI.py:24 ../AptUrl/gtk/GtkUI.py:86 ../AptUrl/kde/KdeUI.py:82 |
885 | 121 | #, python-format | ||
886 | 122 | msgid "Do you want to enable the following component: '%s'?" | ||
887 | 123 | msgid_plural "Do you want to enable the following components: '%s'?" | ||
888 | 124 | msgstr[0] "" | ||
889 | 125 | msgstr[1] "" | ||
890 | 126 | |||
891 | 127 | #: ../AptUrl/UI.py:25 | ||
893 | 128 | msgid "Enable additional software channel" | 126 | msgid "Enable additional software channel" |
894 | 129 | msgstr "" | 127 | msgstr "" |
895 | 130 | 128 | ||
897 | 131 | #: ../AptUrl/UI.py:26 | 129 | #: ../AptUrl/UI.py:25 ../AptUrl/gtk/GtkUI.py:87 ../AptUrl/kde/KdeUI.py:83 |
898 | 132 | #, python-format | 130 | #, python-format |
899 | 133 | msgid "Do you want to enable the following software channel: '%s'?" | 131 | msgid "Do you want to enable the following software channel: '%s'?" |
900 | 134 | msgstr "" | 132 | msgstr "" |
901 | 135 | 133 | ||
903 | 136 | #: ../AptUrl/gtk/GtkUI.py:117 | 134 | #: ../AptUrl/gtk/GtkUI.py:151 ../AptUrl/kde/KdeUI.py:133 |
904 | 137 | msgid "Install additional software?" | 135 | msgid "Install additional software?" |
905 | 138 | msgstr "" | 136 | msgstr "" |
906 | 139 | 137 | ||
908 | 140 | #: ../AptUrl/gtk/GtkUI.py:118 | 138 | #: ../AptUrl/gtk/GtkUI.py:152 ../AptUrl/kde/KdeUI.py:134 |
909 | 141 | #, python-format | 139 | #, python-format |
910 | 142 | msgid "Do you want to install package '%s'?" | 140 | msgid "Do you want to install package '%s'?" |
911 | 143 | msgstr "" | 141 | msgstr "" |
912 | 144 | 142 | ||
914 | 145 | #: ../data/apturl.glade.h:1 | 143 | #. kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; |
915 | 144 | #: ../data/apturl-gtk.ui.h:1 | ||
916 | 146 | msgid "Description" | 145 | msgid "Description" |
917 | 147 | msgstr "" | 146 | msgstr "" |
918 | 148 | 147 | ||
920 | 149 | #: ../data/apturl.glade.h:2 | 148 | #: ../data/apturl-gtk.ui.h:2 |
921 | 150 | msgid "_Install" | 149 | msgid "_Install" |
922 | 151 | msgstr "" | 150 | msgstr "" |
923 | 152 | 151 | ||
924 | 153 | #: ../data/apturl.schemas.in.h:1 | 152 | #: ../data/apturl.schemas.in.h:1 |
926 | 154 | msgid "Run the command in a terminal" | 153 | msgid "Whether the specified command should handle \"apt\" URLs" |
927 | 155 | msgstr "" | 154 | msgstr "" |
928 | 156 | 155 | ||
929 | 157 | #: ../data/apturl.schemas.in.h:2 | 156 | #: ../data/apturl.schemas.in.h:2 |
931 | 158 | msgid "The command used to handle \"apt\" URLs, if enabled." | 157 | msgid "" |
932 | 158 | "True if the command specified in the \"command\" key should handle \"apt\" " | ||
933 | 159 | "URLs." | ||
934 | 159 | msgstr "" | 160 | msgstr "" |
935 | 160 | 161 | ||
936 | 161 | #: ../data/apturl.schemas.in.h:3 | 162 | #: ../data/apturl.schemas.in.h:3 |
937 | @@ -163,17 +164,15 @@ | |||
938 | 163 | msgstr "" | 164 | msgstr "" |
939 | 164 | 165 | ||
940 | 165 | #: ../data/apturl.schemas.in.h:4 | 166 | #: ../data/apturl.schemas.in.h:4 |
944 | 166 | msgid "" | 167 | msgid "The command used to handle \"apt\" URLs, if enabled." |
942 | 167 | "True if the command specified in the \"command\" key should handle \"apt\" " | ||
943 | 168 | "URLs." | ||
945 | 169 | msgstr "" | 168 | msgstr "" |
946 | 170 | 169 | ||
947 | 171 | #: ../data/apturl.schemas.in.h:5 | 170 | #: ../data/apturl.schemas.in.h:5 |
948 | 171 | msgid "Run the command in a terminal" | ||
949 | 172 | msgstr "" | ||
950 | 173 | |||
951 | 174 | #: ../data/apturl.schemas.in.h:6 | ||
952 | 172 | msgid "" | 175 | msgid "" |
953 | 173 | "True if the command used to handle this type of URL should be run in a " | 176 | "True if the command used to handle this type of URL should be run in a " |
954 | 174 | "terminal." | 177 | "terminal." |
955 | 175 | msgstr "" | 178 | msgstr "" |
956 | 176 | |||
957 | 177 | #: ../data/apturl.schemas.in.h:6 | ||
958 | 178 | msgid "Whether the specified command should handle \"apt\" URLs" | ||
959 | 179 | msgstr "" | ||
960 | 180 | 179 | ||
961 | === modified file 'setup.py' | |||
962 | --- setup.py 2011-07-22 12:04:26 +0000 | |||
963 | +++ setup.py 2012-06-14 00:37:19 +0000 | |||
964 | @@ -1,4 +1,4 @@ | |||
966 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python3 |
967 | 2 | 2 | ||
968 | 3 | from distutils.core import setup | 3 | from distutils.core import setup |
969 | 4 | from DistUtilsExtra.command import * | 4 | from DistUtilsExtra.command import * |
970 | @@ -9,13 +9,13 @@ | |||
971 | 9 | # look/set what version we have | 9 | # look/set what version we have |
972 | 10 | changelog = "debian/changelog" | 10 | changelog = "debian/changelog" |
973 | 11 | if os.path.exists(changelog): | 11 | if os.path.exists(changelog): |
975 | 12 | head = open(changelog).readline() | 12 | with open(changelog, encoding='utf-8') as fp: |
976 | 13 | head = fp.readline() | ||
977 | 13 | match = re.compile(".*\((.*)\).*").match(head) | 14 | match = re.compile(".*\((.*)\).*").match(head) |
978 | 14 | if match: | 15 | if match: |
979 | 15 | version = match.group(1) | 16 | version = match.group(1) |
983 | 16 | f = open("AptUrl/Version.py", "w") | 17 | with open("AptUrl/Version.py", "w") as fp: |
984 | 17 | f.write("VERSION=\"%s\"\n" % version) | 18 | print('VERSION="{}"'.format(version)) |
982 | 18 | f.close() | ||
985 | 19 | 19 | ||
986 | 20 | GETTEXT_NAME="apturl" | 20 | GETTEXT_NAME="apturl" |
987 | 21 | I18NFILES = [] | 21 | I18NFILES = [] |
988 | 22 | 22 | ||
989 | === added file 'tests/__init__.py' | |||
990 | === renamed file 'tests/apturlparse.py' => 'tests/test_apturl_parse.py' | |||
991 | --- tests/apturlparse.py 2012-06-11 20:34:59 +0000 | |||
992 | +++ tests/test_apturl_parse.py 2012-06-14 00:37:19 +0000 | |||
993 | @@ -1,17 +1,13 @@ | |||
994 | 1 | #!/usr/bin/python | ||
995 | 2 | |||
996 | 3 | from __future__ import print_function | 1 | from __future__ import print_function |
997 | 4 | 2 | ||
998 | 5 | import sys | ||
999 | 6 | sys.path.insert(0, "../") | ||
1000 | 7 | |||
1001 | 8 | import unittest | 3 | import unittest |
1002 | 4 | |||
1003 | 9 | from AptUrl import Parser | 5 | from AptUrl import Parser |
1004 | 10 | 6 | ||
1005 | 11 | 7 | ||
1007 | 12 | class TestUrl(unittest.TestCase): | 8 | class UrlTests(unittest.TestCase): |
1008 | 13 | mapping = { 'kernel':"2.6.23-17-generic", | 9 | mapping = { 'kernel':"2.6.23-17-generic", |
1010 | 14 | 'distro':"hardy" } | 10 | 'distro':"hardy" } |
1011 | 15 | 11 | ||
1012 | 16 | testValues = ( ('apt:3ddesktop', [{'package':'3ddesktop', | 12 | testValues = ( ('apt:3ddesktop', [{'package':'3ddesktop', |
1013 | 17 | 'schema': 'apt'}] ), | 13 | 'schema': 'apt'}] ), |
1014 | @@ -32,11 +28,11 @@ | |||
1015 | 32 | ('apt:2vcard?minver=1.0', | 28 | ('apt:2vcard?minver=1.0', |
1016 | 33 | [{'package':'2vcard', 'schema': 'apt', | 29 | [{'package':'2vcard', 'schema': 'apt', |
1017 | 34 | 'minver': '1.0' }]), | 30 | 'minver': '1.0' }]), |
1019 | 35 | ('apt:owl,newbiedoc,python-pykaraoke?dist=gutsy', | 31 | ('apt:owl,newbiedoc,python-pykaraoke?dist=gutsy', |
1020 | 36 | [{'package':'owl', 'schema':'apt'}, | 32 | [{'package':'owl', 'schema':'apt'}, |
1021 | 37 | {'package':'newbiedoc', 'schema':'apt'}, | 33 | {'package':'newbiedoc', 'schema':'apt'}, |
1022 | 38 | {'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}]), | 34 | {'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}]), |
1024 | 39 | ('apt:python-pykaraoke?dist=gutsy,owl,newbiedoc', | 35 | ('apt:python-pykaraoke?dist=gutsy,owl,newbiedoc', |
1025 | 40 | [{'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}, | 36 | [{'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}, |
1026 | 41 | {'package':'owl', 'schema':'apt'}, | 37 | {'package':'owl', 'schema':'apt'}, |
1027 | 42 | {'package':'newbiedoc', 'schema':'apt'}]), | 38 | {'package':'newbiedoc', 'schema':'apt'}]), |
1028 | @@ -60,20 +56,16 @@ | |||
1029 | 60 | }]), | 56 | }]), |
1030 | 61 | ) | 57 | ) |
1031 | 62 | 58 | ||
1035 | 63 | def testValidParse(self): | 59 | def test_valid_parse(self): |
1036 | 64 | for (v, e) in self.testValues: | 60 | for v, e in self.testValues: |
1037 | 65 | print("Testing: '%s'" % v) | 61 | #print("Testing: '%s'" % v) |
1038 | 66 | result_list = Parser.parse(v, self.mapping) | 62 | result_list = Parser.parse(v, self.mapping) |
1039 | 67 | for dictionary in e: | 63 | for dictionary in e: |
1040 | 68 | for key in dictionary: | 64 | for key in dictionary: |
1041 | 69 | self.assertEqual(getattr(result_list[e.index(dictionary)], | 65 | self.assertEqual(getattr(result_list[e.index(dictionary)], |
1043 | 70 | key), dictionary[key]) | 66 | key), dictionary[key]) |
1044 | 71 | 67 | ||
1045 | 72 | def test_pkgname_too_long(self): | 68 | def test_pkgname_too_long(self): |
1046 | 73 | self.assertRaises( | 69 | self.assertRaises( |
1047 | 74 | Parser.InvalidUrlException, Parser.parse, | 70 | Parser.InvalidUrlException, Parser.parse, |
1048 | 75 | "apt:" + 100 * "veryverylong") | 71 | "apt:" + 100 * "veryverylong") |
1049 | 76 | |||
1050 | 77 | |||
1051 | 78 | if __name__ == "__main__": | ||
1052 | 79 | unittest.main() | ||
1053 | 80 | 72 | ||
1054 | === modified file 'tests/test_helpers.py' | |||
1055 | --- tests/test_helpers.py 2012-06-11 21:35:40 +0000 | |||
1056 | +++ tests/test_helpers.py 2012-06-14 00:37:19 +0000 | |||
1057 | @@ -1,24 +1,17 @@ | |||
1058 | 1 | #!/usr/bin/python | ||
1059 | 2 | |||
1060 | 3 | import sys | ||
1061 | 4 | sys.path.insert(0, "../") | ||
1062 | 5 | |||
1063 | 6 | import unittest | 1 | import unittest |
1064 | 2 | |||
1065 | 7 | from AptUrl.Helpers import parse_pkg | 3 | from AptUrl.Helpers import parse_pkg |
1066 | 8 | 4 | ||
1067 | 5 | |||
1068 | 9 | class MockPkg(object): | 6 | class MockPkg(object): |
1069 | 10 | def __init__(self, descr): | 7 | def __init__(self, descr): |
1070 | 11 | self.description = descr | 8 | self.description = descr |
1071 | 12 | self.homepage = None | 9 | self.homepage = None |
1072 | 13 | 10 | ||
1073 | 14 | class testHelpers(unittest.TestCase): | ||
1074 | 15 | 11 | ||
1075 | 12 | class HelpersTest(unittest.TestCase): | ||
1076 | 16 | def test_parse_pkg(self): | 13 | def test_parse_pkg(self): |
1077 | 17 | pkgobj = MockPkg("summary\ndescr\n") | 14 | pkgobj = MockPkg("summary\ndescr\n") |
1078 | 18 | self.assertEqual(parse_pkg(pkgobj), ('summary','descr\n',None)) | 15 | self.assertEqual(parse_pkg(pkgobj), ('summary','descr\n',None)) |
1079 | 19 | pkgobj = MockPkg("summary only") | 16 | pkgobj = MockPkg("summary only") |
1080 | 20 | self.assertEqual(parse_pkg(pkgobj), ('summary only','',None)) | 17 | self.assertEqual(parse_pkg(pkgobj), ('summary only','',None)) |
1081 | 21 | |||
1082 | 22 | if __name__ == "__main__": | ||
1083 | 23 | unittest.main() | ||
1084 | 24 |
Things that I can't easily check just through the proposal: layout= deb" format_ description( description) )" in KDEui.py, why was that line commented rather than removed if "desc" isn't used?
- Does the package actually build? The concern here being the use of "python3 ./setup.py install --install-
- "#desc = "%s\n\n%s" % (summary, Helpers.
Besides that, the rest looks good, so with an answer to these two, +1