Esempio n. 1
0
 def buildCliString(self):
     """
     Collect all of the required information from the config screen and
     build a CLI string which can be used to invoke the client program
     """
     config = self.navbar.getActiveConfig()
     group = self.buildSpec['widgets'][self.navbar.getSelectedGroup()]
     positional = config.getPositionalArgs()
     optional = config.getOptionalArgs()
     print(
         cli.buildCliString(self.buildSpec['target'], group['command'],
                            positional, optional))
     return cli.buildCliString(self.buildSpec['target'], group['command'],
                               positional, optional)
Esempio n. 2
0
 def buildCliString(self):
     """
     Collect all of the required information from the config screen and
     build a CLI string which can be used to invoke the client program
     """
     config = self.navbar.getActiveConfig()
     group = self.buildSpec['widgets'][self.navbar.getSelectedGroup()]
     positional = config.getPositionalArgs()
     optional = config.getOptionalArgs()
     print(cli.buildCliString(
         self.buildSpec['target'],
         group['command'],
         positional,
         optional
     ))
     return cli.buildCliString(
         self.buildSpec['target'],
         group['command'],
         positional,
         optional
     )
Esempio n. 3
0
    def test_cli(self):
        print(cli.buildCliString('target', 'cmd', ['pos1', 'pos2'], ['-a 1', '-b 2']))

        positionals = [
            {'clitype': 'positional', 'cmd': 'pos1', 'required': True},
            {'clitype': 'positional', 'cmd': 'pos2', 'required': True}
        ]

        optionals = [
            {'clitype': 'optional', 'cmd': '-a 1', 'required': False},
            {'clitype': 'optional', 'cmd': '-b 2', 'required': False},
        ]

        # print(cli.formValidationCmd('target', 'cmd', positionals, optionals))