本文整理汇总了Python中models.project.Project.parse_project方法的典型用法代码示例。如果您正苦于以下问题:Python Project.parse_project方法的具体用法?Python Project.parse_project怎么用?Python Project.parse_project使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.project.Project
的用法示例。
在下文中一共展示了Project.parse_project方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_vuln_projects_json
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import parse_project [as 别名]
def load_vuln_projects_json():
from models.project import Project
fp = open('data/vuln_projects.json', 'r')
prj_json = json.load(fp)
fp.close()
project_list = []
for pk in prj_json:
project_list.append(Project.parse_project(pk, 0))
return project_list
示例2: load_evolution_projects_json
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import parse_project [as 别名]
def load_evolution_projects_json():
from models.project import Project
if not os.path.exists('data/valid_projects.json'):
print '[ERROR]: data/valid_projects.json does not exist!'
return []
project_list = []
fp = open('data/valid_projects.json', 'r')
prj_json = json.load(fp)
fp.close()
for p in prj_json:
project_list.append(Project.parse_project(p, 0))
return project_list
示例3: load_projects_json
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import parse_project [as 别名]
def load_projects_json():
from models.project import Project
if not os.path.exists('data/project_versions.json'):
print '[ERROR]: data/project_versions.json does not exist!'
return []
project_list = []
fp = open('data/project_versions.json', 'r')
prj_json = json.load(fp)
fp.close()
for (k, v) in prj_json.iteritems():
project_list.append(Project.parse_project(k, v))
return project_list