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


Python Protocol.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self, executor, browser):
     Protocol.__init__(self, executor, browser)
     self.webdriver_binary = executor.webdriver_binary
     self.webdriver_args = executor.webdriver_args
     self.capabilities = self.executor.capabilities
     self.session_config = None
     self.server = None
开发者ID:frivoal,项目名称:web-platform-tests,代码行数:9,代码来源:base.py

示例2: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self, conn):
     Protocol.__init__(self, conn)
     self.mapfn = self.reducefn = None
     
     self.register_command('mapfn', self.set_mapfn)
     self.register_command('reducefn', self.set_reducefn)
     self.register_command('map', self.call_mapfn)
     self.register_command('reduce', self.call_reducefn)
     
     self.send_command('ready')
开发者ID:ec262,项目名称:client,代码行数:12,代码来源:worker.py

示例3: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self, worker, server):
     """Connect to the specified worker"""
     Protocol.__init__(self)
     self.server = server
     self.register_command('taskcomplete', self.complete_task)
     self.register_command('ready', lambda x, y: self.initialize_worker())
     # Create connection
     logging.debug("Connecting to worker %s:%d..." % worker)
     self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
     self.connect(worker)
开发者ID:ec262,项目名称:client,代码行数:12,代码来源:foreman.py

示例4: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self):
     Protocol.__init__(self)
     # Module-specific attributes
     self.attributes = {
         "NAME": 'ftp',
         "MODULE_SPEAKS_PROTOCOL": True,
         "PROTOCOL_DEFAULT_PORTS": [21],
         "PROTOCOL_SPEAKS_FIRST": True,
         "PATTERN": r"\d{3}(\s|-).*"
     }
     self.compile_pattern()
开发者ID:aych,项目名称:portprobe,代码行数:13,代码来源:ftp.py

示例5: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self):
     Protocol.__init__(self)
     # Module-specific attributes
     self.attributes = {
         "NAME": 'http',
         "MODULE_SPEAKS_PROTOCOL": True,
         "PROTOCOL_DEFAULT_PORTS": [80, 1080, 8080],
         "PROTOCOL_SPEAKS_FIRST": False,
         "PATTERN": r"^HTTP.+?\s\d{3}\s.+?"
     }
     self.compile_pattern()
开发者ID:aych,项目名称:portprobe,代码行数:13,代码来源:http.py

示例6: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self):
     Protocol.__init__(self)
     # Module-specific attributes
     self.attributes = {
         "NAME": 'socks5',
         "MODULE_SPEAKS_PROTOCOL": True,
         "PROTOCOL_DEFAULT_PORTS": [1080, 8080],
         "PROTOCOL_SPEAKS_FIRST": False,
         "PATTERN": r""
     }
     self.compile_pattern()
开发者ID:aych,项目名称:portprobe,代码行数:13,代码来源:socks5.py

示例7: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self):
     Protocol.__init__(self)
     # Module-specific attributes
     self.attributes = {
         "NAME": 'irc',
         "MODULE_SPEAKS_PROTOCOL": True,
         "PROTOCOL_DEFAULT_PORTS": [6660, 6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 7000],
         "PROTOCOL_SPEAKS_FIRST": True,
         "PATTERN": r"[0-9A-Z:a-z-\s*._]+?:[0-9A-Z:a-z-\s*._]+?"
     }
     self.compile_pattern()
     self.unprocessed = ''
     self.registered = False
开发者ID:aych,项目名称:portprobe,代码行数:15,代码来源:irc.py

示例8: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self, **args):
     # Here we are going to intercept the original _defineParams function
     # and replace by an empty one, this is to postpone the definition of 
     # params until the protocol is set and then self.protocol can be used
     # for a more dynamic definition
     object.__setattr__(self, '_defineParamsBackup', self._defineParams)
     object.__setattr__(self, '_defineParams', self._defineParamsEmpty)
 
     Protocol.__init__(self, **args)
     Viewer.__init__(self, **args)
     self.allowHeader.set(False)
     self.showPlot = True # This flag will be used to display a plot or return the plotter
     self._tkRoot = None
     self.formWindow = None
     self.setWorkingDir(self.getProject().getTmpPath())
开发者ID:coocoky,项目名称:scipion,代码行数:17,代码来源:viewer.py

示例9: __init__

# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import __init__ [as 别名]
 def __init__(self, **args):
     Protocol.__init__(self, **args)        
     self.stepsExecutionMode = STEPS_PARALLEL
开发者ID:I2PC,项目名称:scipion,代码行数:5,代码来源:parallel.py


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