本文整理汇总了Python中opus_core.services.run_server.run_manager.RunManager.delete_year_dirs_in_cache方法的典型用法代码示例。如果您正苦于以下问题:Python RunManager.delete_year_dirs_in_cache方法的具体用法?Python RunManager.delete_year_dirs_in_cache怎么用?Python RunManager.delete_year_dirs_in_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opus_core.services.run_server.run_manager.RunManager
的用法示例。
在下文中一共展示了RunManager.delete_year_dirs_in_cache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from opus_core.services.run_server.run_manager import RunManager [as 别名]
# 或者: from opus_core.services.run_server.run_manager.RunManager import delete_year_dirs_in_cache [as 别名]
def __init__(self):
GenericOptionGroup.__init__(self, usage="python %prog [options] configuration",
description="Delete results of a simulation run.")
self.parser.add_option("--run-id", dest="run_id", default=None,
action="store",
help="The simulation run to delete.")
self.parser.add_option("--years-to-delete", dest="years_to_delete",
default=None, action="store",
help="Python expression specifying list of years to delete from the simulation's cache.")
if __name__ == "__main__":
try: import wingdbstub
except: pass
option_group = StartRunOptionGroup()
parser = option_group.parser
(options, args) = parser.parse_args()
run_manager = RunManager(option_group.get_services_database_configuration(options))
if options.run_id is None:
parser.print_help()
elif options.years_to_delete:
years_to_delete = eval(options.years_to_delete)
if not isinstance(years_to_delete, list):
years_to_delete = [years_to_delete]
run_manager.delete_year_dirs_in_cache(options.run_id,
years_to_delete=years_to_delete)
else:
run_manager.delete_everything_for_this_run(options.run_id)