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


Python EthernetPort.setShortName方法代码示例

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


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

示例1: __init__

# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setShortName [as 别名]
    def __init__(self, module, server, project):
        VM.__init__(self, module, server, project)

        log.info("VPCS instance is being created")
        self._vm_id = None
        self._defaults = {}
        self._export_directory = None
        self._loading = False
        self._ports = []
        self._settings = {"name": "",
                          "script_file": "",
                          "startup_script": None,
                          "startup_script_path": None,
                          "console": None}

        port_name = EthernetPort.longNameType() + str(0)
        short_name = EthernetPort.shortNameType() + str(0)

        # VPCS devices have only one Ethernet port
        port = EthernetPort(port_name)
        port.setShortName(short_name)
        port.setAdapterNumber(0)
        port.setPortNumber(0)
        self._ports.append(port)
        log.debug("port {} has been added".format(port_name))

        # save the default settings
        self._defaults = self._settings.copy()
开发者ID:bluca,项目名称:gns3-gui,代码行数:30,代码来源:vpcs_device.py

示例2: _addAdapters

# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setShortName [as 别名]
    def _addAdapters(self, adapters):
        """Adds adapters.

        :param adapters: number of adapters
        """
        for adapter_number in range(0, adapters):
            adapter_name = EthernetPort.longNameType() + str(adapter_number)
            short_name = EthernetPort.shortNameType() + str(adapter_number)
            new_port = EthernetPort(adapter_name)
            new_port.setShortName(short_name)
            new_port.setAdapterNumber(adapter_number)
            new_port.setPortNumber(0)
            self._ports.append(new_port)
            log.debug("Adapter {} has been added".format(adapter_name))
开发者ID:george7878099,项目名称:gns3-gui,代码行数:16,代码来源:docker_vm.py

示例3: _addAdapters

# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setShortName [as 别名]
    def _addAdapters(self, adapters):
        """Adds adapters.

        :param adapters: number of adapters
        """
        for adapter_number in range(0, adapters):
            adapter_name = "eth" + str(adapter_number)
            short_name = EthernetPort.shortNameType() + str(adapter_number)
            new_port = EthernetPort(adapter_name)
            new_port.setShortName(short_name)
            new_port.setAdapterNumber(adapter_number)
            new_port.setPortNumber(0)
            new_port.setHotPluggable(False)
            new_port.setPacketCaptureSupported(True)
            self._ports.append(new_port)
            log.debug("Adapter {} has been added".format(adapter_name))
开发者ID:GMarciales,项目名称:gns3-gui,代码行数:18,代码来源:docker_vm.py

示例4: __init__

# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setShortName [as 别名]
    def __init__(self, module, server, project):
        super().__init__(module, server, project)

        log.info("VPCS instance is being created")
        self._vm_id = None
        self._settings = {"name": "",
                          "startup_script": None,
                          "startup_script_path": None,
                          "console": None}

        port_name = EthernetPort.longNameType() + str(0)
        short_name = EthernetPort.shortNameType() + str(0)

        # VPCS devices have only one fixed Ethernet port
        port = EthernetPort(port_name)
        port.setShortName(short_name)
        port.setAdapterNumber(0)
        port.setPortNumber(0)
        self._ports.append(port)
        log.debug("port {} has been added".format(port_name))
开发者ID:guili618,项目名称:gns3-gui,代码行数:22,代码来源:vpcs_device.py


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