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


Python Class.optimizeEnvironmentClass方法代码示例

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


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

示例1: classlistFromClassRecursive

# 需要导入模块: from generator.code.Class import Class [as 别名]
# 或者: from generator.code.Class.Class import optimizeEnvironmentClass [as 别名]
                    # calculate dependencies and add required classes
                    classlistFromClassRecursive(depsItem, excludeWithDeps, variants, result, warn_deps, [], allowBlockLoaddeps)
                    #classlistFromClassIterative(depsItem, excludeWithDeps, variants, result, warn_deps, [], allowBlockLoaddeps)

                self._console.dotclear()
                #print len(result),"  ",

                # process qx.core.Environment
                if ("qx.core.Environment" in resultNames 
                    and "variants" in script.optimize
                    and not processedEnvironment):
                    envObj = self._classesObj["qx.core.Environment"]
                    envTreeId = "tree-%s-%s" % (envObj.path, util.toString({})) # TODO: {} is a temp. hack
                    compOpts = CompileOptions(optimize=[], variants=variants)
                    compOpts.allClassVariants = script.classVariants([self._classesObj[x] for x in resultNames])
                    tree = Class.optimizeEnvironmentClass(envObj, compOpts)
                    self._cache.write(envTreeId, tree, memory=True, writeToFile=False)
                    # this is for the side-effect of leaving a modified tree for qx.core.Environmet
                    # in the cache!
                    _ = envObj.dependencies(variants, force=True)
                    # this is for the side-effect of re-calculating the transitive dependencies
                    # of qx.core.Environment!
                    processedEnvironment = True
                else:
                    # We currently know that one additional iteration is enough,
                    # after optimizeEnvironmentClass() has run. This has to do
                    # with the fact that it only removes dependencies to
                    # qx.bom.client.* classes, which in turn do not use
                    # qx.core.Env calls. So after calculating the new class
                    # list, allClassVariants will not have changed. If it would,
                    # we would need to re-calculate until the class list is
开发者ID:MatiasNAmendola,项目名称:meyeOS,代码行数:33,代码来源:DependencyLoader.py

示例2: optimizeEnvironmentClass

# 需要导入模块: from generator.code.Class import Class [as 别名]
# 或者: from generator.code.Class.Class import optimizeEnvironmentClass [as 别名]
 def optimizeEnvironmentClass(envClass, compConf):
     assert envClass.id == "qx.core.Environment"
     tree = Class.optimizeEnvironmentClass(envClass, compConf)
     code = Packer().serializeNode(tree, None, [u''], compConf.format)
     code = u''.join(code)
     return code
开发者ID:MatiasNAmendola,项目名称:meyeOS,代码行数:8,代码来源:CodeGenerator.py


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