Merge lp:~didrocks/unity/fix-bad-migration-name into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: 527
Proposed branch: lp:~didrocks/unity/fix-bad-migration-name
Merge into: lp:unity
Diff against target: 13 lines (+3/-0)
1 file modified
tools/migrate_favorites.py (+3/-0)
To merge this branch: bzr merge lp:~didrocks/unity/fix-bad-migration-name
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+36154@code.launchpad.net

Description of the change

People are sometime insane in filling their custom launcher name. Try to be smart and to convert some of them.

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/migrate_favorites.py'
2--- tools/migrate_favorites.py 2010-09-09 10:52:54 +0000
3+++ tools/migrate_favorites.py 2010-09-21 14:47:44 +0000
4@@ -36,6 +36,9 @@
5
6 def register_new_app(client, launcher_location, apps_list, priority_position):
7 key_name = 'app-%s' % launcher_location.split('/')[-1]
8+ # remove forbidden key in gconf:
9+ for val in [' ', '+', '\'', '"', '\\', '`', '[', ']', '(', ')', '°', '#', '~', '|', '&']:
10+ key_name = key_name.replace(val, '_')
11 # default distribution launcher don't begin with / and don't have a desktop file in ~/.gnome2
12 if os.path.exists(launcher_location) and key_name not in apps_list:
13 apps_list.append(key_name)