Merge lp:~cyphermox/software-properties/unbreak-stuff into lp:software-properties

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Merged at revision: 768
Proposed branch: lp:~cyphermox/software-properties/unbreak-stuff
Merge into: lp:software-properties
Diff against target: 478 lines (+97/-22)
23 files modified
add-apt-repository (+3/-1)
debian/changelog (+8/-2)
debian/control (+13/-0)
debian/python-software-properties.install (+1/-0)
debian/rules (+1/-1)
software-properties-kde (+2/-0)
softwareproperties/AptAuth.py (+2/-0)
softwareproperties/MirrorTest.py (+8/-3)
softwareproperties/SoftwareProperties.py (+2/-0)
softwareproperties/dbus/SoftwarePropertiesDBus.py (+16/-9)
softwareproperties/gtk/DialogAddSourcesList.py (+2/-0)
softwareproperties/gtk/DialogEdit.py (+2/-0)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+2/-0)
softwareproperties/gtk/utils.py (+2/-0)
softwareproperties/kde/CdromProgress.py (+2/-0)
softwareproperties/kde/DialogAdd.py (+2/-0)
softwareproperties/kde/DialogEdit.py (+2/-0)
softwareproperties/kde/DialogMirror.py (+2/-0)
softwareproperties/kde/SoftwarePropertiesKDE.py (+2/-0)
softwareproperties/ppa.py (+16/-5)
tests/Makefile (+3/-1)
tests/test_aptsources.py (+2/-0)
tests/test_dbus.py (+2/-0)
To merge this branch: bzr merge lp:~cyphermox/software-properties/unbreak-stuff
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+113600@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'add-apt-repository'
2--- add-apt-repository 2012-06-29 14:11:21 +0000
3+++ add-apt-repository 2012-07-05 15:33:23 +0000
4@@ -1,5 +1,7 @@
5 #!/usr/bin/python3
6
7+from __future__ import print_function
8+
9 import os
10 import sys
11 import gettext
12@@ -136,7 +138,7 @@
13 else:
14 print(_("You are about to add the following PPA to your system:"))
15 print(" %s" % ppa_info["description"] or "")
16- print(_(" More info: %s") % ppa_info["web_link"])
17+ print(_(" More info: %s") % str(ppa_info["web_link"]))
18 if (sys.stdin.isatty() and
19 not "FORCE_ADD_APT_REPOSITORY" in os.environ):
20 if options.remove:
21
22=== modified file 'debian/changelog'
23--- debian/changelog 2012-07-05 13:00:24 +0000
24+++ debian/changelog 2012-07-05 15:33:23 +0000
25@@ -1,8 +1,14 @@
26 software-properties (0.86) UNRELEASED; urgency=low
27
28+ [ Colin Watson ]
29 * Open /dev/urandom in binary mode.
30-
31- -- Colin Watson <cjwatson@ubuntu.com> Thu, 05 Jul 2012 13:59:57 +0100
32+ * Start producing python-software-properties again, until such time as it
33+ has no reverse-dependencies.
34+
35+ [ Mathieu Trudel-Lapierre ]
36+ * Fix things so that reverse-depends can still work with Python 2.
37+
38+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Thu, 05 Jul 2012 11:08:01 -0400
39
40 software-properties (0.85) quantal; urgency=low
41
42
43=== modified file 'debian/control'
44--- debian/control 2012-07-05 11:44:50 +0000
45+++ debian/control 2012-07-05 15:33:23 +0000
46@@ -6,12 +6,25 @@
47 libxml-parser-perl,
48 scrollkeeper,
49 intltool,
50+ python-all (>= 2.6.6-3~),
51+ python-distutils-extra (>= 1.90),
52 python3-all,
53 python3-distutils-extra,
54 dh-translations
55 Standards-Version: 3.9.1
56 Vcs-Bzr: http://code.launchpad.net/~ubuntu-core-dev/software-properties/main
57
58+Package: python-software-properties
59+Section: python
60+Architecture: all
61+Depends: ${python:Depends}, ${misc:Depends}, python, python-apt (>=
62+ 0.6.20ubuntu16), lsb-release,
63+ unattended-upgrades, iso-codes
64+Description: manage the repositories that you install software from
65+ This software provides an abstraction of the used apt repositories.
66+ It allows you to easily manage your distribution and independent software
67+ vendor software sources.
68+
69 Package: python3-software-properties
70 Section: python
71 Architecture: all
72
73=== added file 'debian/python-software-properties.install'
74--- debian/python-software-properties.install 1970-01-01 00:00:00 +0000
75+++ debian/python-software-properties.install 2012-07-05 15:33:23 +0000
76@@ -0,0 +1,1 @@
77+debian/tmp/usr/lib/python2*/*-packages/softwareproperties/*py
78
79=== modified file 'debian/rules'
80--- debian/rules 2012-06-29 13:40:47 +0000
81+++ debian/rules 2012-07-05 15:33:23 +0000
82@@ -1,7 +1,7 @@
83 #!/usr/bin/make -f
84
85 %:
86- dh $@ --with python3,translations
87+ dh $@ --with python2,python3,translations
88
89 override_dh_auto_clean:
90 dh_auto_clean
91
92=== modified file 'software-properties-kde'
93--- software-properties-kde 2012-06-29 14:11:21 +0000
94+++ software-properties-kde 2012-07-05 15:33:23 +0000
95@@ -20,6 +20,8 @@
96 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
97 # USA
98
99+from __future__ import print_function
100+
101 import gettext
102 import os
103 import sys
104
105=== modified file 'softwareproperties/AptAuth.py'
106--- softwareproperties/AptAuth.py 2012-06-29 14:11:21 +0000
107+++ softwareproperties/AptAuth.py 2012-07-05 15:33:23 +0000
108@@ -19,6 +19,8 @@
109 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
110 # USA
111
112+from __future__ import print_function
113+
114 import atexit
115 import gettext
116 import os
117
118=== modified file 'softwareproperties/MirrorTest.py'
119--- softwareproperties/MirrorTest.py 2012-06-29 14:27:23 +0000
120+++ softwareproperties/MirrorTest.py 2012-07-05 15:33:23 +0000
121@@ -1,7 +1,12 @@
122 #!/usr/bin/env python
123
124+from __future__ import print_function
125+
126 import threading
127-import queue
128+try:
129+ from queue import Empty, Queue
130+except ImportError:
131+ from Queue import Empty, Queue
132 import time
133 import re
134 import subprocess
135@@ -45,7 +50,7 @@
136 if not line:
137 break
138 result = re.findall(self.match_result, line)
139- except queue.Empty:
140+ except Empty:
141 return
142 except:
143 self.parent.report_action("Skipping %s" % host)
144@@ -119,7 +124,7 @@
145 the download test is only a part of a whole series of tests."""
146 if mirrors == None:
147 mirrors = self.mirrors
148- jobs = queue.Queue()
149+ jobs = Queue()
150 for m in mirrors:
151 jobs.put(m)
152 results = []
153
154=== modified file 'softwareproperties/SoftwareProperties.py'
155--- softwareproperties/SoftwareProperties.py 2012-07-05 13:00:24 +0000
156+++ softwareproperties/SoftwareProperties.py 2012-07-05 15:33:23 +0000
157@@ -22,6 +22,8 @@
158 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
159 # USA
160
161+from __future__ import absolute_import, print_function
162+
163 import apt
164 import apt_pkg
165 from hashlib import md5
166
167=== modified file 'softwareproperties/dbus/SoftwarePropertiesDBus.py'
168--- softwareproperties/dbus/SoftwarePropertiesDBus.py 2012-06-29 14:29:49 +0000
169+++ softwareproperties/dbus/SoftwarePropertiesDBus.py 2012-07-05 15:33:23 +0000
170@@ -24,6 +24,7 @@
171 import logging
172 import subprocess
173 import tempfile
174+import sys
175
176 from aptsources.sourceslist import SourceEntry
177
178@@ -36,6 +37,12 @@
179
180 DBusGMainLoop(set_as_default=True)
181
182+def _to_unicode(string):
183+ if sys.version < '3':
184+ return string.encode('utf-8')
185+ else:
186+ return string
187+
188 class PermissionDeniedByPolicy(dbus.DBusException):
189 _dbus_error_name = 'com.ubuntu.SoftwareProperties.PermissionDeniedByPolicy'
190
191@@ -105,7 +112,7 @@
192 def EnableChildSource(self, template, sender=None, conn=None):
193 self._check_policykit_privilege(
194 sender, conn, "com.ubuntu.softwareproperties.applychanges")
195- self.enable_child_source(template)
196+ self.enable_child_source(_to_unicode(template))
197
198 @dbus.service.method(DBUS_INTERFACE_NAME,
199 sender_keyword="sender", connection_keyword="conn",
200@@ -113,7 +120,7 @@
201 def DisableChildSource(self, template, sender=None, conn=None):
202 self._check_policykit_privilege(
203 sender, conn, "com.ubuntu.softwareproperties.applychanges")
204- self.disable_child_source(template)
205+ self.disable_child_source(_to_unicode(template))
206
207 @dbus.service.method(DBUS_INTERFACE_NAME,
208 sender_keyword="sender", connection_keyword="conn",
209@@ -121,7 +128,7 @@
210 def EnableComponent(self, component, sender=None, conn=None):
211 self._check_policykit_privilege(
212 sender, conn, "com.ubuntu.softwareproperties.applychanges")
213- self.enable_component(component)
214+ self.enable_component(_to_unicode(component))
215
216 @dbus.service.method(DBUS_INTERFACE_NAME,
217 sender_keyword="sender", connection_keyword="conn",
218@@ -129,7 +136,7 @@
219 def DisableComponent(self, component, sender=None, conn=None):
220 self._check_policykit_privilege(
221 sender, conn, "com.ubuntu.softwareproperties.applychanges")
222- self.disable_component(component)
223+ self.disable_component(_to_unicode(component))
224
225 @dbus.service.method(DBUS_INTERFACE_NAME,
226 sender_keyword="sender", connection_keyword="conn",
227@@ -154,7 +161,7 @@
228 def ToggleSourceUse(self, source, sender=None, conn=None):
229 self._check_policykit_privilege(
230 sender, conn, "com.ubuntu.softwareproperties.applychanges")
231- self.toggle_source_use(source)
232+ self.toggle_source_use(_to_unicode(source))
233
234 @dbus.service.method(DBUS_INTERFACE_NAME,
235 sender_keyword="sender", connection_keyword="conn",
236@@ -163,7 +170,7 @@
237 self._check_policykit_privilege(
238 sender, conn, "com.ubuntu.softwareproperties.applychanges")
239 return self.replace_source_entry(
240- old, new)
241+ _to_unicode(old), _to_unicode(new))
242
243 @dbus.service.method(DBUS_INTERFACE_NAME,
244 sender_keyword="sender", connection_keyword="conn",
245@@ -171,7 +178,7 @@
246 def ChangeMainDownloadServer(self, server, sender=None, conn=None):
247 self._check_policykit_privilege(
248 sender, conn, "com.ubuntu.softwareproperties.applychanges")
249- self.change_main_download_server(server)
250+ self.change_main_download_server(_to_unicode(server))
251
252
253 @dbus.service.method(DBUS_INTERFACE_NAME,
254@@ -259,7 +266,7 @@
255 def AddSourceFromLine(self, sourceLine, sender=None, conn=None):
256 self._check_policykit_privilege(
257 sender, conn, "com.ubuntu.softwareproperties.applychanges")
258- self.add_source_from_line(sourceLine)
259+ self.add_source_from_line(_to_unicode(sourceLine))
260 self.KeysModified()
261
262 @dbus.service.method(DBUS_INTERFACE_NAME,
263@@ -268,7 +275,7 @@
264 def RemoveSource(self, source, sender=None, conn=None):
265 self._check_policykit_privilege(
266 sender, conn, "com.ubuntu.softwareproperties.applychanges")
267- self.remove_source(source)
268+ self.remove_source(_to_unicode(source))
269
270 # GPG Keys
271
272
273=== modified file 'softwareproperties/gtk/DialogAddSourcesList.py'
274--- softwareproperties/gtk/DialogAddSourcesList.py 2012-06-29 14:11:21 +0000
275+++ softwareproperties/gtk/DialogAddSourcesList.py 2012-07-05 15:33:23 +0000
276@@ -1,5 +1,7 @@
277 #!/usr/bin/env python
278
279+from __future__ import print_function
280+
281 from gi.repository import GObject, Gdk, Gtk
282 import os
283 from gettext import gettext as _
284
285=== modified file 'softwareproperties/gtk/DialogEdit.py'
286--- softwareproperties/gtk/DialogEdit.py 2012-06-29 14:11:21 +0000
287+++ softwareproperties/gtk/DialogEdit.py 2012-07-05 15:33:23 +0000
288@@ -22,6 +22,8 @@
289 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
290 # USA
291
292+from __future__ import print_function
293+
294 import os
295 from gi.repository import Gtk
296
297
298=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
299--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2012-06-29 14:11:21 +0000
300+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2012-07-05 15:33:23 +0000
301@@ -22,6 +22,8 @@
302 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
303 # USA
304
305+from __future__ import absolute_import, print_function
306+
307 import apt
308 import apt_pkg
309 import dbus
310
311=== modified file 'softwareproperties/gtk/utils.py'
312--- softwareproperties/gtk/utils.py 2012-06-29 14:11:21 +0000
313+++ softwareproperties/gtk/utils.py 2012-07-05 15:33:23 +0000
314@@ -16,6 +16,8 @@
315 # this program; if not, write to the Free Software Foundation, Inc.,
316 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
317
318+from __future__ import print_function
319+
320 from gi.repository import Gtk
321 import logging
322 LOG=logging.getLogger(__name__)
323
324=== modified file 'softwareproperties/kde/CdromProgress.py'
325--- softwareproperties/kde/CdromProgress.py 2012-06-29 14:11:21 +0000
326+++ softwareproperties/kde/CdromProgress.py 2012-07-05 15:33:23 +0000
327@@ -19,6 +19,8 @@
328 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
329 # USA
330
331+from __future__ import absolute_import, print_function
332+
333 import apt
334 from PyQt4.QtCore import *
335 from PyQt4.QtGui import *
336
337=== modified file 'softwareproperties/kde/DialogAdd.py'
338--- softwareproperties/kde/DialogAdd.py 2012-06-29 14:11:21 +0000
339+++ softwareproperties/kde/DialogAdd.py 2012-07-05 15:33:23 +0000
340@@ -19,6 +19,8 @@
341 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
342 # USA
343
344+from __future__ import absolute_import
345+
346 from gettext import gettext as _
347
348 from PyQt4.QtCore import *
349
350=== modified file 'softwareproperties/kde/DialogEdit.py'
351--- softwareproperties/kde/DialogEdit.py 2012-06-29 14:11:21 +0000
352+++ softwareproperties/kde/DialogEdit.py 2012-07-05 15:33:23 +0000
353@@ -19,6 +19,8 @@
354 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
355 # USA
356
357+from __future__ import absolute_import, print_function
358+
359 from gettext import gettext as _
360
361 from PyQt4.QtCore import *
362
363=== modified file 'softwareproperties/kde/DialogMirror.py'
364--- softwareproperties/kde/DialogMirror.py 2012-06-29 14:11:21 +0000
365+++ softwareproperties/kde/DialogMirror.py 2012-07-05 15:33:23 +0000
366@@ -19,6 +19,8 @@
367 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
368 # USA
369
370+from __future__ import absolute_import, print_function
371+
372 from gettext import gettext as _
373 import os
374 import threading
375
376=== modified file 'softwareproperties/kde/SoftwarePropertiesKDE.py'
377--- softwareproperties/kde/SoftwarePropertiesKDE.py 2012-06-29 14:11:21 +0000
378+++ softwareproperties/kde/SoftwarePropertiesKDE.py 2012-07-05 15:33:23 +0000
379@@ -22,6 +22,8 @@
380 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
381 # USA
382
383+from __future__ import absolute_import, print_function
384+
385 import apt
386 import apt_pkg
387 import tempfile
388
389=== modified file 'softwareproperties/ppa.py'
390--- softwareproperties/ppa.py 2012-06-29 14:34:15 +0000
391+++ softwareproperties/ppa.py 2012-07-05 15:33:23 +0000
392@@ -19,12 +19,20 @@
393 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
394 # USA
395
396+from __future__ import print_function
397+
398 import apt_pkg
399 import json
400 import re
401 import subprocess
402 from threading import Thread
403-import urllib.request
404+
405+try:
406+ import urllib.request as urllib2
407+ from urllib.error import URLError
408+ import urllib.parse
409+except ImportError:
410+ import urllib2
411
412 DEFAULT_KEYSERVER = "hkp://keyserver.ubuntu.com:80/"
413 # maintained until 2015
414@@ -62,8 +70,11 @@
415 # we ask for a JSON structure from lp_page, we could use
416 # simplejson, but the format is simple enough for the regexp
417 # only useful for testing
418- request = urllib.request.Request(str(lp_url), headers={"Accept":" application/json"})
419- lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
420+ request = urllib2.Request(str(lp_url), headers={"Accept":" application/json"})
421+ try:
422+ lp_page = urllib2.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
423+ except TypeError:
424+ lp_page = urllib2.urlopen(request)
425 return json.loads(lp_page.read().decode("utf-8", "strict"))
426
427 class AddPPASigningKeyThread(Thread):
428@@ -87,8 +98,8 @@
429 owner_name, ppa_name, distro = ppa_path[1:].split('/')
430 try:
431 ppa_info = get_ppa_info_from_lp(owner_name, ppa_name)
432- except pycurl.error as e:
433- print("Error reading %s: %s" % (lp_url, e[1]))
434+ except URLError as e:
435+ print("Error reading %s: %s" % (lp_url, e.strerror))
436 return False
437 try:
438 signing_key_fingerprint = ppa_info["signing_key_fingerprint"]
439
440=== modified file 'tests/Makefile'
441--- tests/Makefile 2012-06-21 19:55:00 +0000
442+++ tests/Makefile 2012-07-05 15:33:23 +0000
443@@ -7,7 +7,9 @@
444 find . -name 'test_*.py' | \
445 while read file; do \
446 if [ -x $$file ]; then \
447- echo "Testing $$file $$PWD"; \
448+ echo "Testing $$file $$PWD with python 2"; \
449+ python $$file; \
450+ echo "Testing $$file $$PWD with python 3"; \
451 python3 $$file; \
452 fi \
453 done
454
455=== modified file 'tests/test_aptsources.py'
456--- tests/test_aptsources.py 2012-06-29 14:11:21 +0000
457+++ tests/test_aptsources.py 2012-07-05 15:33:23 +0000
458@@ -1,5 +1,7 @@
459 #!/usr/bin/python
460
461+from __future__ import print_function
462+
463 import aptsources.distro
464 import aptsources.sourceslist
465 import unittest
466
467=== modified file 'tests/test_dbus.py'
468--- tests/test_dbus.py 2012-06-29 14:11:21 +0000
469+++ tests/test_dbus.py 2012-07-05 15:33:23 +0000
470@@ -1,6 +1,8 @@
471 #!/usr/bin/python
472 # -*- coding: utf-8 -*-
473
474+from __future__ import print_function
475+
476 from gi.repository import Gtk, GObject
477
478 import atexit

Subscribers

People subscribed via source and target branches

to status/vote changes: