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 Settings
26 ========
27
28 This module provides Dock-global settings as fields. Throughout
29 Biskit.Dock a (environment-dependent) parameter such as, e.g., ssh_bin
30 can be addressed as:
31
32 >>> import Biskit.Dock.settings as S
33 >>> bin = S.ssh_bin
34
35 However, since a user should not be required to hack python modules,
36 ssh_bin is not actually defined in settings.py. Instead, the value is
37 taken from C{~/.biskit/settings_Dock.cfg} -- which should have an entry
38 like C{ssh_bin=/bin/ssh # comment}. If this entry (or the config file)
39 is not found, settings.py uses the default value from
40 C{biskit/external/defaults/settings_Dock.cfg}.
41
42 If missing, the user configuration file C{~/.biskit/settings_Dock.cfg} is
43 created automatically during the startup of Biskit (i.e. for any
44 import). The auto-generated file only contains parameters for which
45 the default values don't seem to work (invalid paths or binaries).
46
47 See L{Biskit.SettingsManager}
48
49 Summary for Biskit users
50 ------------------------
51 If you want to change a biskit parameter, do so in
52 C{~/.biskit/settings_Dock.cfg}
53
54 Summary for Biskit developpers
55 ------------------------------
56 If you want to create a new user-adjustable parameter, do so in
57 C{biskit/external/defaults/settings_Dock.cfg}.
58
59 Summary for all
60 ---------------
61 !Dont't touch C{settings.py}!
62 """
63 import Biskit as B
64 import Biskit.tools as T
65 import Biskit.SettingsManager as M
66
67 import user, sys
68
69 __CFG_DEFAULT = T.projectRoot() + '/external/defaults/settings_Dock.cfg'
70 __CFG_USER = user.home + '/.biskit/settings_Dock.cfg'
71
72 try:
73 m = M.SettingsManager(__CFG_DEFAULT, __CFG_USER, createmissing=True )
74
75 m.updateNamespace( locals() )
76
77 except Exception, why:
78 B.EHandler.fatal( 'Error importing Biskit.Dock settings')
79
80
81
82
83 env = {}
84
85 hex_env = {'HEX_ROOT':'/home/Bis/johan/APPLICATIONS/HEX',
86 'HEX_CACHE':'/home/Bis/johan/APPLICATIONS/HEX/hex_cache',
87 'HEX_VERSION':'4b'}
88
89 prosaII_env = {'PROSA_BASE':'/home/Bis/shared/rh73/prosa/prosabase/'}
90
91 env.update(hex_env)
92 env.update(prosaII_env)
93
94
95
96
97 del B, T, M, user, sys
98 del __CFG_DEFAULT, __CFG_USER, m
99
100
101
102 import Biskit.test as BT
103
104 -class Test(BT.BiskitTest):
105 """Mock test, settings is always executed anyway."""
106 pass
107