source: orange-bioinformatics/obiKEGG2/conf.py @ 1532:14a377419a09

Revision 1532:14a377419a09, 827 bytes checked in by ales_erjavec, 2 years ago (diff)

Added KEGG interface using web services

Line 
1"""
2obiKEGG2 configuration
3
4mostly just caching settings
5
6"""
7
8import os
9import ConfigParser
10from StringIO import StringIO
11
12default = {"cache.path": "%HOME/.obiKEGG/",
13           "cache.store": "sqlite3",
14           "cache.kgml_invalidate": "always", #Can be session, always, release, never
15           }
16
17default = """
18[cache]
19path = %(home)s/.obiKEGG/
20store = sqlite3
21kegg_invalidate = always
22
23"""
24
25#_defaults_env = dict(default)
26#_defaults_env.update(dict(os.environ))
27
28parser = ConfigParser.ConfigParser(dict(os.environ))#_defaults_env)
29# TODO: global settings
30
31parser.readfp(StringIO(default), "default")
32
33parser.read([os.path.expanduser("~/.obiKEGG/rc.cfg")])
34
35params = {}
36
37
38for section in parser.sections():
39    for option in parser.options(section):
40        params[section + "." + option] = parser.get(section, option)
Note: See TracBrowser for help on using the repository browser.