本文整理汇总了Python中db.Db.get_login方法的典型用法代码示例。如果您正苦于以下问题:Python Db.get_login方法的具体用法?Python Db.get_login怎么用?Python Db.get_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.Db
的用法示例。
在下文中一共展示了Db.get_login方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DcFrame
# 需要导入模块: from db import Db [as 别名]
# 或者: from db.Db import get_login [as 别名]
#.........这里部分代码省略.........
info.AddDeveloper('librarian ([email protected])')
info.SetName('dcLord')
info.SetWebSite('https://github.com/bogolt/dclord')
info.SetVersion(version)
info.SetDescription('Divide and Conquer\ngame client\nsee at: http://www.the-game.ru')
wx.AboutBox(info)
def showPlayersView(self, event):
if self.players:
self.players.Show(True)
return
self.players = self.res.LoadFrame(None, 'PlayersView')
self.players.setConf(self.conf)
self.players.Show(True)
def explore_geo(self, evt):
pass
#find all planets which fit requirements of explorables
def upload(self, _):
#swap with empty value, to assure newly added commands will not interfere with sending ones
tmp = {}
tmp, self.requeusts_queue = self.requeusts_queue, tmp
for user_id, actions in tmp.items():
log.debug('request to send actions from user %d'%(user_id,))
asyncLoader = AsyncLoader(self, self.conf)
req = request.RequestMaker()
for unit_id, action_id in actions:
log.debug('store action %d %d'%(unit_id,action_id))
req.store_action( unit_id, action_id)
uname = self.db.get_login(user_id)
log.debug('send actions %s for user %s'%(req, uname))
asyncLoader.recvActionsReply( (uname,self.conf.users[uname]), req, self.conf.pathOut)
asyncLoader.start()
def test_action(self):
'send all fleets of single acc to a specific pos'
import request
req = request.RequestMaker()
l = ''
player = self.db.getPlayerByLogin(l)
log.debug('got player %s %s'%(player.id, player.login))
go_to = (1, 1)
for pos,id,name,arrival,from_p in self.db.getUserFleets(player.id):
#log.debug('got fleet %s'%(pos, id, name,,))
if go_to == pos:
log.debug('fleet %s is already on destination point'%(name,))
continue
if arrival:
log.debug('fleet %s is flying to %s, arrives at: %d'%(name,pos,arrival))
continue
log.info('moving fleet %s standing at %s'%(name, pos))
req.fleetMove(id, go_to)
p = self.conf.users[l]
asyncLoader.recvActionsReply((l,p), req, '/tmp/dclord/out')
asyncLoader.start()
def sync(self, event):
self.syncMenu.Enable(False)