Merge lp:~ken-vandine/unity-webapps-gmail/lp1369208 into lp:unity-webapps-gmail

Proposed by Ken VanDine
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 104
Merged at revision: 103
Proposed branch: lp:~ken-vandine/unity-webapps-gmail/lp1369208
Merge into: lp:unity-webapps-gmail
Diff against target: 46 lines (+0/-36)
2 files modified
debian/unity-webapps-gmail.migrations (+0/-1)
scripts/update-desktop-file-unity-webapps-gmail.py (+0/-35)
To merge this branch: bzr merge lp:~ken-vandine/unity-webapps-gmail/lp1369208
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
Review via email: mp+272773@code.launchpad.net

Commit message

When using gi.repository you must not import static modules like gobject, patch thanks to Puspendu Banerjee (LP: #1369208)

Description of the change

When using gi.repository you must not import static modules like gobject, patch thanks to Puspendu Banerjee (LP: #1369208)

To post a comment you must log in.
104. By Ken VanDine

dropped migration script, no longer needed

Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'debian/unity-webapps-gmail.migrations'
2--- debian/unity-webapps-gmail.migrations 2013-09-24 16:15:51 +0000
3+++ debian/unity-webapps-gmail.migrations 1970-01-01 00:00:00 +0000
4@@ -1,1 +0,0 @@
5-scripts/update-desktop-file-unity-webapps-gmail.py
6
7=== removed directory 'scripts'
8=== removed file 'scripts/update-desktop-file-unity-webapps-gmail.py'
9--- scripts/update-desktop-file-unity-webapps-gmail.py 2014-03-07 01:12:40 +0000
10+++ scripts/update-desktop-file-unity-webapps-gmail.py 1970-01-01 00:00:00 +0000
11@@ -1,35 +0,0 @@
12-#!/usr/bin/python
13-from gi.repository import Gio
14-import os
15-import glib
16-import glob
17-import re
18-
19-APP_ID = 'Gmailmailgooglecom'
20-DESKTOP_FILENAMES = ['Gmailmailgooglecom.desktop', 'GMailmailgooglecom.desktop']
21-
22-def get_local_applications_path():
23- return os.path.join(glib.get_user_data_dir(), 'applications')
24-
25-def update_desktop_file_startupwmclass():
26- local_applications_path = get_local_applications_path()
27- if not os.path.exists(local_applications_path) or not os.path.isdir(local_applications_path):
28- return
29-
30- for desktop_filename in DESKTOP_FILENAMES:
31- desktop_filename = os.path.join(local_applications_path, desktop_filename)
32- if not os.path.exists(desktop_filename) or not os.path.isfile(desktop_filename):
33- continue
34- try:
35- desktop_file_content = open(desktop_filename).read()
36- start_idx = desktop_file_content.find('[Desktop Entry]')
37- if start_idx != -1 and desktop_file_content.find('StartupWMClass') == -1:
38- start_idx += len('[Desktop Entry]')
39- updated_desktop_file_content = desktop_file_content[:start_idx] + '\nStartupWMClass={0}'.format(APP_ID) + desktop_file_content[start_idx:]
40- open(desktop_filename, "w+").write(updated_desktop_file_content)
41- except Exception, e:
42- print 'Error while upgrading the desktop file: ', str(e)
43-
44-if __name__ == "__main__":
45- update_desktop_file_startupwmclass()
46-

Subscribers

People subscribed via source and target branches

to all changes: