indiv-screenlets-dev team mailing list archive
-
indiv-screenlets-dev team
-
Mailing list archive
-
Message #00335
[Merge] lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs into lp:indiv-screenlets
György Balló has proposed merging lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs into lp:indiv-screenlets.
Requested reviews:
Individual Screenlets Developers (indiv-screenlets-dev)
For more details, see:
https://code.launchpad.net/~ballogy/indiv-screenlets/lyrics-replace-gnomevfs/+merge/104175
This change replaces the deprecated gnomevfs with gio in Lyrics Screenlet.
--
https://code.launchpad.net/~ballogy/indiv-screenlets/lyrics-replace-gnomevfs/+merge/104175
Your team Individual Screenlets Developers is requested to review the proposed merge of lp:~ballogy/indiv-screenlets/lyrics-replace-gnomevfs into lp:indiv-screenlets.
=== 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 @@
content = sel_data.get_text()
print content
if content.startswith("file:///"):
- import gnomevfs
+ import gio
print content
- path = gnomevfs.get_local_path_from_uri(content)
+ giof = gio.File(content)
+ path = giof.get_path()
print path
f = open(path.strip(), "r")
lyrics = f.read()
=== 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 @@
import screenlets
-#import gnomevfs
import utils
from screenlets.plugins import Rhythmbox
from player import PlayerEvents
=== 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 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gnomevfs
+import gio
def get_local_path_from_uri(uri):
if uri != None and uri != "":
try:
- local_path = gnomevfs.get_local_path_from_uri(uri)
+ f = gio.File(uri)
+ local_path = f.get_path()
#print "converting URI to local_path"
return local_path
except Exception, e:
@@ -29,7 +30,8 @@
print "URI calss: %s" % uri.__class__
try:
unicodeUri = unicode(str(uri), 'utf-8')
- local_path = gnomevfs.get_local_path_from_uri(uri)
+ f = gio.File(uri)
+ local_path = f.get_path()
return local_path
except Exception, e:
print e
Follow ups