本文整理汇总了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
示例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 = {}
示例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)
示例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']
示例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
示例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
示例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)
示例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
示例9: __init__
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import __init__ [as 别名]
def __init__(self):
Client.__init__(self, True)
Server.__init__(self)
示例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
示例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()
示例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)