コード例 #1
0
 def init3(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_param = {
         "create": ["--funtimes", "-f", '--fun', "--helloworld"],
     }
     completable_param = ["--helloworld", "--funtimes", "-f", '--fun']
     param_descript = {
         "create -f": "There is no work life balance, it's just your life",
         "create --funtimes":
         "There is no work life balance, it's just your life",
         "create --fun":
         "There is no work life balance, it's just your life"
     }
     same_param_doubles = {
         "create":
         [set(["-f", "--funtimes", '--fun']),
          set(['--unhap', '-u'])]
     }
     command_description = {"create": '', "command can": ''}
     commands = _Commands(command_tree=com_tree3,
                          command_param=command_param,
                          completable_param=completable_param,
                          param_descript=param_descript,
                          same_param_doubles=same_param_doubles,
                          descrip=command_description)
     self.completer = _build_completer(commands, global_params=False)
コード例 #2
0
 def init2(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_param = {
         "create": ["-funtime"],
     }
     completable_param = [
         "-helloworld",
         "-funtime"
     ]
     param_descript = {
         "create -funtime": "There is no work life balance, it's just your life"
     }
     command_description = {
         "create": '',
         "command can": ''
     }
     commands = _Commands(
         command_tree=com_tree3,
         command_param=command_param,
         completable_param=completable_param,
         param_descript=param_descript,
         descrip=command_description
     )
     self.completer = AzCompleter(commands, global_params=False)
コード例 #3
0
 def init2(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_param = {
         "create": ["-funtime"],
     }
     completable_param = [
         "-helloworld",
         "-funtime"
     ]
     param_descript = {
         "create -funtime": "There is no work life balance, it's just your life"
     }
     command_description = {
         "create": '',
         "command can": ''
     }
     commands = _Commands(
         command_tree=com_tree3,
         command_param=command_param,
         completable_param=completable_param,
         param_descript=param_descript,
         descrip=command_description
     )
     self.completer = AzCompleter(commands, global_params=False)
コード例 #4
0
ファイル: test_completion.py プロジェクト: deconya/azure-cli
 def init4(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("createmore can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_param = {
         "create": ["--funtimes", "-f", "--helloworld"],
     }
     completable_param = ["--helloworld", "--funtimes", "-f"]
     param_descript = {
         "create -f":
         "There is no work life balance, it's just your life",
         "create --funtimes":
         "There is no work life balance, it's just your life"
     }
     same_param_doubles = {"-f": "--funtimes", "--funtimes": '-f'}
     command_description = {"create": '', "createmore can": ''}
     commands = _Commands(command_tree=com_tree3,
                          command_param=command_param,
                          completable_param=completable_param,
                          param_descript=param_descript,
                          same_param_doubles=same_param_doubles,
                          descrip=command_description)
     self.completer = AzCompleter(commands,
                                  global_params=False,
                                  outstream=six.StringIO())
コード例 #5
0
    def init1(self):
        """ a variation of initializing """
        com_tree1 = tree.generate_tree("command can")
        com_tree2 = tree.generate_tree("create")
        com_tree3 = tree.CommandHead()
        com_tree3.add_child(com_tree2)
        com_tree3.add_child(com_tree1)

        commands = _Commands(command_tree=com_tree3)
        self.completer = AzCompleter(commands)
コード例 #6
0
 def init1(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_description = {"create": '', "command can": ''}
     commands = _Commands(command_tree=com_tree3,
                          descrip=command_description)
     self.completer = _build_completer(commands, global_params=False)
コード例 #7
0
 def init1(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_description = {
         "create": '',
         "command can": ''
     }
     commands = _Commands(
         command_tree=com_tree3,
         descrip=command_description
     )
     self.completer = AzCompleter(commands, global_params=False)
コード例 #8
0
 def init3(self):
     """ a variation of initializing """
     com_tree1 = tree.generate_tree("command can")
     com_tree2 = tree.generate_tree("create")
     com_tree3 = tree.CommandHead()
     com_tree3.add_child(com_tree2)
     com_tree3.add_child(com_tree1)
     command_param = {
         "create": ["--funtimes", "-f", '--fun', "--helloworld"],
     }
     completable_param = [
         "--helloworld",
         "--funtimes",
         "-f",
         '--fun'
     ]
     param_descript = {
         "create -f": "There is no work life balance, it's just your life",
         "create --funtimes": "There is no work life balance, it's just your life",
         "create --fun": "There is no work life balance, it's just your life"
     }
     same_param_doubles = {
         "create": [set(["-f", "--funtimes", '--fun']), set(['--unhap', '-u'])]
     }
     command_description = {
         "create": '',
         "command can": ''
     }
     commands = _Commands(
         command_tree=com_tree3,
         command_param=command_param,
         completable_param=completable_param,
         param_descript=param_descript,
         same_param_doubles=same_param_doubles,
         descrip=command_description
     )
     self.completer = AzCompleter(commands, global_params=False)