source: orange-bioinformatics/orangecontrib/bio/obiKEGG/conf.py @ 1873:0810c5708cc5

Revision 1873:0810c5708cc5, 839 bytes checked in by Ales Erjavec <ales.erjavec@…>, 7 months ago (diff)

Moved '_bioinformatics' into orangecontrib namespace.

Line 
1"""
2obiKEGG2 configuration
3
4mostly just caching settings
5
6"""
7
8import os
9import ConfigParser
10from StringIO import StringIO
11from Orange.utils import serverfiles
12kegg_dir = serverfiles.localpath("KEGG2")
13
14default = """
15[cache]
16# path = %(home)s/.obiKEGG/
17path = %(kegg_dir)s/
18store = sqlite3
19invalidate = weekly
20
21[service]
22transport = urllib2
23# transport = requests
24
25"""
26
27# Orange kegg files dir
28
29env = dict(os.environ)
30env["kegg_dir"] = kegg_dir
31
32parser = ConfigParser.ConfigParser(env)
33
34
35parser.readfp(StringIO(default), "default")
36
37# TODO: global settings rc file
38parser.read([os.path.expanduser("~/.obiKEGG/rc.cfg")])
39
40params = {}
41
42_ALL_PARAMS = [
43    "cache.path",
44    "cache.store",
45    "cache.invalidate",
46    "service.transport"
47]
48
49for p in _ALL_PARAMS:
50    section, option = p.split(".")
51    params[p] = parser.get(section, option)
Note: See TracBrowser for help on using the repository browser.