本文整理汇总了Python中utility.Utility.saveJson方法的典型用法代码示例。如果您正苦于以下问题:Python Utility.saveJson方法的具体用法?Python Utility.saveJson怎么用?Python Utility.saveJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility.Utility
的用法示例。
在下文中一共展示了Utility.saveJson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeTask
# 需要导入模块: from utility import Utility [as 别名]
# 或者: from utility.Utility import saveJson [as 别名]
def removeTask(projectId, taskId, taskType):
tasks = Settings.getTasks(projectId, taskType)
if taskId in tasks:
tasks.remove( taskId)
path = "%s/%s.%s.json"%(PROJECTS_PATH, projectId, taskType)
if not Utility.isLocked( path ):
Utility.saveJson( path, tasks )
示例2: addTask
# 需要导入模块: from utility import Utility [as 别名]
# 或者: from utility.Utility import saveJson [as 别名]
def addTask(projectId, taskId, taskType):
tasks = Settings.getTasks(projectId, taskType)
if taskId in tasks:
return
tasks.append( taskId )
path = "%s/%s.%s.json"%(PROJECTS_PATH, projectId, taskType)
Utility.saveJson( path, tasks )
示例3: reconcilePredictionTasks
# 需要导入模块: from utility import Utility [as 别名]
# 或者: from utility.Utility import saveJson [as 别名]
def reconcilePredictionTasks(projectId):
finishedTasks = Settings.getFinishedPredictionTasks( projectId )
tasks = Settings.getPredictionTasks( projectId )
print 'finishedTasks:', finishedTasks
print 'tasks:', tasks
for task in finishedTasks:
print 'task:', task
if task in tasks:
print 'removing task:', task
tasks.remove( task )
path = "%s/%s.%s.json"%(PROJECTS_PATH, projectId, PREDICT_TASK_TYPE)
Utility.saveJson( path, tasks )
path = "%s/%s.%s.json"%(PROJECTS_PATH, projectId, PREDICTED_TASK_TYPE)
Utility.saveJson( path, [] )