本文整理汇总了Python中gratipay.testing.Harness.make_participant方法的典型用法代码示例。如果您正苦于以下问题:Python Harness.make_participant方法的具体用法?Python Harness.make_participant怎么用?Python Harness.make_participant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gratipay.testing.Harness
的用法示例。
在下文中一共展示了Harness.make_participant方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_participant
# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import make_participant [as 别名]
def make_participant(self, username, **kw):
take_last_week = kw.pop('take_last_week', None)
team_name = kw.pop('', TEAM)
participant = Harness.make_participant(self, username, **kw)
if take_last_week is not None:
if self.db.one('SELECT * FROM paydays') is None:
self.db.run("INSERT INTO paydays DEFAULT VALUES")
self.db.run( "INSERT INTO transfers (timestamp, tipper, tippee, amount, context) "
"VALUES (now(), %(tipper)s, %(tippee)s, %(amount)s, 'take')"
, dict(tipper=team_name, tippee=username, amount=take_last_week,)
)
self.db.run("UPDATE paydays SET ts_end=now()")
return participant
示例2: make_participant
# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import make_participant [as 别名]
def make_participant(self, *a, **kw):
kw['claimed_time'] = utcnow()
return Harness.make_participant(self, *a, **kw)