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