本文整理汇总了Python中com.googlecode.fascinator.common.JsonSimple.size方法的典型用法代码示例。如果您正苦于以下问题:Python JsonSimple.size方法的具体用法?Python JsonSimple.size怎么用?Python JsonSimple.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.fascinator.common.JsonSimple
的用法示例。
在下文中一共展示了JsonSimple.size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __activate__
# 需要导入模块: from com.googlecode.fascinator.common import JsonSimple [as 别名]
# 或者: from com.googlecode.fascinator.common.JsonSimple import size [as 别名]
def __activate__(self, context):
self.None = context["log"]
self.systemConfig = context["systemConfig"]
self.sessionState = context["sessionState"]
self.response = context["response"]
self.request = context["request"]
self.services = context["Services"]
self.sessionState.set("username", "admin")
self.writer = self.response.getPrintWriter("text/plain; charset=UTF-8")
curationJobDao = ApplicationContextProvider.getApplicationContext().getBean("curationJobDao")
publicationHandler = ApplicationContextProvider.getApplicationContext().getBean("publicationHandler")
jobs = JsonSimple(File(FascinatorHome.getPath() + "/curation-status-responses/inProgressJobs.json")).getArray("inProgressJobs")
self.writer.println(jobs.size())
for curationJob in jobs:
curationJob
jobStatus = self.queryJobStatus(curationJob)
self.writer.println(jobStatus.toString())
status = jobStatus.getString("failed", "status")
self.writeResponseToStatusResponseCache(jobStatus.getInteger(None, "job_id"), jobStatus)
self.writer.println(status)
if "complete" == status:
publicationHandler.publishRecords(jobStatus.getArray("job_items"))
self.updateLocalRecordRelations(jobStatus.getArray("job_items"))
self.writer.close()
self.sessionState.remove("username")