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

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

Commit message

Fix module imports.

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

Update to python 3

Unmerged revisions

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

Update to python 3

71. 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
1=== modified file 'scripts/update-desktop-file-unity-webapps-facebookmessenger.py'
2--- scripts/update-desktop-file-unity-webapps-facebookmessenger.py 2013-09-24 16:21:53 +0000
3+++ scripts/update-desktop-file-unity-webapps-facebookmessenger.py 2015-04-15 03:49:22 +0000
4@@ -1,14 +1,11 @@
5-#!/usr/bin/python
6-from gi.repository import Gio
7+#!/usr/bin/python3
8+from gi.repository import GLib
9 import os
10-import glib
11-import glob
12-import re
13
14 APP_ID = 'FacebookMessengerfacebookcom'
15
16 def get_local_applications_path():
17- return os.path.join(glib.get_user_data_dir(), 'applications')
18+ return os.path.join(GLib.get_user_data_dir(), 'applications')
19
20 def update_desktop_file_startupwmclass():
21 local_applications_path = get_local_applications_path()
22@@ -26,9 +23,9 @@
23 start_idx += len('[Desktop Entry]')
24 updated_desktop_file_content = desktop_file_content[:start_idx] + '\nStartupWMClass={0}'.format(APP_ID) + desktop_file_content[start_idx:]
25 open(desktop_filename, "w+").write(updated_desktop_file_content)
26- except Exception, e:
27- print 'Error while upgrading the desktop file: ', str(e)
28+ except Exception as e:
29+ print('Error while upgrading the desktop file: ', str(e))
30
31 if __name__ == "__main__":
32 update_desktop_file_startupwmclass()
33-
34\ No newline at end of file
35+

Subscribers

People subscribed via source and target branches

to all changes: