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

Python builders.Builder类代码示例

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

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



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

示例1: init

 def init(self):
     # type: () -> None
     Builder.init(self)
     self.env.set_versioning_method(self.versioning_method,
                                    self.env.config.gettext_uuid)
     self.tags = I18nTags()
     self.catalogs = defaultdict(Catalog)  # type: DefaultDict[unicode, Catalog]
开发者ID:sam-m888,项目名称:sphinx,代码行数:7,代码来源:gettext.py


示例2: finish

 def finish(self):
     Builder.finish(self)
     output_path = path.join(self.config.omegat_translated_path, self.config.language, "LC_MESSAGES")
     ensuredir(output_path)
     sourcedir = path.join(self.config.omegat_project_path, "target")
     for filename in os.listdir(sourcedir):
         if not filename.endswith(".po"):
             continue
         infile = path.join(sourcedir, filename)
         outfile = path.join(output_path, path.splitext(filename)[0] + ".mo")
         if path.exists(outfile):
             if path.getmtime(infile) < path.getmtime(outfile):
                 continue
         self._make(infile, outfile)
开发者ID:capnrefsmmat,项目名称:sphinx-contrib,代码行数:14,代码来源:compiler.py


示例3: init

 def init(self):
     Builder.init(self)
     errors = False
     if not self.config.omegat_translated_path:
         self.info(red("'omegat_translated_path' should not be empty."))
         errors = True
     if not self.config.omegat_project_path:
         self.info(red("'omegat_project_path' should not be empty."))
         errors = True
     if self.config.omegat_translated_path not in self.config.locale_dirs:
         self.info(red("'omegat_translated_path' should be in locale_dirs."))
         errors = True
     if not self.config.language:
         self.info(red("'language' should be set."))
         errors = True
     if errors:
         self.info(red("    -> Please check conf.py"))
         raise RuntimeError("lack setting")
开发者ID:capnrefsmmat,项目名称:sphinx-contrib,代码行数:18,代码来源:compiler.py


示例4: post_process_images

 def post_process_images(self, doctree):
     """Pick the best candidate for an image and link down-scaled images to
     their high res version.
     """
     Builder.post_process_images(self, doctree)
     for node in doctree.traverse(nodes.image):
         scale_keys = ("scale", "width", "height")
         if not any((key in node) for key in scale_keys) or isinstance(node.parent, nodes.reference):
             # docutils does unfortunately not preserve the
             # ``target`` attribute on images, so we need to check
             # the parent node here.
             continue
         uri = node["uri"]
         reference = nodes.reference("", "", internal=True)
         if uri in self.images:
             reference["refuri"] = posixpath.join(self.imgpath, self.images[uri])
         else:
             reference["refuri"] = uri
         node.replace_self(reference)
         reference.append(node)
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:20,代码来源:html.py


示例5: post_process_images

 def post_process_images(self, doctree):
     """Pick the best candidate for an image and link down-scaled images to
     their high res version.
     """
     Builder.post_process_images(self, doctree)
     for node in doctree.traverse(nodes.image):
         if not node.has_key('scale') or \
            isinstance(node.parent, nodes.reference):
             # docutils does unfortunately not preserve the
             # ``target`` attribute on images, so we need to check
             # the parent node here.
             continue
         uri = node['uri']
         reference = nodes.reference('', '', internal=True)
         if uri in self.images:
             reference['refuri'] = posixpath.join(self.imgpath,
                                                  self.images[uri])
         else:
             reference['refuri'] = uri
         node.replace_self(reference)
         reference.append(node)
开发者ID:APSL,项目名称:django-braces,代码行数:21,代码来源:html.py


示例6: init

 def init(self):
     Builder.init(self)
     self.catalogs = defaultdict(Catalog)
开发者ID:amazingCreate,项目名称:sphinx,代码行数:3,代码来源:gettext.py


示例7: post_process_images

 def post_process_images(self, doctree):
     Builder.post_process_images(self, doctree)
开发者ID:chadmv,项目名称:sphinx-confluence,代码行数:2,代码来源:__init__.py


示例8: init

 def init(self):
     # type: () -> None
     Builder.init(self)
     self.tags = I18nTags()
     self.catalogs = defaultdict(Catalog)  # type: defaultdict[unicode, Catalog]
开发者ID:Felix-neko,项目名称:sphinx,代码行数:5,代码来源:gettext.py


示例9: init

 def init(self):
     Builder.init(self)
     self.tags = I18nTags()
     self.catalogs = defaultdict(Catalog)
开发者ID:TimKam,项目名称:sphinx,代码行数:4,代码来源:gettext.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python html.StandaloneHTMLBuilder类代码示例发布时间:2022-05-27
下一篇:
Python application.Sphinx类代码示例发布时间: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