コード例 #1
0
ファイル: mi.server.py プロジェクト: zy-sunshine/FastMango
#os.chdir(CONF_DATADIR)
CONF_EXPERT_MODE = CONF.LOAD.CONF_EXPERT_MODE

try:
    miinitrd_pos
except:
    # Failed: Load the default values.
    miinitrd_pos = None

mia = miactions.MIActions(128, 128*1024, 128*1024)

if mia.pid > 0:
    # Control process.
    # Run short operation and transfer long operation to action process.
    from miutils.milogger import ServerLogger_Short, ServerLogger_Long
    log_short = ServerLogger_Short.get_instance(ServerLogger_Short, __name__)
    log_long = ServerLogger_Long.get_instance(ServerLogger_Long, __name__)
    def dolog(msg):
        log_short.i(msg)
    dolog('test short log')
    #print log.get_logpath(ServerLogger_Short)
    import short_operations

    server_quit = 0

    class MIAction:
        def _dispatch(self, method, params):
            global  server_quit
            if method == 'quit':
                mia.put_operation('quit')
                server_quit = 1
コード例 #2
0
ファイル: __init__.py プロジェクト: zy-sunshine/FastMango
 def get_instance(TAG):
     return ServerLogger_Short.get_instance(ServerLogger_Short, TAG)