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 Mod-global settings as fields. Throughout
29 Biskit.Mod a (environment-dependent) parameter such as, e.g., ssh_bin
30 can be addressed as:
31
32 >>> import Biskit.Mod.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_Mod.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_Mod.cfg}.
41
42 If missing, the user configuration file C{~/.biskit/settings_Mod.cfg} is
43 created automatically during the startup of Biskit.Mod (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_Mod.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_Mod.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_Mod.cfg'
70 __CFG_USER = user.home + '/.biskit/settings_Mod.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.Mod settings' )
79
80
81
82
83
84 env = {}
85
86 net_env = {'http_proxy':'http://cache.pasteur.fr:8080'}
87
88
89 net_ncbi = { 'BLASTDB': '/Bis/db/blastdb',
90 'BLASTMAT' : '/Bis/shared/rh73/ncbi' }
91
92 env.update(net_env)
93 env.update(net_ncbi)
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109 del B, T, M, user, sys
110 del __CFG_DEFAULT, __CFG_USER, m
111