Merge lp:~dobey/rhythmbox-ubuntuone/update-4-0 into lp:rhythmbox-ubuntuone/stable-4-0

Proposed by dobey on 2012-08-27
Status: Merged
Approved by: Roberto Alsina on 2012-08-27
Approved revision: no longer in the source branch.
Merged at revision: 122
Proposed branch: lp:~dobey/rhythmbox-ubuntuone/update-4-0
Merge into: lp:rhythmbox-ubuntuone/stable-4-0
Diff against target: 82 lines (+15/-5)
3 files modified
run-tests (+1/-1)
ubuntuone/MusicStoreWidget.py (+11/-3)
ubuntuone/ubuntuone.py (+3/-1)
To merge this branch: bzr merge lp:~dobey/rhythmbox-ubuntuone/update-4-0
Reviewer Review Type Date Requested Status
Roberto Alsina (community) 2012-08-27 Approve on 2012-08-27
Review via email: mp+121493@code.launchpad.net

Commit Message

[Rodney Dawes]

    Fix syntax issues that would prevent loading from Python 3.
    Switch to using pyflakes.

To post a comment you must log in.
Roberto Alsina (ralsina) :
review: Approve
122. By dobey on 2012-08-27

[Rodney Dawes]

    Fix syntax issues that would prevent loading from Python 3.
    Switch to using pyflakes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests'
2--- run-tests 2012-01-12 21:34:43 +0000
3+++ run-tests 2012-08-27 20:33:32 +0000
4@@ -15,7 +15,7 @@
5 # You should have received a copy of the GNU General Public License along
6 # with this program. If not, see <http://www.gnu.org/licenses/>.
7 export PYTHONPATH=ubuntuone
8-u1lint .
9+USE_PYFLAKES=1 u1lint .
10 if [ -x `which pep8` ]; then
11 pep8 --repeat .
12 else
13
14=== modified file 'ubuntuone/MusicStoreWidget.py'
15--- ubuntuone/MusicStoreWidget.py 2012-03-20 20:26:40 +0000
16+++ ubuntuone/MusicStoreWidget.py 2012-08-27 20:33:32 +0000
17@@ -14,9 +14,10 @@
18 # <http://www.gnu.org/licenses/>.
19 """The Ubuntu One Rhythmbox plugin."""
20
21+from __future__ import print_function, unicode_literals
22+
23 import gettext
24 import os
25-import urlparse
26
27 # pylint: disable=E0611,F0401
28 from gi.repository import Gio, GObject, Gtk, RB
29@@ -24,6 +25,13 @@
30 # pylint: enable=E0611,F0401
31
32 from gettext import lgettext as _
33+parseurl = None
34+try:
35+ import urllib.parse
36+ parseurl = urllib.parse.urlparse
37+except ImportError:
38+ import urlparse
39+ parseurl = urlparse.urlparse
40
41 gettext.bindtextdomain("rhythmbox-ubuntuone", "/usr/share/locale")
42 gettext.textdomain("rhythmbox-ubuntuone")
43@@ -94,7 +102,7 @@
44
45 def url_loaded(self, source, url):
46 """A URL is loaded in the plugin"""
47- if urlparse.urlparse(url)[2] == "https":
48+ if parseurl(url)[2] == "https":
49 pass
50 else:
51 pass
52@@ -124,7 +132,7 @@
53 uri = self._udf_path_to_library_uri(path)
54 entry = self.db.entry_lookup_by_location(uri)
55 if not entry:
56- print "couldn't find entry", uri
57+ print("couldn't find entry: %s" % uri)
58 return
59 libsrc = self.shell.props.library_source
60 artist_view, album_view = libsrc.get_property_views()[0:2]
61
62=== modified file 'ubuntuone/ubuntuone.py'
63--- ubuntuone/ubuntuone.py 2012-03-23 17:59:40 +0000
64+++ ubuntuone/ubuntuone.py 2012-08-27 20:33:32 +0000
65@@ -14,6 +14,8 @@
66 # <http://www.gnu.org/licenses/>.
67 """The Ubuntu One Rhythmbox plugin."""
68
69+from __future__ import print_function, unicode_literals
70+
71 # pylint: disable=E0611
72 from gi.repository import Gio, GObject, Peas
73 # pylint: enable=E0611
74@@ -50,7 +52,7 @@
75 libraries.remove(U1LIBRARYPATH)
76 self.rdbconf.set_strv('locations', libraries)
77 # Remove the unescaped uri path if it exists
78- unescaped_path = u'file://{0}'.format(U1LIBRARYPATH)
79+ unescaped_path = 'file://{0}'.format(U1LIBRARYPATH)
80 if unescaped_path in libraries:
81 libraries.remove(unescaped_path)
82 self.rdbconf.set_strv('locations', libraries)

Subscribers

People subscribed via source and target branches

to all changes: