Example #1
0
def main():
    """
    Startup function.
    """
    if len(sys.argv) == 1:
        cli_error("No arguments passed!")

    install_reactor(force_reactor_name="qt4")

    from host import settings as host_settings
    from . import cli

    # See host.cli for actually executed CLI commands.
    cli_mode(host_settings.HOST_VERSION_STRING)
Example #2
0
def main():
    """
    Startup function.
    """
    if len(sys.argv) == 1:
        cli_error('No arguments passed!')

    install_reactor(force_reactor_name='qt4')

    from host import settings as host_settings
    from . import cli

    # See host.cli for actually executed CLI commands.
    cli_mode(host_settings.HOST_VERSION_STRING)
Example #3
0
def main():
    """CLI startup function."""
    if len(sys.argv) == 1:
        print('No arguments passed, assuming --launch')
        sys.argv.append('--launch')

    # Setup reactor, depending upon the operating system:
    # do this before the reactor is imported!
    install_reactor(threadpool_size=25)

    from . import cli  # so that the command lines are initialized
    from node import settings
    #settings.configure_logging(postfix='early')

    # See node.cli for actually executed CLI commands.
    cli_mode(settings.NODE_VERSION_STRING)
Example #4
0
    def main():
        from twisted.internet import reactor
        from common.twisted_utils import callLaterInThread
        print reactor
        if len(sys.argv) < 2:
            print('Pass the directory to watch!')
        else:
            _dir = sys.argv[1]
            manager = FSNotifyManager()
            print('Watching {!r}'.format(_dir))
            manager.watch(_dir, on_event_received)
            #callLaterInThread(1, create_test_file, _dir)
            reactor.run()  # pylint:disable=E1101


    if __name__ == '__main__':
        import sys
        sys.path.insert(0, '.')
        from common.system import install_reactor; 'OPTIONAL'  # snakefood
        import logging
        logging.basicConfig(level=logging.INFO)
        from common.logger import configure_logging
        configure_logging('./', 'test_notify')
        logger = logging.getLogger(__name__)
        install_reactor(force_reactor_name='qt4')
        from uhost import fs_notify; 'OPTIONAL'  # snakefood
        fs_notify.main()


__all__ = ('enable',)
Example #5
0
    def main():
        from twisted.internet import reactor
        from common.twisted_utils import callLaterInThread
        print reactor
        if len(sys.argv) < 2:
            print('Pass the directory to watch!')
        else:
            _dir = sys.argv[1]
            manager = FSNotifyManager()
            print('Watching {!r}'.format(_dir))
            manager.watch(_dir, on_event_received)
            #callLaterInThread(1, create_test_file, _dir)
            reactor.run()  # pylint:disable=E1101

    if __name__ == '__main__':
        import sys
        sys.path.insert(0, '.')
        from common.system import install_reactor
        'OPTIONAL'  # snakefood
        import logging
        logging.basicConfig(level=logging.INFO)
        from common.logger import configure_logging
        configure_logging('./', 'test_notify')
        logger = logging.getLogger(__name__)
        install_reactor(force_reactor_name='qt4')
        from uhost import fs_notify
        'OPTIONAL'  # snakefood
        fs_notify.main()

__all__ = ('enable', )