Exemplo n.º 1
0
    def execute(self):
        print("Models list: \n")
        for model in Routers.list():
            print(model+"\n")

        print("For more models open an issue on: \n ")
        print("https://github.com/CristianOliveira/croutera")

        return True
Exemplo n.º 2
0
    def command(args):
        """ Retrive command by args """

        if args.version:
            return VersionCommand()

        if args.list_models:
            return ModelListCommand()

        manufacturer = extractor.extract_manufacturer(args.model)
        model = extractor.extract_model(args.model)
        router = Routers.get(manufacturer, model)

        chain = ChainCommand()
        chain.add(AuthorizeCommand(router, args.username, args.password))

        if args.wifi_pass:
            chain.add(ShowWifiPassCommand(router))
            return chain

        if args.restart:
            chain.add(RestartCommand(router))
            return chain
Exemplo n.º 3
0
    def command(args):
        """ Retrive command by args """

        if args.version:
            return VersionCommand()

        if args.list_models:
            return ModelListCommand()

        manufacturer = extractor.extract_manufacturer(args.model)
        model = extractor.extract_model(args.model)
        router = Routers.get(manufacturer, model)

        chain = ChainCommand()
        chain.add(AuthorizeCommand(router, args.username, args.password))

        if args.wifi_pass:
            chain.add(ShowWifiPassCommand(router))
            return chain

        if args.restart:
            chain.add(RestartCommand(router))
            return chain