本文整理汇总了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
示例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')
示例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)
示例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()
示例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()
示例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()
示例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
示例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())
示例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