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


Python ExtMap.items方法代码示例

本文整理汇总了Python中misc.ExtMap.ExtMap.items方法的典型用法代码示例。如果您正苦于以下问题:Python ExtMap.items方法的具体用法?Python ExtMap.items怎么用?Python ExtMap.items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在misc.ExtMap.ExtMap的用法示例。


在下文中一共展示了ExtMap.items方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createResourceStruct

# 需要导入模块: from misc.ExtMap import ExtMap [as 别名]
# 或者: from misc.ExtMap.ExtMap import items [as 别名]
    def createResourceStruct(resources, formatAsTree=False, updateOnlyExistingSprites=False):
        
        skippatt = re.compile(r'\.(meta|py)$', re.I)
        result = {}
        if formatAsTree:
            result = ExtMap()

        # Filter unwanted files
        for res in resources:
            if skippatt.search(res.path):
                continue
            result[res.id] = res

        # Update simple images
        for combImg in (x for x in result.values() if isinstance(x, CombinedImage)):
            for embImg in combImg.embeds:
                if embImg.id in result:
                    result[embImg.id].attachCombinedImage(combImg)
                elif not updateOnlyExistingSprites:
                    embImg.attachCombinedImage(combImg)
                    result[embImg.id] = embImg

        # Flatten out the resource representation
        for resid, res in result.items():
            result[resid] = res.toResinfo()

        # ExtMap returns nested maps
        if formatAsTree:
            result = result.getData()

        return result
开发者ID:Wkasel,项目名称:qooxdoo,代码行数:33,代码来源:Script.py

示例2: createResourceStruct

# 需要导入模块: from misc.ExtMap import ExtMap [as 别名]
# 或者: from misc.ExtMap.ExtMap import items [as 别名]
    def createResourceStruct(resources, formatAsTree=False, updateOnlyExistingSprites=False):
        
        skippatt = re.compile(r'\.(meta|py)$', re.I)
        result = {}
        if formatAsTree:
            result = ExtMap()

        # Filter unwanted files
        for res in resources:
            if skippatt.search(res.path):
                continue
            result[res.id] = res

        # Update simple images
        for combImg in (x for x in result.values() if isinstance(x, CombinedImage)):
            for embImg in combImg.embeds:
                if embImg.id in result:
                    result[embImg.id].attachCombinedImage(combImg)
                elif not updateOnlyExistingSprites:
                    embImg.attachCombinedImage(combImg)
                    result[embImg.id] = embImg

        # Flatten out the resource representation
        for resid, res in result.items():
            result[resid] = res.toResinfo()

            # Unify font map aliases
            if isinstance(res, FontMap):
                for glyphname, code in res.mapping.iteritems():
                  fdsc = "@%s/%s" % (res.alias, glyphname)
                  if not fdsc in result:
                      result[fdsc] = [result[resid][1], round(result[resid][2] / code[1]), code[0]]
                del result[resid][4]

        # ExtMap returns nested maps
        if formatAsTree:
            result = result.getData()

        return result
开发者ID:peuter,项目名称:qooxdoo,代码行数:41,代码来源:Script.py


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