本文整理汇总了Python中score.Score.submit方法的典型用法代码示例。如果您正苦于以下问题:Python Score.submit方法的具体用法?Python Score.submit怎么用?Python Score.submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类score.Score
的用法示例。
在下文中一共展示了Score.submit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: not
# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import submit [as 别名]
# If there are no control types left to check, stop the loop.
if not ( False in stop_submit.values() ):
logging.info( "handle_submit: Found no False in " \
+ "stop_submit, breaking." )
break
continue
try:
name = score["name"]
comment = score["comment"]
except KeyError, ex:
logging.warning( "handle_submit: Got KeyError: %s. " \
+ "Dictionary: %s", repr( ex ), str( score ) )
continue
status = Score.submit( name, comment, score_points, score_control,
location )
submit_count += 1
# If the submit fails because of an error, log as much of it as
# possible so we maybe can submit it manually later.
if status == Score.SUBMIT_FAIL:
json_dump = "<could not dump json>"
try:
json_dump = json.dumps( score )
except:
pass
logging.critical( "RequestAndSubmitHandler.handle_submit: " \
+ "score submit failed. JSON: %s", json_dump)
logging.info( "Submitted %d of %d scores before the error.",
submit_count - 1, len( scores ) )