shamil/indicator-places — Issue #2: Labels should be unquoted
Author: pjssilva
Created: 2011-10-30 14:26:24+00:00
State: open

Hi,

I am Portuguese speaker and we use accents in our language. Some of my folders have names with accents and they are stored quoted in UTF-8 encoding inside the .gtk-bookmarks file. For example the folder "/home/pjssilva/músicas" is stored as

file:///home/pjssilva/m%C3%BAsica

If I use indicator-places.py, the label that will show up in the menu is "m%C3%BAsica", rather ugly. To fix this you should unquote the label using the unquote function of the urllib library. The following patch only adds two lines to indicador-places.py that does just this. Just copy and past just after the dashed line and save the result in a file named unquote_label.path and apply it.

Thanks for your little indicator!

---- Cut here ----
--- /tmp/indicator-places.py	2011-10-30 12:08:55.634597244 -0200
+++ indicator-places.py	2011-10-30 12:11:41.010605250 -0200
@@ -11,6 +11,7 @@
import signal
import subprocess
import appindicator
+import urllib

APP_NAME = 'indicator-places'
APP_VERSION = '0.3'
@@ -81,6 +82,7 @@

# Populate bookmarks menu items
for bm in bookmarks:
+ bm = urllib.unquote(bm)
path, label = bm.strip().partition(' ')[::2]

if not label: