当前位置: 首页>>代码示例>>Python>>正文


Python command.Command方法代码示例

本文整理汇总了Python中command.Command方法的典型用法代码示例。如果您正苦于以下问题:Python command.Command方法的具体用法?Python command.Command怎么用?Python command.Command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在command的用法示例。


在下文中一共展示了command.Command方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def run(self, command):
        log.info(command)
        result = Command(command).run(self.timeout)
        if result[2] != 0:
            if 'BadWindow' in result[1]:
                raise InvalidWindowIdError()
            log.error(result[1])
            raise RuntimeError()
        return result[0] 
开发者ID:daeyun,项目名称:vim-matlab,代码行数:11,代码来源:xdotool.py

示例2: __init__

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def __init__(self, timeout=2):
        if Command('which xdotool').run()[2] != 0:
            raise RuntimeError('xdotool not found')
        self.timeout = timeout 
开发者ID:daeyun,项目名称:vim-matlab,代码行数:6,代码来源:xdotool.py

示例3: _get_next_sequence

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def _get_next_sequence(self):
        """ Get the next command sequence number.

        Returns:
            int: the next sequence number for a Command.
        """
        with self._seq_lock:
            seq = next(self._sequencer)
        return seq 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:11,代码来源:command_factory.py

示例4: get_version_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_version_command(self, data):
        """ Generate a Version Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Version
        """
        return Command(CommandId.VERSION, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例5: get_scan_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_scan_command(self, data):
        """ Generate a Scan Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Scan
        """
        return Command(CommandId.SCAN, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例6: get_scan_all_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_scan_all_command(self, data):
        """ Generate a Scan All Command

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Scan All
        """
        return Command(CommandId.SCAN_ALL, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例7: get_read_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_read_command(self, data):
        """ Generate a Read Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Read
        """
        return Command(CommandId.READ, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例8: get_power_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_power_command(self, data):
        """ Generate a Power Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Power
        """
        return Command(CommandId.POWER, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例9: get_asset_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_asset_command(self, data):
        """ Generate an Asset Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Asset
        """
        return Command(CommandId.ASSET, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例10: get_boot_target_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_boot_target_command(self, data):
        """ Generate a Boot Target Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Boot Target
        """
        return Command(CommandId.BOOT_TARGET, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例11: get_location_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_location_command(self, data):
        """ Generate a Location Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Location
        """
        return Command(CommandId.LOCATION, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例12: get_chamber_led_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_chamber_led_command(self, data):
        """ Generate a Chamber LED Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Chamber LED
        """
        return Command(CommandId.CHAMBER_LED, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例13: get_fan_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_fan_command(self, data):
        """ Generate a Fan Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Fan
        """
        return Command(CommandId.FAN, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例14: get_host_info_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_host_info_command(self, data):
        """ Generate a Host Info Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Host Info
        """
        return Command(CommandId.HOST_INFO, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py

示例15: get_retry_command

# 需要导入模块: import command [as 别名]
# 或者: from command import Command [as 别名]
def get_retry_command(self, data):
        """ Generate a Retry Command.

        Args:
            data (dict): any key-value data that makes up the command context.

        Returns:
            Command: the generated command for Retry
        """
        return Command(CommandId.RETRY, data, self._get_next_sequence()) 
开发者ID:vapor-ware,项目名称:OpenDCRE,代码行数:12,代码来源:command_factory.py


注:本文中的command.Command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。