2
## src/common/configpaths.py
4
## Copyright (C) 2006 Jean-Marie Traissard <jim AT lapin.org>
5
## Junglecow J <junglecow AT gmail.com>
6
## Copyright (C) 2006-2007 Yann Leboulanger <asterix AT lagaule.org>
7
## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com>
8
## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
10
## This file is part of Gajim.
12
## Gajim is free software; you can redistribute it and/or modify
13
## it under the terms of the GNU General Public License as published
14
## by the Free Software Foundation; version 3 only.
16
## Gajim is distributed in the hope that it will be useful,
17
## but WITHOUT ANY WARRANTY; without even the implied warranty of
18
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
## GNU General Public License for more details.
21
## You should have received a copy of the GNU General Public License
22
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
68
97
for key in self.paths.iterkeys():
69
98
yield (key, self[key])
80
k = ( 'LOG', 'LOG_DB', 'VCARD', 'AVATAR', 'MY_EMOTS' )
81
v = (u'logs', u'logs.db', u'vcards', u'avatars', u'emoticons')
84
v = map(lambda x: x.capitalize(), v)
86
for n, p in zip(k, v):
87
paths.add_from_root(n, p)
89
paths.add('DATA', os.path.join(u'..', windowsify(u'data')))
90
paths.add('HOME', fse(os.path.expanduser('~')))
91
paths.add('TMP', fse(tempfile.gettempdir()))
95
svn_config.configure(paths)
96
except (ImportError, AttributeError):
99
# for k, v in paths.iteritems():
100
# print "%s: %s" % (repr(k), repr(v))
106
def init_profile(profile, paths=gajimpaths):
107
conffile = windowsify(u'config')
108
pidfile = windowsify(u'gajim')
111
conffile += u'.' + profile
112
pidfile += u'.' + profile
114
paths.add_from_root('CONFIG_FILE', conffile)
115
paths.add_from_root('PID_FILE', pidfile)
117
# for k, v in paths.iteritems():
118
# print "%s: %s" % (repr(k), repr(v))
100
def init(self, root = None):
105
k = ( 'LOG', 'LOG_DB', 'VCARD', 'AVATAR', 'MY_EMOTS',
106
'MY_ICONSETS', 'MY_MOOD_ICONSETS',
107
'MY_ACTIVITY_ICONSETS', 'MY_CACERTS')
108
v = (u'logs', u'logs.db', u'vcards', u'avatars', u'emoticons',
109
u'iconsets', u'moods', u'activities', u'cacerts.pem')
112
v = map(lambda x: x.capitalize(), v)
114
for n, p in zip(k, v):
115
self.add_from_root(n, p)
117
self.add('DATA', os.path.join(u'..', windowsify(u'data')))
118
self.add('HOME', fse(os.path.expanduser('~')))
119
self.add('TMP', fse(tempfile.gettempdir()))
123
svn_config.configure(self)
124
except (ImportError, AttributeError):
127
# for k, v in paths.iteritems():
128
# print "%s: %s" % (repr(k), repr(v))
130
def init_profile(self, profile = ''):
131
conffile = windowsify(u'config')
132
pidfile = windowsify(u'gajim')
133
secretsfile = windowsify(u'secrets')
136
conffile += u'.' + profile
137
pidfile += u'.' + profile
138
secretsfile += u'.' + profile
140
self.add_from_root('CONFIG_FILE', conffile)
141
self.add_from_root('PID_FILE', pidfile)
142
self.add_from_root('SECRETS_FILE', secretsfile)
144
# for k, v in paths.iteritems():
145
# print "%s: %s" % (repr(k), repr(v))
147
gajimpaths = ConfigPaths()