當前位置: 首頁>>代碼示例>>Python>>正文


Python ExtMap.getData方法代碼示例

本文整理匯總了Python中misc.ExtMap.ExtMap.getData方法的典型用法代碼示例。如果您正苦於以下問題:Python ExtMap.getData方法的具體用法?Python ExtMap.getData怎麽用?Python ExtMap.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc.ExtMap.ExtMap的用法示例。


在下文中一共展示了ExtMap.getData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: createResourceStruct

# 需要導入模塊: from misc.ExtMap import ExtMap [as 別名]
# 或者: from misc.ExtMap.ExtMap import getData [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 getData [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.getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。