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


Python Server.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, core="tarantool"):
     Server.__init__(self, core)
     self.default_bin_name = "tarantool_box"
     self.default_config_name = "tarantool.cfg"
     self.default_init_lua_name = "init.lua"
     # append additional cleanup patterns
     self.re_vardir_cleanup += ['*.snap',
                                '*.xlog',
                                '*.inprogress',
                                '*.cfg',
                                '*.sup',
                                '*.lua']
     self.process = None
     self.config = None
     self.vardir = None
     self.valgrind_log = "valgrind.log"
     self.valgrind_sup = os.path.join("share/", "%s.sup" % ('tarantool'))
     self.init_lua = None
     self.default_suppression_name = "valgrind.sup"
     self.pidfile = None
     self.port = None
     self.binary = None
     self.is_started = False
     self.mem = False
     self.start_and_exit = False
     self.gdb = False
     self.valgrind = False
开发者ID:catcher22,项目名称:tarantool,代码行数:29,代码来源:tarantool_server.py

示例2: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)

        self.recvbuf_size = kwargs.get('recvbuf_size', 2048)

        self.epoll = epoll()
        self.epoll.register(self.sock.fileno(), EPOLLIN)
        self.conns = {}
开发者ID:taddeus,项目名称:wspy,代码行数:10,代码来源:async.py

示例3: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, nick):
     Server.__init__(self,
         server_address='localhost',
         port=0,
         server_name='local',
         real_name=nick,
         user_name=nick,
         nick=nick)
开发者ID:iogf,项目名称:candocabot,代码行数:10,代码来源:local.py

示例4: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, core, module):
     Server.__init__(self, core, module)
     self.default_config_name = "tarantool.cfg"
     self.default_init_lua_name = "init.lua"
     # append additional cleanup patterns
     self.re_vardir_cleanup += ['*.snap',
                                '*.xlog',
                                '*.inprogress',
                                '*.cfg',
                                '*.sup',
                                '*.lua']
开发者ID:dgreenru,项目名称:tarantool,代码行数:13,代码来源:tarantool_server.py

示例5: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
	def __init__(self,
			listen_secure,
			handler,
			cert_path,
			key_path,
			plain_mode    = 0,
			listen_plain  = None,
			handler_plain = None
	):

		# figure out if we need to expose an http fallback
		try:
			if plain_mode in PLAIN.values:
				self.plain_mode = plain_mode
			else:
				self.plain_mode = getattr(PLAIN, str(plain_mode).upper())
		except:
			raise Exception("unrecognized mode '{0}'".format(repr(plain_mode)))

		Server.__init__(self, listen_secure, handler)
		#print listen_secure
		#print self.socket
		# the magic that allows simple https connections
		self.socket = ssl.wrap_socket(
			self.socket,
			certfile=cert_path,
			keyfile=key_path,
			server_side=True
		)

		# e.g. if any https is running
		if self.plain_mode:
			if listen_plain is None:
				raise Exception("need to specify `listen_plain` arg when running dual http+https")

			# CUSTOM plain mode requires a seperate, explicit handler
			if self.plain_mode == PLAIN.CUSTOM:
					if handler_plain is None:
						raise Exception("need to specify `handler_plain` when a separate handler is desired for http")

			# use the same handler for http and https
			elif self.plain_mode == PLAIN.MIRROR:
					handler_plain = handler

			# redirect all http requests to http asap
			elif self.plain_mode == PLAIN.REDIRECT:
					handler_plain = SSLRedirectHandler

			else:
					raise Exception("shouldn't be able to get this far without a valid plain_mode???")

			self.plain_server = Server(listen_plain, handler_plain)
		else:
			self.plain_server = None
开发者ID:gbromios,项目名称:gb,代码行数:56,代码来源:ssl_server.py

示例6: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
    def __init__(self, port, config, device):
        Server.__init__(self,port=port)
        PTBase.__init__(self,config=config,device=device)
        
        #######
        
        self.info = MPI.INFO_NULL

        self.port = MPI.Open_port(self.info)
        
        self.service = 'parallel-training'
        
        MPI.Publish_name(self.service, self.info, self.port)
        
        self.worker_comm = {}
        self.worker_rank = {}
        self.first_worker_id = None
开发者ID:CityU-HAN,项目名称:Theano-MPI,代码行数:19,代码来源:PT.py

示例7: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
  def __init__(self, servicePath):
    self.serviceDir = servicePath
    self.generator = WebGenerator(os.path.join(servicePath, 'templates'))

    tileDir = os.path.join(servicePath, 'tiles')
    sourceDir = os.path.join(servicePath, 'sourceImages')
    tileBase = TileBase(db, dbPool, tileDir, sourceDir)
    userBase = UserBase(db, dbPool)
    metaBase = MetaBase(db, dbPool)

    self.images = TileServer(tileBase, metaBase)
    self.outlines = OutlineServer(os.path.join(servicePath, 'outlines'))
    self.user = UserServer(servicePath, userBase)
    self.upload = UploadServer(servicePath, tileBase) #TODO: remove servicePath after tests
    self.meta = MetaServer(metaBase, tileBase, servicePath) # tileBase as privilege manager
    self.indexer = IndexerServer(tileBase, metaBase, servicePath)

    Server.__init__(self)
开发者ID:Neuroinflab,项目名称:BrainSlices,代码行数:20,代码来源:webService.py

示例8: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, core="unittest"):
     Server.__init__(self, core)
     self.debug = False
开发者ID:dubravsky,项目名称:tarantool,代码行数:5,代码来源:unittest_server.py

示例9: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self):
     Client.__init__(self, True)
     Server.__init__(self)
开发者ID:cradle,项目名称:manic,代码行数:5,代码来源:listenClient.py

示例10: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, core="unittest", module="dummy"):
     Server.__init__(self, core, module)
     self.debug = False
开发者ID:cbin,项目名称:tarantool,代码行数:5,代码来源:unittest_server.py

示例11: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, master):
     Server.__init__(self, master)
     Client.__init__(self, master)
     self.starting_window()
开发者ID:David-Wolgemuth,项目名称:tkmessage,代码行数:6,代码来源:main.py

示例12: __init__

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
 def __init__(self, server_type):
     Server.__init__(self, server_type=server_type)
开发者ID:pdegrazia,项目名称:python,代码行数:4,代码来源:serverudp.py


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