Welcome to mirror list, hosted at ThFree Co, Russian Federation.

testlib.py « test - dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4beb43e1465a253ab93bdb4f2c4efe0c8b106be3 (plain)
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
import sys
import os.path

gajim_root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')

sys.path.append(gajim_root + '/src')

# a temporary version of ~/.gajim for testing
configdir = gajim_root + '/test/tmp'

# define _ for i18n
import __builtin__
__builtin__._ = lambda x: x

import os

def setup_env():
	# wipe config directory
	if os.path.isdir(configdir):
		import shutil
		shutil.rmtree(configdir)

	os.mkdir(configdir)

	import common.configpaths
	common.configpaths.gajimpaths.init(configdir)
	common.configpaths.gajimpaths.init_profile()

	# for some reason common.gajim needs to be imported before xmpppy?
	from common import gajim

	gajim.DATA_DIR = gajim_root + '/data'

	import gtkgui_helpers
	gtkgui_helpers.GLADE_DIR = gajim_root + '/data/glade'

# vim: se ts=3: