Esempio n. 1
0
    def __init__(self, *args):
        super(CLI, self).__init__("CLI", *args)

        self.hooks = {}

        self.log("Started")
        stdin.register(self)
Esempio n. 2
0
    def __init__(self, *args):
        super(CLI, self).__init__("CLI", *args)

        self.hooks = {}

        self.log("Started")
        stdin.register(self)
Esempio n. 3
0
    def __init__(self, *args):
        super(CLI, self).__init__("CLI", *args)

        self.hooks = {}

        self.log("Started")
        stdin.register(self)
        self.fire(cli_register_event("help", cli_help))
Esempio n. 4
0
def main():
    opts, args = parse_options()

    # Configure and "run" the System.
    app = Telnet(*args, **opts.__dict__)
    if opts.verbose:
        from circuits import Debugger
        Debugger().register(app)
    stdin.register(app)
    app.run()
Esempio n. 5
0
def main():
    opts, args = parse_options()

    # Configure and "run" the System.
    app = Telnet(*args, **opts.__dict__)
    if opts.verbose:
        from circuits import Debugger
        Debugger().register(app)
    stdin.register(app)
    app.run()
Esempio n. 6
0
def main():
    opts, args = parse_options()

    host = args[0]
    if len(args) > 1:
        port = int(args[1])
    else:
        port = 6667

    # Configure and run the system.
    client = Client(host, port, opts=opts)
    stdin.register(client)
    client.run()
Esempio n. 7
0
def main():
    opts, args = parse_options()

    host = args[0]
    if len(args) > 1:
        port = int(args[1])
    else:
        port = 6667

    # Configure and run the system.
    client = Client(host, port, opts=opts)
    stdin.register(client)
    client.run()
Esempio n. 8
0
    def __init__(self,
                 no_stdin=False,
                 no_stdout=False,
                 loop_function=None,
                 loop_frequency=60,
                 *args,
                 **kwargs):
        super(IsomerClient, self).__init__(*args, **kwargs)
        self.url = '{protocol}://{host}:{port}/{url}'.format(**kwargs)
        if no_stdout:
            set_verbosity(100)

        if not no_stdin:
            self.log("Connecting stdin")
            stdin.register(self)

        self.log("Connecting to isomer instance at", self.url)
        self.username = kwargs.get('username')
        self.password = kwargs.get('password')

        self.max_length = 100
        self._request_id = 0

        self.messages = []
        self.hooks = {}

        self.client = WebSocketClient(self.url).register(self)

        if loop_function is not None:
            self.log('Registering external loop function')
            self.loop_function = loop_function
            self.loop_timer = Timer(1 / loop_frequency,
                                    call_loop(),
                                    persist=True).register(self)

        self.log("Ready")