2016-05-16 23:48:31 +00:00
|
|
|
import logging
|
2016-06-09 03:44:45 +00:00
|
|
|
import os
|
2016-05-16 23:48:31 +00:00
|
|
|
from ConfigParser import ConfigParser
|
|
|
|
|
|
|
|
class Context:
|
|
|
|
|
|
|
|
def __init__(self, db, logger, arg_namespace):
|
|
|
|
self.db = db
|
|
|
|
self.log = logger
|
|
|
|
self.log.debug = logging.debug
|
|
|
|
self.localip = None
|
|
|
|
|
|
|
|
self.conf = ConfigParser()
|
2016-06-09 03:44:45 +00:00
|
|
|
self.conf.read(os.path.expanduser('~/.cme/cme.conf'))
|
2016-05-16 23:48:31 +00:00
|
|
|
|
|
|
|
for key, value in vars(arg_namespace).iteritems():
|
|
|
|
setattr(self, key, value)
|