def main(): # Setup logging format logger = logging.getLogger() logger.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s %(message)s', '%Y/%m/%d %H:%M:%S') handler.setFormatter(formatter) logger.addHandler(handler) # Add DaemonState to JSONRPC lib classes Config.instance().classes.add(DaemonState) ovl = OverlordCLIClient() try: ovl.Main() except KeyboardInterrupt: print('Ctrl-C received, abort') except Exception as e: print('error: %s' % e)
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- # Create a configuration instance from jsonrpclib.config import Config config = Config.instance() # Easy access to utility methods and classes from jsonrpclib.jsonrpc import Server, ServerProxy from jsonrpclib.jsonrpc import MultiCall, Fault, ProtocolError, AppError from jsonrpclib.jsonrpc import loads, dumps, load, dump from jsonrpclib.jsonrpc import jloads, jdumps import jsonrpclib.utils as utils
from jsonrpclib.config import Config config = Config.instance() from jsonrpclib.history import History history = History.instance() from jsonrpclib.jsonrpc import Server, MultiCall, Fault from jsonrpclib.jsonrpc import ProtocolError, loads, dumps