コード例 #1
0
ファイル: help.py プロジェクト: kightlygeorge/snapcraft
def _module_help(module_name, devel):
    try:
        module = importlib.import_module(
            'snapcraft.plugins.{}'.format(module_name))
        if module.__doc__ and devel:
            help(module)
        elif module.__doc__:
            print(module.__doc__)
        else:
            print('The plugin has no documentation')
    except ImportError:
        logger.error('The plugin does not exist. Use one of the following:')
        cmds.list_plugins()
コード例 #2
0
ファイル: help.py プロジェクト: strukturag/snapcraft
def _module_help(module_name, devel):
    try:
        module = importlib.import_module(
            'snapcraft.plugins.{}'.format(module_name))
        if module.__doc__ and devel:
            help(module)
        elif module.__doc__:
            print(module.__doc__)
        else:
            print('The plugin has no documentation')
    except ImportError:
        logger.error('The plugin does not exist. Use one of the following:')
        cmds.list_plugins()
コード例 #3
0
ファイル: test_cmds.py プロジェクト: strukturag/snapcraft
    def test_list_plugins(self, mock_stdout):
        expected_list = '''ant
autotools
catkin
cmake
copy
go
jdk
make
maven
python2
python3
qml
roscore
scons
tar-content
'''
        cmds.list_plugins()
        self.assertEqual(mock_stdout.getvalue(), expected_list)
コード例 #4
0
ファイル: test_cmds.py プロジェクト: svijee/snapcraft
    def test_list_plugins(self, mock_stdout):
        expected_list = '''ant
autotools
catkin
cmake
copy
go
jdk
make
maven
python2
python3
qml
roscore
scons
tar-content
'''
        cmds.list_plugins()
        self.assertEqual(mock_stdout.getvalue(), expected_list)