예제 #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
예제 #2
0
파일: cli.py 프로젝트: quile90958/croutera
    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
예제 #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