예제 #1
0
파일: ovl.py 프로젝트: changyc/Overlord
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)
예제 #2
0
파일: ovl.py 프로젝트: playaer/Overlord
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)
예제 #3
0
#!/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
예제 #4
0
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