NetExec/cme/context.py

18 lines
423 B
Python
Raw Normal View History

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