comparison src/core/constants.py @ 1001:eb3601ff73bc

core: fixes constants.py
author souliane <souliane@mailoo.org>
date Sun, 27 Apr 2014 18:51:03 +0200
parents 652c01ca69b1
children 52ec79aa5bbe
comparison
equal deleted inserted replaced
1000:6f1e03068b5f 1001:eb3601ff73bc
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import os.path 20 import os.path
21 try: 21 try:
22 import __pyjamas__ # do not import xdg when building Libervia
23 BaseDirectory = None
24 except ImportError:
22 from xdg import BaseDirectory 25 from xdg import BaseDirectory
23 except ImportError:
24 # Catch JS runtime error while using Libervia
25 BaseDirectory = None
26 26
27 27
28 class Const(object): 28 class Const(object):
29 29
30 ## Application ## 30 ## Application ##
64 # 'local_dir': BaseDirectory.save_data_path('sat'), 64 # 'local_dir': BaseDirectory.save_data_path('sat'),
65 # and also remove sat.memory.memory.Memory.__fixLocalDir 65 # and also remove sat.memory.memory.Memory.__fixLocalDir
66 DEFAULT_LOCAL_DIR = BaseDirectory.save_data_path('sat') 66 DEFAULT_LOCAL_DIR = BaseDirectory.save_data_path('sat')
67 67
68 # List of the configuration filenames sorted by ascending priority 68 # List of the configuration filenames sorted by ascending priority
69 CONFIG_FILES = [(os.path.expanduser(path) + 'sat.conf') for path in \ 69 CONFIG_FILES = [(os.path.expanduser(path) + 'sat.conf') for path in
70 ['/etc/', '~/', '~/.', '', '.'] + \ 70 ['/etc/', '~/', '~/.', '', '.'] +
71 ['%s/' % path for path in list(BaseDirectory.load_config_paths('sat'))] 71 ['%s/' % path for path in list(BaseDirectory.load_config_paths('sat'))]
72 ] 72 ]
73 73
74 74
75 ## Plugins ## 75 ## Plugins ##