本文整理汇总了Python中Client.Client.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Client.__init__方法的具体用法?Python Client.__init__怎么用?Python Client.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client.Client
的用法示例。
在下文中一共展示了Client.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, connectID,server):
try:
Client.__init__(self, connectID,server)
self.__initData()
except BaseException,e:
print "Player Init Error"
print e
示例2: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, root, address, session_id):
'initial setup for the connected client'
Client.__init__(self, root, None, address, session_id)
self.static = True # can't be removed... don't want to anyway :)
self.logged_in = True
self.access = 'admin'
self.accesslevels = ['admin', 'mod', 'user', 'everyone']
self.bot = 1
self.username = 'ChanServ'
self.password = 'ChanServ'
self.cpu = '9001'
self.lobby_id = 'ChanServ'
self._root.usernames[self.username] = self
self._root.console_write('Successfully logged in static user <%s> on session %s.'%(self.username, self.session_id))
示例3: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, node):
address = node.get("address")
server = node.get("server")
max = node.findtext("max")
media = node.find("media")
try:
max = int(max)
except ValueError:
max = None
params = {}
if address: params["address"] = address
if server: params["server"] = server
if max: params["max"] = int(max)
if media: params["media"] = media.items()
Client.__init__(self, **params)
示例4: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, root, address, session_id):
"initial setup for the connected client"
Client.__init__(self, root, None, address, session_id)
self.static = True # can't be removed... don't want to anyway :)
self.logged_in = True
self.access = "admin"
self.accesslevels = ["admin", "mod", "user", "everyone"]
self.bot = 1
self.username = "ChanServ"
self.password = "ChanServ"
self.cpu = "9001"
self.lobby_id = "ChanServ"
self._root.usernames[self.username] = self
self._root.console_write(
"Successfully logged in static user <%s> on session %s." % (self.username, self.session_id)
)
示例5: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, root, address, session_id):
'initial setup for the connected client'
Client.__init__(self, root, address, session_id)
self.accesslevels = ['admin', 'mod', 'user', 'everyone']
self.logged_in = True
self.connected = True
self.bot = True
self.user_id = None
self.static = True
self.username = 'ChanServ'
self.password = 'ChanServ'
self.lobby_id = 'ChanServ'
self._root.usernames[self.username] = self
self._root.clients[session_id] = self
self._root = root
self._root.protocol._calc_status(self, self.status)
logging.info('[%s] <%s> logged in (access=ChanServ)'%(session_id, self.username))
示例6: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, host, port, board, name):
Client.__init__(self, host, port, name)
self.init_board(board)
self.reserve = 0
self.player_id = 0
示例7: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
def __init__(self, host, port, name):
Client.__init__(self, host, port, name)
self.init_countries()
self.players = map(lambda x: Player(x), range(6))
self.reserve = 0
self.player_id = 0