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


Python builders.Builder類代碼示例

本文整理匯總了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;未經允許,請勿轉載。