當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。