Merge lp:~justinmcp/unity-webapps-youtube/1361828 into lp:unity-webapps-youtube

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

Commit message

Fix module imports.

The old way now triggers an exception.

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

Update to python 3

Unmerged revisions

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

Update to python 3

64. 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-youtube.py'
2--- scripts/update-desktop-file-unity-webapps-youtube.py 2013-09-24 16:21:59 +0000
3+++ scripts/update-desktop-file-unity-webapps-youtube.py 2015-04-15 03:49:18 +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 = 'YouTubeyoutubecom'
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,8 @@
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

Subscribers

People subscribed via source and target branches

to all changes: