当前位置: 首页>>代码示例>>Python>>正文


Python Plugin.rawIdentifier方法代码示例

本文整理汇总了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)
开发者ID:LoRayZm,项目名称:ShuttleOFX,代码行数:52,代码来源:views.py


注:本文中的Plugin.Plugin.rawIdentifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。