Merge lp:~justinmcp/unity-webapps-cuttherope/fix-module-imports into lp:unity-webapps-cuttherope

Proposed by Justin McPherson on 2015-04-14
Status: Needs review
Proposed branch: lp:~justinmcp/unity-webapps-cuttherope/fix-module-imports
Merge into: lp:unity-webapps-cuttherope
Diff against target: 35 lines (+6/-9)
1 file modified
scripts/update-desktop-file-unity-webapps-cuttherope.py (+6/-9)
To merge this branch: bzr merge lp:~justinmcp/unity-webapps-cuttherope/fix-module-imports
Reviewer Review Type Date Requested Status
WebApps 2015-04-14 Pending
Review via email: mp+256094@code.launchpad.net

Commit message

Fix module imports.

To post a comment you must log in.
45. By Justin McPherson <justin@phablet-dev> on 2015-04-15

Update to python 3

Unmerged revisions

45. By Justin McPherson <justin@phablet-dev> on 2015-04-15

Update to python 3

44. By Justin McPherson <justin@phablet-dev> on 2015-04-13

Fix module imports.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/update-desktop-file-unity-webapps-cuttherope.py'
--- scripts/update-desktop-file-unity-webapps-cuttherope.py 2013-09-24 16:18:09 +0000
+++ scripts/update-desktop-file-unity-webapps-cuttherope.py 2015-04-15 03:50:04 +0000
@@ -1,14 +1,11 @@
1#!/usr/bin/python1#!/usr/bin/python3
2from gi.repository import Gio2from gi.repository import GLib
3import os3import os
4import glib
5import glob
6import re
74
8APP_ID = 'CutTheRopecuttheropeie'5APP_ID = 'CutTheRopecuttheropeie'
96
10def get_local_applications_path():7def get_local_applications_path():
11 return os.path.join(glib.get_user_data_dir(), 'applications')8 return os.path.join(GLib.get_user_data_dir(), 'applications')
129
13def update_desktop_file_startupwmclass():10def update_desktop_file_startupwmclass():
14 local_applications_path = get_local_applications_path()11 local_applications_path = get_local_applications_path()
@@ -26,9 +23,9 @@
26 start_idx += len('[Desktop Entry]')23 start_idx += len('[Desktop Entry]')
27 updated_desktop_file_content = desktop_file_content[:start_idx] + '\nStartupWMClass={0}'.format(APP_ID) + desktop_file_content[start_idx:]24 updated_desktop_file_content = desktop_file_content[:start_idx] + '\nStartupWMClass={0}'.format(APP_ID) + desktop_file_content[start_idx:]
28 open(desktop_filename, "w+").write(updated_desktop_file_content)25 open(desktop_filename, "w+").write(updated_desktop_file_content)
29 except Exception, e:26 except Exception as e:
30 print 'Error while upgrading the desktop file: ', str(e)27 print('Error while upgrading the desktop file: ', str(e))
3128
32if __name__ == "__main__":29if __name__ == "__main__":
33 update_desktop_file_startupwmclass()30 update_desktop_file_startupwmclass()
34
35\ No newline at end of file31\ No newline at end of file
32

Subscribers

People subscribed via source and target branches

to all changes: