• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python filetool.root函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中misc.filetool.root函数的典型用法代码示例。如果您正苦于以下问题:Python root函数的具体用法?Python root怎么用?Python root使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: loadTemplate

        def loadTemplate(bootCode):
            if bootCode:
                loaderFile = os.path.join(filetool.root(), os.pardir, "data", "generator", "loader-build.tmpl.js")
            else:
                loaderFile = os.path.join(filetool.root(), os.pardir, "data", "generator", "loader-source.tmpl.js")
            template = filetool.read(loaderFile)

            return template
开发者ID:mikegr,项目名称:lectorious-grails-qooxdoo,代码行数:8,代码来源:CodeGenerator.py


示例2: getData

def getData():
    data = os.path.join(filetool.root(), os.pardir, "data", "icon", "qooxdoo.dat")
    lines = filetool.read(data).split("\n")
    result = {}

    for line in lines:
        if line == "" or line.startswith(" ") or line.startswith("#"):
            continue

        if ":" in line:
            alternative = line[line.index(":")+1:].split(",")
            key = line[:line.index(":")]
        else:
            alternative = []
            key = line

        if key in result:
            console.error("Duplicate key found: %s" % key)
            sys.exit(1)

        result[key] = alternative

    # convert to array
    arr = []
    keys = result.keys()
    keys.sort()
    for key in keys:
        tmp = []
        tmp.append(key)
        tmp.extend(result[key])
        arr.append(tmp)

    return arr
开发者ID:dominikg,项目名称:qooxdoo,代码行数:33,代码来源:iconpackager.py


示例3: getLocalizationData

    def getLocalizationData(self, locales):
        self._console.debug("Generating localization data...")
        self._console.indent()

        data = {}
        root = os.path.join(filetool.root(), os.pardir, "data", "cldr", "main")

        newlocales = locales
        for locale in locales:
            if len(locale) > 2 and locale[2] == "_":
              topLevelLocale = locale[0:2]
              if not topLevelLocale in locales:
                self._console.warn("Base locale %s not specified, trying to add it." % topLevelLocale)
                newlocales[:0] = [topLevelLocale]

        for entry in newlocales:
            if entry == "C":
                locale = "en"
            else:
                locale = entry
            locFile = os.path.join(root, "%s.xml" % locale)
            cacheId = "locale-%s-%s" % (root, locale)

            locDat = self._cache.read(cacheId, locFile)
            if locDat == None:
                self._console.debug("Processing locale: %s" % locale)
                locDat = cldr.parseCldrFile(locFile)
                self._cache.write(cacheId, locDat)

            data[entry] = locDat

        self._console.outdent()
        return data
开发者ID:mikegr,项目名称:lectorious-grails-qooxdoo,代码行数:33,代码来源:Locale.py


示例4: runMigration

def runMigration(jobconf, libs):

    if not jobconf.get('migrate-files', False):
        return

    console = Context.console
    console.info("Please heed the warnings from the configuration file parsing")
    console.info("Migrating Javascript source code to most recent qooxdoo version...")
    console.indent()

    migSettings     = jobconf.get('migrate-files')
    shellCmd  = ShellCmd()

    migratorCmd = os.path.join(os.path.dirname(filetool.root()), "bin", "migrator.py")

    libPaths = []
    for lib in libs:
        lib._init_from_manifest() # Lib()'s aren't initialized yet
        libPaths.append(os.path.join(lib.path, lib.classPath))

    mig_opts = []
    if migSettings.get('from-version', False):
        mig_opts.extend(["--from-version", migSettings.get('from-version')])
    if migSettings.get('migrate-html'):
        mig_opts.append("--migrate-html")
    mig_opts.extend(["--class-path", ",".join(libPaths)])

    shcmd = " ".join(textutil.quoteCommandArgs([sys.executable, migratorCmd] + mig_opts))
    console.debug("Invoking migrator as: '%s'" % shcmd)
    shellCmd.execute(shcmd)

    console.outdent()
开发者ID:AaronOpfer,项目名称:qooxdoo,代码行数:32,代码来源:CodeMaintenance.py


示例5: loaderTemplate

 def loaderTemplate(script, compConf):
     templatePath = compConf.get("paths/loader-template", None)
     if not templatePath:
         # use default template
         templatePath = os.path.join(filetool.root(), os.pardir, "data", "generator", "loader.tmpl.js")
     templateCont = filetool.read(templatePath)
     return templateCont, templatePath
开发者ID:MatiasNAmendola,项目名称:meyeOS,代码行数:7,代码来源:CodeGenerator.py


示例6: getLocalizationData

    def getLocalizationData(self, locales):
        self._console.debug("Generating localization data...")
        self._console.indent()

        data = {}
        root = os.path.join(filetool.root(), os.pardir, "data", "cldr", "main")
        for entry in locales:
            if entry == "C":
                locale = "en"
            else:
                locale = entry

            locFile = os.path.join(root, "%s.xml" % locale)
            cacheId = "locale-%s" % locale

            locDat = self._cache.read(cacheId, locFile)
            if locDat == None:
                self._console.debug("Processing locale: %s" % locale)
                locDat = cldr.parseCldrFile(locFile)
                self._cache.write(cacheId, locDat)

            data[entry] = locDat

        self._console.outdent()
        return data
开发者ID:StephanHoyer,项目名称:DJsAdmin,代码行数:25,代码来源:Locale.py


示例7: _checkToolsNewer_1

 def _checkToolsNewer_1(self, path, checkFile, context):
     if not os.path.isfile(checkFile):
         return True
     checkFileMTime = os.stat(checkFile).st_mtime
     # find youngst tool file
     _, toolCheckMTime = filetool.findYoungest(os.path.dirname(filetool.root()))
     # compare
     if checkFileMTime < toolCheckMTime:
         return True
     else:
         return False
开发者ID:reneolivo,项目名称:qooxdoo,代码行数:11,代码来源:Cache.py


示例8: getLocalizationData

    def getLocalizationData(self, locales):
        self._console.debug("Generating localization data...")
        self._console.indent()

        data = {}
        root = os.path.join(filetool.root(), os.pardir, "data", "cldr", "main")
        for entry in locales:
            if entry == "C":
                locale = "en"
            else:
                locale = entry
            self._console.debug("Processing locale: %s" % locale)
            data[entry] = cldr.parseCldrFile(os.path.join(root, "%s.xml" % locale))

        self._console.outdent()
        return data
开发者ID:eean,项目名称:webrok,代码行数:16,代码来源:Locale.py


示例9: getLocalizationData

    def getLocalizationData(self, classList, targetLocales, ):
        self._console.debug("Generating localization data...")
        data = {}

        # check need for cldr data in this classlist
        need_cldr = False
        for clazz in classList:
            if clazz.getHints('cldr'):
                need_cldr = True
                break

        # early return
        if not need_cldr:
            return data


        # else collect cldr data
        self._console.indent()
        root = os.path.join(filetool.root(), os.pardir, "data", "cldr", "main")

        newlocales = targetLocales
        for locale in targetLocales:
            if len(locale) > 2 and locale[2] == "_":
              topLevelLocale = locale[0:2]
              if not topLevelLocale in targetLocales:
                self._console.warn("Base locale %s not specified, trying to add it." % topLevelLocale)
                newlocales[:0] = [topLevelLocale]

        for entry in newlocales:
            if entry == "C":
                locale = "en"
            else:
                locale = entry
            locFile = os.path.join(root, "%s.xml" % locale)
            cacheId = "locale-%s-%s" % (root, locale)

            locDat, _ = self._cache.read(cacheId, locFile)
            if locDat == None:
                self._console.debug("Processing locale: %s" % locale)
                locDat = cldr.parseCldrFile(locFile)
                self._cache.write(cacheId, locDat)

            data[entry] = locDat

        self._console.outdent()
        return data
开发者ID:reneolivo,项目名称:qooxdoo,代码行数:46,代码来源:Locale.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python filetool.save函数代码示例发布时间:2022-05-27
下一篇:
Python filetool.read函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap