source: orange-bioinformatics/obiKEGG2/conf.py @ 1580:c4da7dfaf4db

Revision 1580:c4da7dfaf4db, 785 bytes checked in by ales_erjavec, 2 years ago (diff)

Use Orange buffer dir for obiKEGG2 files.

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