summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/builders/__init__.py1
-rw-r--r--sphinx/builders/devhelp.py5
-rw-r--r--sphinx/builders/epub.py61
-rw-r--r--sphinx/builders/gettext.py9
-rw-r--r--sphinx/builders/html.py37
-rw-r--r--sphinx/builders/htmlhelp.py11
-rw-r--r--sphinx/builders/latex.py8
-rw-r--r--sphinx/builders/manpage.py2
-rw-r--r--sphinx/builders/qthelp.py31
-rw-r--r--sphinx/builders/texinfo.py7
-rw-r--r--sphinx/builders/xml.py1
11 files changed, 90 insertions, 83 deletions
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py
index 2a28fd1c4..996a8c6a5 100644
--- a/sphinx/builders/__init__.py
+++ b/sphinx/builders/__init__.py
@@ -19,7 +19,6 @@ except ImportError:
multiprocessing = threading = None
from docutils import nodes
-from six import string_types
from sphinx.util import i18n, path_stabilize
from sphinx.util.osutil import SEP, relative_uri, find_catalog
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py
index 8e334b3f6..e6199e621 100644
--- a/sphinx/builders/devhelp.py
+++ b/sphinx/builders/devhelp.py
@@ -33,6 +33,7 @@ except ImportError:
try:
import gzip
+
def comp_open(filename, mode='rb'):
return gzip.open(filename + '.gz', mode)
except ImportError:
@@ -81,7 +82,7 @@ class DevhelpBuilder(StandaloneHTMLBuilder):
def write_toc(node, parent):
if isinstance(node, addnodes.compact_paragraph) or \
- isinstance(node, nodes.bullet_list):
+ isinstance(node, nodes.bullet_list):
for subnode in node:
write_toc(subnode, parent)
elif isinstance(node, nodes.list_item):
@@ -94,7 +95,7 @@ class DevhelpBuilder(StandaloneHTMLBuilder):
def istoctree(node):
return isinstance(node, addnodes.compact_paragraph) and \
- 'toctree' in node
+ 'toctree' in node
for node in tocdoc.traverse(istoctree):
write_toc(node, chapters)
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
index 9b0c34c49..cdcfed2b7 100644
--- a/sphinx/builders/epub.py
+++ b/sphinx/builders/epub.py
@@ -40,7 +40,7 @@ from sphinx.util.console import brown
# output but that may be customized by (re-)setting module attributes,
# e.g. from conf.py.
-_mimetype_template = 'application/epub+zip' # no EOL!
+_mimetype_template = 'application/epub+zip' # no EOL!
_container_template = u'''\
<?xml version="1.0" encoding="UTF-8"?>
@@ -221,10 +221,10 @@ class EpubBuilder(StandaloneHTMLBuilder):
if isinstance(doctree, nodes.reference) and 'refuri' in doctree:
refuri = doctree['refuri']
if refuri.startswith('http://') or refuri.startswith('https://') \
- or refuri.startswith('irc:') or refuri.startswith('mailto:'):
+ or refuri.startswith('irc:') or refuri.startswith('mailto:'):
return result
classes = doctree.parent.attributes['classes']
- for level in range(8, 0, -1): # or range(1, 8)?
+ for level in range(8, 0, -1): # or range(1, 8)?
if (_toctree_template % level) in classes:
result.append({
'level': level,
@@ -242,11 +242,12 @@ class EpubBuilder(StandaloneHTMLBuilder):
and pre and post files not managed by sphinx.
"""
doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
- self, prune_toctrees=False, includehidden=True)
+ self, prune_toctrees=False,
+ includehidden=True)
self.refnodes = self.get_refnodes(doctree, [])
master_dir = path.dirname(self.config.master_doc)
if master_dir:
- master_dir += '/' # XXX or os.sep?
+ master_dir += '/' # XXX or os.sep?
for item in self.refnodes:
item['refuri'] = master_dir + item['refuri']
self.toc_add_files(self.refnodes)
@@ -258,7 +259,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
'level': 1,
'refuri': self.esc(self.config.master_doc + '.html'),
'text': ssp(self.esc(
- self.env.titles[self.config.master_doc].astext()))
+ self.env.titles[self.config.master_doc].astext()))
})
for file, text in reversed(self.config.epub_pre_files):
refnodes.insert(0, {
@@ -392,7 +393,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
m = _refuri_re.match(link)
if m:
subentrylinks[i] = (ismain,
- self.fix_fragment(m.group(1), m.group(2)))
+ self.fix_fragment(m.group(1), m.group(2)))
def is_vector_graphics(self, filename):
"""Does the filename extension indicate a vector graphic format?"""
@@ -461,8 +462,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
if pagename.startswith('genindex'):
self.fix_genindex(addctx['genindexentries'])
StandaloneHTMLBuilder.handle_page(self, pagename, addctx, templatename,
- outfilename, event_arg)
-
+ outfilename, event_arg)
# Finish by building the epub file
def handle_finish(self):
@@ -529,9 +529,9 @@ class EpubBuilder(StandaloneHTMLBuilder):
olen = len(outdir)
projectfiles = []
self.files = []
- self.ignored_files = ['.buildinfo',
- 'mimetype', 'content.opf', 'toc.ncx', 'META-INF/container.xml',
- self.config.epub_basename + '.epub'] + \
+ self.ignored_files = ['.buildinfo', 'mimetype', 'content.opf',
+ 'toc.ncx', 'META-INF/container.xml',
+ self.config.epub_basename + '.epub'] + \
self.config.epub_exclude_files
for root, dirs, files in os.walk(outdir):
for fn in files:
@@ -579,7 +579,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
image, html_tmpl = self.config.epub_cover
image = image.replace(os.sep, '/')
mpos = content_tmpl.rfind('</metadata>')
- cpos = content_tmpl.rfind('\n', 0 , mpos) + 1
+ cpos = content_tmpl.rfind('\n', 0, mpos) + 1
content_tmpl = content_tmpl[:cpos] + \
_cover_template % {'cover': self.esc(self.make_id(image))} + \
content_tmpl[cpos:]
@@ -596,7 +596,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
})
ctx = {'image': self.esc(image), 'title': self.config.project}
self.handle_page(
- path.splitext(_coverpage_name)[0], ctx, html_tmpl)
+ path.splitext(_coverpage_name)[0], ctx, html_tmpl)
guide = []
auto_add_cover = True
@@ -611,22 +611,22 @@ class EpubBuilder(StandaloneHTMLBuilder):
if type == 'toc':
auto_add_toc = False
guide.append(_guide_template % {
- 'type': self.esc(type),
- 'title': self.esc(title),
- 'uri': self.esc(uri)
- })
+ 'type': self.esc(type),
+ 'title': self.esc(title),
+ 'uri': self.esc(uri)
+ })
if auto_add_cover and html_tmpl:
guide.append(_guide_template % {
- 'type': 'cover',
- 'title': _guide_titles['cover'],
- 'uri': self.esc(_coverpage_name)
- })
+ 'type': 'cover',
+ 'title': _guide_titles['cover'],
+ 'uri': self.esc(_coverpage_name)
+ })
if auto_add_toc and self.refnodes:
guide.append(_guide_template % {
- 'type': 'toc',
- 'title': _guide_titles['toc'],
- 'uri': self.esc(self.refnodes[0]['refuri'])
- })
+ 'type': 'toc',
+ 'title': _guide_titles['toc'],
+ 'uri': self.esc(self.refnodes[0]['refuri'])
+ })
projectfiles = '\n'.join(projectfiles)
spine = '\n'.join(spine)
guide = '\n'.join(guide)
@@ -635,7 +635,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
f = codecs.open(path.join(outdir, outname), 'w', 'utf-8')
try:
f.write(content_tmpl %
- self.content_metadata(projectfiles, spine, guide))
+ self.content_metadata(projectfiles, spine, guide))
finally:
f.close()
@@ -719,7 +719,8 @@ class EpubBuilder(StandaloneHTMLBuilder):
if self.config.epub_tocscope == 'default':
doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
- self, prune_toctrees=False, includehidden=False)
+ self, prune_toctrees=False,
+ includehidden=False)
refnodes = self.get_refnodes(doctree, [])
self.toc_add_files(refnodes)
else:
@@ -744,9 +745,9 @@ class EpubBuilder(StandaloneHTMLBuilder):
projectfiles = ['META-INF/container.xml', 'content.opf', 'toc.ncx'] \
+ self.files
epub = zipfile.ZipFile(path.join(outdir, outname), 'w',
- zipfile.ZIP_DEFLATED)
+ zipfile.ZIP_DEFLATED)
epub.write(path.join(outdir, 'mimetype'), 'mimetype',
- zipfile.ZIP_STORED)
+ zipfile.ZIP_STORED)
for file in projectfiles:
fp = path.join(outdir, file)
epub.write(fp, file, zipfile.ZIP_DEFLATED)
diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py
index 63beb4941..c23675d36 100644
--- a/sphinx/builders/gettext.py
+++ b/sphinx/builders/gettext.py
@@ -130,6 +130,7 @@ timestamp = time()
tzdelta = datetime.fromtimestamp(timestamp) - \
datetime.utcfromtimestamp(timestamp)
+
class LocalTimeZone(tzinfo):
def __init__(self, *args, **kw):
@@ -213,8 +214,8 @@ class MessageCatalogBuilder(I18nBuilder):
if self.config.gettext_location:
# generate "#: file1:line1\n#: file2:line2 ..."
- pofile.write("#: %s\n" % "\n#: ".join("%s:%s" %
- (safe_relpath(source, self.outdir), line)
+ pofile.write("#: %s\n" % "\n#: ".join(
+ "%s:%s" % (safe_relpath(source, self.outdir), line)
for source, line, _ in positions))
if self.config.gettext_uuid:
# generate "# uuid1\n# uuid2\n ..."
@@ -223,8 +224,8 @@ class MessageCatalogBuilder(I18nBuilder):
# message contains *one* line of text ready for translation
message = message.replace('\\', r'\\'). \
- replace('"', r'\"'). \
- replace('\n', '\\n"\n"')
+ replace('"', r'\"'). \
+ replace('\n', '\\n"\n"')
pofile.write('msgid "%s"\nmsgstr ""\n\n' % message)
finally:
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index e60eb3a0a..3a617bb67 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -78,7 +78,7 @@ class StandaloneHTMLBuilder(Builder):
searchindex_filename = 'searchindex.js'
add_permalinks = True
embedded = False # for things like HTML help or Qt help: suppresses sidebar
- search = True # for things like HTML help and Apple help: suppress search
+ search = True # for things like HTML help and Apple help: suppress search
# This is a class attribute because it is mutated by Sphinx.add_javascript.
script_files = ['_static/jquery.js', '_static/underscore.js',
@@ -194,7 +194,7 @@ class StandaloneHTMLBuilder(Builder):
except Exception:
pass
if old_config_hash != self.config_hash or \
- old_tags_hash != self.tags_hash:
+ old_tags_hash != self.tags_hash:
for docname in self.env.found_docs:
yield docname
return
@@ -230,8 +230,8 @@ class StandaloneHTMLBuilder(Builder):
if self._publisher is None:
self._publisher = Publisher(
- source_class = DocTreeInput,
- destination_class=StringOutput)
+ source_class = DocTreeInput,
+ destination_class=StringOutput)
self._publisher.set_components('standalone',
'restructuredtext', 'pseudoxml')
@@ -280,7 +280,7 @@ class StandaloneHTMLBuilder(Builder):
continue
# deprecated config value
if indexname == 'py-modindex' and \
- not self.config.html_use_modindex:
+ not self.config.html_use_modindex:
continue
content, collapse = indexcls(domain).generate()
if content:
@@ -296,10 +296,10 @@ class StandaloneHTMLBuilder(Builder):
self.last_updated = None
logo = self.config.html_logo and \
- path.basename(self.config.html_logo) or ''
+ path.basename(self.config.html_logo) or ''
favicon = self.config.html_favicon and \
- path.basename(self.config.html_favicon) or ''
+ path.basename(self.config.html_favicon) or ''
if favicon and os.path.splitext(favicon)[1] != '.ico':
self.warn('html_favicon is not an .ico file')
@@ -394,8 +394,9 @@ class StandaloneHTMLBuilder(Builder):
pass
related = self.relations.get(related[0])
if parents:
- parents.pop() # remove link to the master file; we have a generic
- # "back to index" link already
+ # remove link to the master file; we have a generic
+ # "back to index" link already
+ parents.pop()
parents.reverse()
# title rendered as HTML
@@ -505,7 +506,7 @@ class StandaloneHTMLBuilder(Builder):
# the entries into two columns
genindex = self.env.create_index(self)
indexcounts = []
- for _, entries in genindex:
+ for _k, entries in genindex:
indexcounts.append(sum(1 + len(subitems)
for _, (_, subitems) in entries))
@@ -821,8 +822,7 @@ class StandaloneHTMLBuilder(Builder):
u'# Project: %s\n'
u'# Version: %s\n'
u'# The remainder of this file is compressed using zlib.\n'
- % (self.config.project, self.config.version)
- ).encode('utf-8'))
+ % (self.config.project, self.config.version)).encode('utf-8'))
compressor = zlib.compressobj(9)
for domainname, domain in iteritems(self.env.domains):
for name, dispname, type, docname, anchor, prio in \
@@ -835,8 +835,7 @@ class StandaloneHTMLBuilder(Builder):
dispname = u'-'
f.write(compressor.compress(
(u'%s %s:%s %s %s %s\n' % (name, domainname, type,
- prio, uri, dispname)
- ).encode('utf-8')))
+ prio, uri, dispname)).encode('utf-8')))
f.write(compressor.flush())
finally:
f.close()
@@ -874,13 +873,13 @@ class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
if docname == 'index':
return ''
if docname.endswith(SEP + 'index'):
- return docname[:-5] # up to sep
+ return docname[:-5] # up to sep
return docname + SEP
def get_outfilename(self, pagename):
if pagename == 'index' or pagename.endswith(SEP + 'index'):
- outfilename = path.join(self.outdir, os_path(pagename)
- + self.out_suffix)
+ outfilename = path.join(self.outdir, os_path(pagename) +
+ self.out_suffix)
else:
outfilename = path.join(self.outdir, os_path(pagename),
'index' + self.out_suffix)
@@ -907,7 +906,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
if docname in self.env.all_docs:
# all references are on the same page...
return self.config.master_doc + self.out_suffix + \
- '#document-' + docname
+ '#document-' + docname
else:
# chances are this is a html_additional_page
return docname + self.out_suffix
@@ -1053,7 +1052,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
if docname == 'index':
return ''
if docname.endswith(SEP + 'index'):
- return docname[:-5] # up to sep
+ return docname[:-5] # up to sep
return docname + SEP
def dump_context(self, context, filename):
diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py
index 8085ee145..9a21fb15b 100644
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -191,7 +191,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
def open_file(self, outdir, basename, mode='w'):
# open a file with the correct encoding for the selected language
return codecs.open(path.join(outdir, basename), mode,
- self.encoding, 'xmlcharrefreplace')
+ self.encoding, 'xmlcharrefreplace')
def handle_finish(self):
self.build_hhx(self.outdir, self.config.htmlhelp_basename)
@@ -220,7 +220,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
staticdir = root.startswith(path.join(outdir, '_static'))
for fn in files:
if (staticdir and not fn.endswith('.js')) or \
- fn.endswith('.html'):
+ fn.endswith('.html'):
print(path.join(root, fn)[olen:].replace(os.sep, '\\'),
file=f)
finally:
@@ -239,6 +239,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
# the TOC
tocdoc = self.env.get_and_resolve_doctree(
self.config.master_doc, self, prune_toctrees=False)
+
def write_toc(node, ullevel=0):
if isinstance(node, nodes.list_item):
f.write('<LI> ')
@@ -246,7 +247,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
write_toc(subnode, ullevel)
elif isinstance(node, nodes.reference):
link = node['refuri']
- title = htmlescape(node.astext()).replace('"','&quot;')
+ title = htmlescape(node.astext()).replace('"', '&quot;')
f.write(object_sitemap % (title, link))
elif isinstance(node, nodes.bullet_list):
if ullevel != 0:
@@ -258,9 +259,10 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
elif isinstance(node, addnodes.compact_paragraph):
for subnode in node:
write_toc(subnode, ullevel)
+
def istoctree(node):
return isinstance(node, addnodes.compact_paragraph) and \
- 'toctree' in node
+ 'toctree' in node
for node in tocdoc.traverse(istoctree):
write_toc(node)
f.write(contents_footer)
@@ -272,6 +274,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
f = self.open_file(outdir, outname+'.hhk')
try:
f.write('<UL>\n')
+
def write_index(title, refs, subitems):
def write_param(name, value):
item = ' <param name="%s" value="%s">\n' % \
diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py
index ee3f0bb7e..f0c1d3a7c 100644
--- a/sphinx/builders/latex.py
+++ b/sphinx/builders/latex.py
@@ -45,7 +45,7 @@ class LaTeXBuilder(Builder):
texescape.init()
def get_outdated_docs(self):
- return 'all documents' # for now
+ return 'all documents' # for now
def get_target_uri(self, docname, typ=None):
if docname not in self.docnames:
@@ -94,9 +94,9 @@ class LaTeXBuilder(Builder):
destination_path=path.join(self.outdir, targetname),
encoding='utf-8')
self.info("processing " + targetname + "... ", nonl=1)
- doctree = self.assemble_doctree(docname, toctree_only,
- appendices=((docclass != 'howto') and
- self.config.latex_appendices or []))
+ doctree = self.assemble_doctree(
+ docname, toctree_only,
+ appendices=((docclass != 'howto') and self.config.latex_appendices or []))
self.post_process_images(doctree)
self.info("writing... ", nonl=1)
doctree.settings = docsettings
diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py
index 0745f6e60..0176621f5 100644
--- a/sphinx/builders/manpage.py
+++ b/sphinx/builders/manpage.py
@@ -37,7 +37,7 @@ class ManualPageBuilder(Builder):
'will be written')
def get_outdated_docs(self):
- return 'all manpages' # for now
+ return 'all manpages' # for now
def get_target_uri(self, docname, typ=None):
if typ == 'token':
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index 4d13dd4fa..825f5651f 100644
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -111,7 +111,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
StandaloneHTMLBuilder.init(self)
# the output files for HTML help must be .html only
self.out_suffix = '.html'
- #self.config.html_style = 'traditional.css'
+ # self.config.html_style = 'traditional.css'
def handle_finish(self):
self.build_qhp(self.outdir, self.config.qthelp_basename)
@@ -122,9 +122,10 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
# sections
tocdoc = self.env.get_and_resolve_doctree(self.config.master_doc, self,
prune_toctrees=False)
- istoctree = lambda node: (
- isinstance(node, addnodes.compact_paragraph)
- and 'toctree' in node)
+
+ def istoctree(node):
+ return isinstance(node, addnodes.compact_paragraph) and \
+ 'toctree' in node
sections = []
for node in tocdoc.traverse(istoctree):
sections.extend(self.write_toc(node))
@@ -160,10 +161,10 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
imagesdir = path.join(outdir, self.imagedir)
for root, dirs, files in os.walk(outdir):
resourcedir = root.startswith(staticdir) or \
- root.startswith(imagesdir)
+ root.startswith(imagesdir)
for fn in files:
if (resourcedir and not fn.endswith('.js')) or \
- fn.endswith('.html'):
+ fn.endswith('.html'):
filename = path.join(root, fn)[olen:]
projectfiles.append(file_template %
{'filename': htmlescape(filename)})
@@ -239,7 +240,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
parts.extend(self.write_toc(subnode, indentlevel))
elif isinstance(node, nodes.reference):
link = node['refuri']
- title = htmlescape(node.astext()).replace('"','&quot;')
+ title = htmlescape(node.astext()).replace('"', '&quot;')
item = section_template % {'title': title, 'ref': link}
item = u' ' * 4 * indentlevel + item
parts.append(item.encode('ascii', 'xmlcharrefreplace'))
@@ -258,7 +259,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
groupdict = matchobj.groupdict()
shortname = groupdict['title']
id = groupdict.get('id')
- #descr = groupdict.get('descr')
+ # descr = groupdict.get('descr')
if shortname.endswith('()'):
shortname = shortname[:-2]
id = '%s.%s' % (id, shortname)
@@ -277,17 +278,17 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
keywords = []
title = htmlescape(title)
-# if len(refs) == 0: # XXX
-# write_param('See Also', title)
+ # if len(refs) == 0: # XXX
+ # write_param('See Also', title)
if len(refs) == 1:
keywords.append(self.keyword_item(title, refs[0]))
elif len(refs) > 1:
for i, ref in enumerate(refs): # XXX
-# item = (' '*12 +
-# '<keyword name="%s [%d]" ref="%s"/>' % (
-# title, i, ref))
-# item.encode('ascii', 'xmlcharrefreplace')
-# keywords.append(item)
+ # item = (' '*12 +
+ # '<keyword name="%s [%d]" ref="%s"/>' % (
+ # title, i, ref))
+ # item.encode('ascii', 'xmlcharrefreplace')
+ # keywords.append(item)
keywords.append(self.keyword_item(title, ref))
if subitems:
diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py
index cdabeb3a8..3adeec404 100644
--- a/sphinx/builders/texinfo.py
+++ b/sphinx/builders/texinfo.py
@@ -88,14 +88,14 @@ class TexinfoBuilder(Builder):
name = 'texinfo'
format = 'texinfo'
supported_image_types = ['image/png', 'image/jpeg',
- 'image/gif',]
+ 'image/gif']
def init(self):
self.docnames = []
self.document_data = []
def get_outdated_docs(self):
- return 'all documents' # for now
+ return 'all documents' # for now
def get_target_uri(self, docname, typ=None):
if docname not in self.docnames:
@@ -141,7 +141,8 @@ class TexinfoBuilder(Builder):
destination_path=path.join(self.outdir, targetname),
encoding='utf-8')
self.info("processing " + targetname + "... ", nonl=1)
- doctree = self.assemble_doctree(docname, toctree_only,
+ doctree = self.assemble_doctree(
+ docname, toctree_only,
appendices=(self.config.texinfo_appendices or []))
self.info("writing... ", nonl=1)
self.post_process_images(doctree)
diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py
index 44ced5419..18d8cbfb5 100644
--- a/sphinx/builders/xml.py
+++ b/sphinx/builders/xml.py
@@ -19,6 +19,7 @@ from sphinx.builders import Builder
from sphinx.util.osutil import ensuredir, os_path
from sphinx.writers.xml import XMLWriter, PseudoXMLWriter
+
class XMLBuilder(Builder):
"""
Builds Docutils-native XML.