memory: fixes the method fixLocalDir for pid_dir and log_dir to use local_dir as default

This commit is contained in:
souliane 2014-04-30 19:54:21 +02:00
commit 4b8ba7a6f4

View file

@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
from os.path import expanduser, abspath
try:
import __pyjamas__ # do not import xdg when building Libervia
BaseDirectory = None
@ -30,6 +30,7 @@ class Const(object):
## Application ##
APP_NAME = u'Salut à Toi'
APP_NAME_SHORT = u'SàT'
APP_NAME_FILE = u'sat'
APP_NAME_FULL = u'%s (%s)' % (APP_NAME_SHORT, APP_NAME)
APP_VERSION = u'0.4.1D' # Please add 'D' at the end for dev versions
APP_URL = 'http://salut-a-toi.org'
@ -54,21 +55,16 @@ class Const(object):
## Configuration ##
DEFAULT_CONFIG = {
'media_dir': '/usr/share/sat/media',
'pid_dir': '/tmp',
'log_dir': BaseDirectory.save_data_path('sat'),
'media_dir': '/usr/share/' + APP_NAME_FILE + '/media',
'local_dir': BaseDirectory.save_data_path(APP_NAME_FILE),
'pid_dir': '%(local_dir)s',
'log_dir': '%(local_dir)s',
}
# XXX: tmp update code, will be removed in the future
# When you remove this, please add that in DEFAULT_CONFIG:
# 'local_dir': BaseDirectory.save_data_path('sat'),
# and also remove sat.memory.memory.Memory.__fixLocalDir
DEFAULT_LOCAL_DIR = BaseDirectory.save_data_path('sat')
# List of the configuration filenames sorted by ascending priority
CONFIG_FILES = [(os.path.expanduser(path) + 'sat.conf') for path in
CONFIG_FILES = [abspath(expanduser(path) + APP_NAME_FILE + '.conf') for path in
['/etc/', '~/', '~/.', '', '.'] +
['%s/' % path for path in list(BaseDirectory.load_config_paths('sat'))]
['%s/' % path for path in list(BaseDirectory.load_config_paths(APP_NAME_FILE))]
]
@ -89,7 +85,7 @@ class Const(object):
## Misc ##
SAVEFILE_DATABASE = "sat.db"
SAVEFILE_DATABASE = APP_NAME_FILE + ".db"
IQ_SET = '/iq[@type="set"]'
ENV_PREFIX = 'SAT_' # Prefix used for environment variables