コード例 #1
0
ファイル: utest_commands.py プロジェクト: Jayne-tian/yumtools
 def test_get_command(self):
     ClientConfig().load('/etc/yumtools.conf')
     self.assertTrue(
         isinstance(commands.getCommand("help"), helpcommand.HelpCommand))
     self.assertTrue(
         isinstance(
             commands.getCommand("upload"), uploadcommand.UploadCommand))
コード例 #2
0
ファイル: utest_commands.py プロジェクト: yekeqiang/yumtools
 def test_get_command(self):
     ClientConfig().load('/etc/yumtools.conf')
     self.assertTrue(
         isinstance(commands.getCommand("help"), helpcommand.HelpCommand))
     self.assertTrue(
         isinstance(commands.getCommand("upload"),
                    uploadcommand.UploadCommand))
コード例 #3
0
ファイル: helpcommand.py プロジェクト: Jayne-tian/yumtools
 def run(self, options, args):
     if not self._checkArgs(args):
         return error.ERROR_COMMAND_PARM_INVALID
     command = getCommand(args[0])
     if command is None:
         io.error('', 'command %s not supported.' % args[0])
         return error.ERROR_UNSUPPORT_COMMAND
     command.showHelp()
     return error.ERROR_SUCCEED
コード例 #4
0
 def run(self, options, args):
     if not self._checkArgs(args):
         return error.ERROR_COMMAND_PARM_INVALID
     command = getCommand(args[0])
     if command is None:
         io.error('', 'command %s not supported.' % args[0])
         return error.ERROR_UNSUPPORT_COMMAND
     command.showHelp()
     return error.ERROR_SUCCEED