本文整理汇总了Python中score.Score.reflag_new_week方法的典型用法代码示例。如果您正苦于以下问题:Python Score.reflag_new_week方法的具体用法?Python Score.reflag_new_week怎么用?Python Score.reflag_new_week使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类score.Score
的用法示例。
在下文中一共展示了Score.reflag_new_week方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import reflag_new_week [as 别名]
def get(self):
self.response.out.write( "cronjob here!<br /><br />" )
clean_invisible = unicode( self.request.get( "clean_invisible" ) )
if clean_invisible == "yes":
# Get a location.
location = Country.get_random_location()
# Get the locations lowest high score.
for control in config.VALID_CONTROLS:
lowest_score = Score.get_lowest_score( control, location )
if lowest_score is None:
continue
self.clean_country( control, location, lowest_score )
flush = unicode( self.request.get( "flush" ) )
if flush == "yes":
memcache.flush_all()
reflag_week_shallow = unicode( self.request.get(
"reflag_week_shallow" ) )
if reflag_week_shallow == "yes":
Score.reflag_new_week()
Score._delete_cached_list( "tilt", config.LOCATION_WEEK )
Score._delete_cached_list( "touch", config.LOCATION_WEEK )
for control in ("tilt", "touch"):
Score.get_top_list(config.TOP_LIST_LENGTH, control,
config.LOCATION_WEEK)
clear_world_week_duplicates = unicode( self.request.get(
"clear_world_week_duplicates" ) )
if clear_world_week_duplicates == "yes":
for location in ( config.LOCATION_WORLD, config.LOCATION_WEEK ):
for control in config.VALID_CONTROLS:
self.delete_duplicates( control, location )
clear_random_country_duplicates = unicode( self.request.get(
"clear_random_country_duplicates" ) )
if clear_random_country_duplicates == "yes":
location = Country.get_random_location()
for control in config.VALID_CONTROLS:
self.delete_duplicates( control, location )
clear_country_duplicates = unicode( self.request.get(
"clear_country_duplicates" ) )
if clear_country_duplicates != "":
for control in config.VALID_CONTROLS:
self.delete_duplicates( control, clear_country_duplicates )
clear_all_country_duplicates = unicode( self.request.get(
"clear_all_country_duplicates" ) )
if clear_all_country_duplicates == "yes":
start_location = Country.next_country()
location = start_location
count = 0
try:
while True:
for control in config.VALID_CONTROLS:
self.delete_duplicates( control, location )
location = Country.next_country()
count += 1
except DeadlineExceededError, ex:
logging.error( "CronJob.get: Got DeadlineExceededError. " \
+ "Managed to clear %d countries from \"%s\" to \"%s\"",
count, start_location, location )
return