1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# -*- coding: utf-8 -*-
### BEGIN LICENSE
# This file is in the public domain
### END LICENSE
# THIS IS Acire CONFIGURATION FILE
# YOU CAN PUT THERE SOME GLOBAL VALUE
# Do not touch until you know what you're doing.
# you're warned :)
# where your project will head for your data (for instance, images and ui files)
# by default, this is ../data, relative your trunk layout
__acire_data_directory__ = '../data/'
import os
class project_path_not_found(Exception):
pass
def getdatapath():
"""Retrieve acire data path
This path is by default <acire_lib_path>/../data/ in trunk
and /usr/share/acire in an installed version but this path
is specified at installation time.
"""
# get pathname absolute or relative
if __acire_data_directory__.startswith('/'):
pathname = __acire_data_directory__
else:
pathname = os.path.dirname(__file__) + '/' + __acire_data_directory__
abs_data_path = os.path.abspath(pathname)
if os.path.exists(abs_data_path):
return abs_data_path
else:
raise project_path_not_found
|