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

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

Commit message

Fix module imports.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
40. By Justin McPherson <justin@phablet-dev>

Update to python 3

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

40. By Justin McPherson <justin@phablet-dev>

Update to python 3

39. By Justin McPherson <justin@phablet-dev>

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-googlenews.py'
--- scripts/update-desktop-file-unity-webapps-googlenews.py 2013-09-24 16:21:07 +0000
+++ scripts/update-desktop-file-unity-webapps-googlenews.py 2015-04-15 03:52:13 +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 = 'GoogleNewsgooglecom'5APP_ID = 'GoogleNewsgooglecom'
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: