In [ ]:
import os, sys
import inspect
# Obtain path of the opengrid codebase and import opengrid libraries
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(os.path.join(script_dir, os.pardir, os.pardir))
from opengrid.library import config
In [ ]:
c = config.Config()
for s in c.sections():
print("Section: {}".format(s))
for i in c.items(s):
print("\tItem: {}".format(i))
In [ ]:
c.get('opengrid_server', 'host')
In [ ]:
c.get('data', 'folder')
In [ ]:
c.getint('opengrid_server', 'port')