Merge lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs into lp:indiv-screenlets

Proposed by Balló György
Status: Merged
Merged at revision: 1181
Proposed branch: lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs
Merge into: lp:indiv-screenlets
Diff against target: 58 lines (+8/-6)
3 files modified
src/Lyrics/LyricsPanel.py (+3/-2)
src/Lyrics/players/RhythmboxPlayer.py (+0/-1)
src/Lyrics/players/utils.py (+5/-3)
To merge this branch: bzr merge lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs
Reviewer Review Type Date Requested Status
Individual Screenlets Developers Pending
Review via email: mp+104175@code.launchpad.net

Description of the change

This change replaces the deprecated gnomevfs with gio in Lyrics Screenlet.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Lyrics/LyricsPanel.py'
--- src/Lyrics/LyricsPanel.py 2011-08-21 20:00:52 +0000
+++ src/Lyrics/LyricsPanel.py 2012-04-30 20:47:20 +0000
@@ -942,9 +942,10 @@
942 content = sel_data.get_text()942 content = sel_data.get_text()
943 print content943 print content
944 if content.startswith("file:///"):944 if content.startswith("file:///"):
945 import gnomevfs945 import gio
946 print content946 print content
947 path = gnomevfs.get_local_path_from_uri(content)947 giof = gio.File(content)
948 path = giof.get_path()
948 print path949 print path
949 f = open(path.strip(), "r")950 f = open(path.strip(), "r")
950 lyrics = f.read()951 lyrics = f.read()
951952
=== modified file 'src/Lyrics/players/RhythmboxPlayer.py'
--- src/Lyrics/players/RhythmboxPlayer.py 2011-08-21 20:00:52 +0000
+++ src/Lyrics/players/RhythmboxPlayer.py 2012-04-30 20:47:20 +0000
@@ -16,7 +16,6 @@
1616
1717
18import screenlets18import screenlets
19#import gnomevfs
20import utils19import utils
21from screenlets.plugins import Rhythmbox20from screenlets.plugins import Rhythmbox
22from player import PlayerEvents21from player import PlayerEvents
2322
=== modified file 'src/Lyrics/players/utils.py'
--- src/Lyrics/players/utils.py 2011-08-21 20:00:52 +0000
+++ src/Lyrics/players/utils.py 2012-04-30 20:47:20 +0000
@@ -15,12 +15,13 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
1717
18import gnomevfs18import gio
1919
20def get_local_path_from_uri(uri):20def get_local_path_from_uri(uri):
21 if uri != None and uri != "":21 if uri != None and uri != "":
22 try: 22 try:
23 local_path = gnomevfs.get_local_path_from_uri(uri)23 f = gio.File(uri)
24 local_path = f.get_path()
24 #print "converting URI to local_path"25 #print "converting URI to local_path"
25 return local_path26 return local_path
26 except Exception, e:27 except Exception, e:
@@ -29,7 +30,8 @@
29 print "URI calss: %s" % uri.__class__30 print "URI calss: %s" % uri.__class__
30 try:31 try:
31 unicodeUri = unicode(str(uri), 'utf-8')32 unicodeUri = unicode(str(uri), 'utf-8')
32 local_path = gnomevfs.get_local_path_from_uri(uri)33 f = gio.File(uri)
34 local_path = f.get_path()
33 return local_path35 return local_path
34 except Exception, e:36 except Exception, e:
35 print e37 print e

Subscribers

People subscribed via source and target branches