本文整理汇总了Python中Plugin.Plugin.rawIdentifier方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.rawIdentifier方法的具体用法?Python Plugin.rawIdentifier怎么用?Python Plugin.rawIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.rawIdentifier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: analyseBundle
# 需要导入模块: from Plugin import Plugin [as 别名]
# 或者: from Plugin.Plugin import rawIdentifier [as 别名]
def analyseBundle(bundleId):
bundle = config.bundleTable.find_one({"bundleId": bundleId})
if bundle == None:
logging.error("No matching bundle has been found")
abort(make_response("No matching bundle has been found", 400))
if bundle["archivePath"] == None:
logging.error("The bundle as no directory path")
abort(make_response("The bundle as no directory path", 400))
headers = {'content-type': 'application/gzip'}
analyseReturn = requests.post(
config.uriAnalyser+"/bundle/"+str(bundleId),
data=open(bundle["archivePath"], 'r').read(),
headers=headers).json()
# logging.error("analyzeBundle analyseReturn: " + str(analyseReturn))
pluginIdOffset = config.pluginTable.count()
while 1:
analyseReturn = requests.get(config.uriAnalyser+"/bundle/"+str(bundleId)).json()
if analyseReturn['status'] == "done":
bundleData = analyseReturn['datas']
break
sleep(1)
for index, plugin in enumerate(bundleData['plugins']) :
pluginId = pluginIdOffset + index
currentPlugin = Plugin(pluginId, bundleId)
currentPlugin.clips = plugin['clips']
currentPlugin.parameters = plugin['parameters']
currentPlugin.properties = plugin['properties']
currentPlugin.rawIdentifier = plugin['rawIdentifier']
currentPlugin.version = plugin['version']
# Gets Label/ShortLabel and ensures a non-empty value.
currentPlugin.label = currentPlugin.getPropValueFromKeys(
('OfxPropLabel', 'OfxPropShortLabel', 'OfxPropLongLabel'),
currentPlugin.rawIdentifier)
currentPlugin.shortLabel = currentPlugin.getPropValueFromKeys(
('OfxPropShortLabel', 'OfxPropLongLabel'),
currentPlugin.label)
bundle['plugins'].append(pluginId)
config.pluginTable.insert(currentPlugin.__dict__)
return mongodoc_jsonify(bundle)