diff options
-rw-r--r-- | sphinx/addnodes.py | 2 | ||||
-rw-r--r-- | sphinx/apidoc.py | 1 | ||||
-rw-r--r-- | sphinx/builders/gettext.py | 1 | ||||
-rw-r--r-- | sphinx/builders/html.py | 1 | ||||
-rw-r--r-- | sphinx/directives/__init__.py | 1 | ||||
-rw-r--r-- | sphinx/ext/autodoc.py | 1 | ||||
-rw-r--r-- | sphinx/locale/__init__.py | 1 | ||||
-rw-r--r-- | sphinx/pycode/__init__.py | 2 | ||||
-rw-r--r-- | sphinx/quickstart.py | 2 | ||||
-rw-r--r-- | sphinx/util/__init__.py | 1 | ||||
-rw-r--r-- | sphinx/util/console.py | 1 | ||||
-rw-r--r-- | sphinx/util/i18n.py | 1 | ||||
-rw-r--r-- | sphinx/util/nodes.py | 1 | ||||
-rw-r--r-- | sphinx/util/pycompat.py | 1 | ||||
-rw-r--r-- | sphinx/util/smartypants.py | 2 | ||||
-rwxr-xr-x | utils/reindent.py | 1 |
16 files changed, 19 insertions, 1 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 9b16f865e..4035faa2d 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -95,6 +95,8 @@ class desc_signature_line(nodes.Part, nodes.Inline, nodes.TextElement): class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement): """Node for additional name parts (module name, class name).""" + + # compatibility alias desc_classname = desc_addname diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 05928be81..d4793ff4d 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -402,6 +402,7 @@ Note: By default this script will not overwrite already created files.""") elif not opts.notoc: create_modules_toc_file(modules, opts) + # So program can be started with "python -m sphinx.apidoc ..." if __name__ == "__main__": main() diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index bc74f7177..e118cde99 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -162,6 +162,7 @@ class LocalTimeZone(tzinfo): def dst(self, dt): return timedelta(0) + ltz = LocalTimeZone() diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index ef816364e..e13d752d7 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -1177,6 +1177,7 @@ class PickleHTMLBuilder(SerializingHTMLBuilder): globalcontext_filename = 'globalcontext.pickle' searchindex_filename = 'searchindex.pickle' + # compatibility alias WebHTMLBuilder = PickleHTMLBuilder diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 0e712f85f..76b54f9d6 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -167,6 +167,7 @@ class ObjectDescription(Directive): self.after_content() return [self.indexnode, node] + # backwards compatible old name DescDirective = ObjectDescription diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 20f4cee0b..59e585678 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -141,6 +141,7 @@ def members_set_option(arg): return ALL return set(x.strip() for x in arg.split(',')) + SUPPRESS = object() diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index d2d08c628..d6ce7329b 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -152,6 +152,7 @@ def lazy_gettext(string): # return string return _TranslationProxy(mygettext, string) + l_ = lazy_gettext diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 7353eacdc..baf5c0068 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -35,6 +35,8 @@ pydriver = driver.Driver(pygrammar, convert=nodes.convert) # an object with attributes corresponding to token and symbol names class sym(object): pass + + for k, v in iteritems(pygrammar.symbol2number): setattr(sym, k, v) for k, v in iteritems(token.tok_name): diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 00449b988..3c7ab3d97 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -485,6 +485,7 @@ def usage(argv, msg=None): print(msg, file=sys.stderr) print(file=sys.stderr) + USAGE = """\ Sphinx v%s Usage: %%prog [options] [projectdir] @@ -675,5 +676,6 @@ def main(argv=sys.argv): generate(d, templatedir=opts.templatedir) + if __name__ == '__main__': sys.exit(main(sys.argv)) diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index a383ba5ae..7ac5c62f7 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -170,6 +170,7 @@ def copy_static_entry(source, targetdir, builder, context={}, builder, context, level=level+1, exclude_matchers=exclude_matchers) + _DEBUG_HEADER = '''\ # Sphinx version: %s # Python version: %s (%s) diff --git a/sphinx/util/console.py b/sphinx/util/console.py index 7974ebb2b..593634b11 100644 --- a/sphinx/util/console.py +++ b/sphinx/util/console.py @@ -90,6 +90,7 @@ def create_color_func(name): return colorize(name, text) globals()[name] = inner + _attrs = { 'reset': '39;49;00m', 'bold': '01m', diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index 446925cdb..112353d47 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -125,6 +125,7 @@ def find_catalog_source_files(locale_dirs, locale, domains=None, gettext_compact return catalogs + # date_format mappings: ustrftime() to bable.dates.format_datetime() date_format_mappings = { '%a': 'EEE', # Weekday as locale’s abbreviated name. diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index 2b899afce..fe3b0f2f9 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -351,4 +351,5 @@ def _new_copy(self): newnode.line = self.line return newnode + nodes.Element.copy = _new_copy diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 6ff5e3567..e3b17ef62 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -144,6 +144,7 @@ class _DeprecationWrapper(object): return self._deprecated[attr] return getattr(self._mod, attr) + sys.modules[__name__] = _DeprecationWrapper(sys.modules[__name__], dict( zip_longest = zip_longest, product = product, diff --git a/sphinx/util/smartypants.py b/sphinx/util/smartypants.py index 2f4acbc8d..dee2f50ba 100644 --- a/sphinx/util/smartypants.py +++ b/sphinx/util/smartypants.py @@ -81,8 +81,8 @@ def sphinx_smarty_pants(t): t = t.replace('"', '"') return t -# Constants for quote education. +# Constants for quote education. punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]""" end_of_word_class = r"""[\s.,;:!?)]""" close_class = r"""[^\ \t\r\n\[\{\(\-]""" diff --git a/utils/reindent.py b/utils/reindent.py index ee13a634a..a4fe93e24 100755 --- a/utils/reindent.py +++ b/utils/reindent.py @@ -315,5 +315,6 @@ def getlspace(line): i += 1 return i + if __name__ == '__main__': main() |