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
1=== modified file 'src/Lyrics/LyricsPanel.py'
2--- src/Lyrics/LyricsPanel.py 2011-08-21 20:00:52 +0000
3+++ src/Lyrics/LyricsPanel.py 2012-04-30 20:47:20 +0000
4@@ -942,9 +942,10 @@
5 content = sel_data.get_text()
6 print content
7 if content.startswith("file:///"):
8- import gnomevfs
9+ import gio
10 print content
11- path = gnomevfs.get_local_path_from_uri(content)
12+ giof = gio.File(content)
13+ path = giof.get_path()
14 print path
15 f = open(path.strip(), "r")
16 lyrics = f.read()
17
18=== modified file 'src/Lyrics/players/RhythmboxPlayer.py'
19--- src/Lyrics/players/RhythmboxPlayer.py 2011-08-21 20:00:52 +0000
20+++ src/Lyrics/players/RhythmboxPlayer.py 2012-04-30 20:47:20 +0000
21@@ -16,7 +16,6 @@
22
23
24 import screenlets
25-#import gnomevfs
26 import utils
27 from screenlets.plugins import Rhythmbox
28 from player import PlayerEvents
29
30=== modified file 'src/Lyrics/players/utils.py'
31--- src/Lyrics/players/utils.py 2011-08-21 20:00:52 +0000
32+++ src/Lyrics/players/utils.py 2012-04-30 20:47:20 +0000
33@@ -15,12 +15,13 @@
34 # along with this program. If not, see <http://www.gnu.org/licenses/>.
35
36
37-import gnomevfs
38+import gio
39
40 def get_local_path_from_uri(uri):
41 if uri != None and uri != "":
42 try:
43- local_path = gnomevfs.get_local_path_from_uri(uri)
44+ f = gio.File(uri)
45+ local_path = f.get_path()
46 #print "converting URI to local_path"
47 return local_path
48 except Exception, e:
49@@ -29,7 +30,8 @@
50 print "URI calss: %s" % uri.__class__
51 try:
52 unicodeUri = unicode(str(uri), 'utf-8')
53- local_path = gnomevfs.get_local_path_from_uri(uri)
54+ f = gio.File(uri)
55+ local_path = f.get_path()
56 return local_path
57 except Exception, e:
58 print e

Subscribers

People subscribed via source and target branches