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