コード例 #1
0
ファイル: __init__.py プロジェクト: neerc-linux/ConSys
def run():
    try:
        log.init('client.log')

        context = daemonise.getContext(
            pidfile = _config['client-pid-file'],
            signal_map = {
                signal.SIGUSR1: 'terminate',
                signal.SIGHUP: configuration.reload,
            },
        )

        _log.debug('Entering running context...')
        with context:
            _log.info('Configuration file: {0}'.format(configuration.filename()))
            _log.info('Initializing ConSys client daemon...')
            # Install GLib reactor
            from twisted.internet import glib2reactor
            glib2reactor.install()
            from consys.common import app
            from consys.client import network, persistent
            app.startup()
            app.dispatch_loop()
            _log.info('Terminating ConSys client daemon...')
    except Exception:
        _log.exception('Unhandled exception in main thread, exiting')
コード例 #2
0
ファイル: __init__.py プロジェクト: neerc-linux/ConSys
def run():
    try:
        log.init('admin.log')

        _log.info('Configuration file: {0}'.format(configuration.filename()))
        _log.info('Initializing ConSys admin...')
        global qtapp
        qtapp = QtGui.QApplication(sys.argv)
        from consys.common import qt4reactor
        qt4reactor.install()
        from consys.common import app
        from consys.admin import login, ampclient, main
        app.startup()
        app.dispatch_loop()
        _log.info('Terminating ConSys admin...')
    except Exception:
        _log.exception('Unhandled exception in main thread, exiting')
            
コード例 #3
0
ファイル: __init__.py プロジェクト: neerc-linux/ConSys
def run():
    try:
        log.init('server.log')

        context = daemonise.getContext(
            pidfile = _config['server-pid-file'],
            signal_map = {
                signal.SIGUSR1: 'terminate',
                signal.SIGHUP: configuration.reload,
            },
        )

        _log.debug('Entering running context...')
        with context:
            _log.info('Configuration file: {0}'.format(configuration.filename()))
            _log.info('Initializing ConSys server daemon...')
            from consys.common import app
            from consys.server import network, persistent, hw, connections, \
                ampserver
            app.startup()
            app.dispatch_loop()
            _log.info('Terminating ConSys server daemon...')
    except Exception:
        _log.exception('Unhandled exception in main thread, exiting')