~nmu-sscheel/gtg/rework-task-editor

« back to all changes in this revision

Viewing changes to GTG/__init__.py

  • Committer: Bertrand Rousseau
  • Date: 2012-05-09 22:33:25 UTC
  • mfrom: (1178 trunk)
  • mto: This revision was merged to the branch mainline in revision 1179.
  • Revision ID: bertrand.rousseau@gmail.com-20120509223325-a53d8nwo0x9g93bc
Merge nimit branch and trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
except:
36
36
    #that's not pretty but it looks functional.
37
37
    loaded_glade = None
38
 
from os.path import pardir, abspath, dirname, join
39
38
 
40
39
try:
41
40
    from xdg.BaseDirectory import xdg_config_home
44
43
    config_home = os.path.dirname(__file__)
45
44
 
46
45
LOCAL_ROOTDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
47
 
DIST_ROOTDIR_LOCAL = "/usr/local/share/gtg"
48
 
DIST_ROOTDIR = "/usr/share/gtg"
49
46
 
50
47
#Translation setup (from pyroom)
51
48
GETTEXT_DOMAIN = 'gtg'
65
62
#GTG directories setup
66
63
if os.path.isdir(os.path.join(LOCAL_ROOTDIR, 'data')):
67
64
    DATA_DIR = os.path.join(LOCAL_ROOTDIR, 'data')
68
 
elif os.path.isdir(DIST_ROOTDIR_LOCAL):
69
 
    DATA_DIR = DIST_ROOTDIR_LOCAL
70
65
else:
71
 
    DATA_DIR = DIST_ROOTDIR
 
66
    DATA_DIR = LOCAL_ROOTDIR
72
67
 
73
68
#GTG plugin dir setup
74
 
if not os.path.isdir(os.path.join(LOCAL_ROOTDIR, 'GTG/plugins/')):
75
 
    PLUGIN_DIR = [DIST_ROOTDIR]
76
 
else:
77
 
    PLUGIN_DIR = [os.path.join(LOCAL_ROOTDIR, 'GTG/plugins/')]
 
69
PLUGIN_DIR = [os.path.join(LOCAL_ROOTDIR, 'GTG/plugins')]
78
70
 
79
 
if os.path.isdir(os.path.join(config_home, 'gtg/plugins')):
80
 
    PLUGIN_DIR.append(os.path.join(config_home, 'gtg/plugins'))
 
71
user_plugins = os.path.join(config_home, 'gtg/plugins')
 
72
if os.path.isdir(user_plugins):
 
73
    PLUGIN_DIR.append(user_plugins)
81
74
 
82
75
# FIXME Register GTG URI (temporary, it should be created by a schema upon installing)
83
76
# FIXME Uncomment it or even better - install it properly - it breaks build