~ken-vandine/unity-webapps-yandexnews/lp1369208

« back to all changes in this revision

Viewing changes to scripts/update-desktop-file-unity-webapps-yandexnews.py

  • Committer: Ken VanDine
  • Date: 2015-09-29 15:16:58 UTC
  • Revision ID: ken.vandine@canonical.com-20150929151658-vfo4szs64qi42p55
When using gi.repository you must not import static modules like gobject, patch thanks to Puspendu Banerjee (LP: #1369208)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
from gi.repository import Gio
 
3
from gi import module
3
4
import os
4
5
import glib
5
6
import glob
8
9
APP_ID = 'YandexNewsnewsyandexru'
9
10
 
10
11
def get_local_applications_path():
11
 
    return os.path.join(glib.get_user_data_dir(), 'applications')
 
12
    GLib = module.get_introspection_module('GLib')
 
13
    user_data_dir = GLib.get_user_data_dir()
 
14
    return os.path.join(user_data_dir, 'applications')
12
15
 
13
16
def update_desktop_file_startupwmclass():
14
17
    local_applications_path = get_local_applications_path()
31
34
 
32
35
if __name__ == "__main__":
33
36
    update_desktop_file_startupwmclass()
34
 
    
 
 
b'\\ No newline at end of file'
 
37