Hello community,
here is the log from the commit of package python-sphinxcontrib-httpdomain for
openSUSE:Factory checked in at 2013-10-21 20:02:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-httpdomain (Old)
and /work/SRC/openSUSE:Factory/.python-sphinxcontrib-httpdomain.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sphinxcontrib-httpdomain"
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-sphinxcontrib-httpdomain/python-sphinxcontrib-httpdomain.changes
2013-08-13 13:21:28.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python-sphinxcontrib-httpdomain.new/python-sphinxcontrib-httpdomain.changes
2013-10-21 20:02:16.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Oct 21 13:32:04 UTC 2013 - [email protected]
+
+- update to 1.2.0:
+ * Add tornado support
+
+-------------------------------------------------------------------
Old:
----
sphinxcontrib-httpdomain-1.1.9.tar.gz
New:
----
sphinxcontrib-httpdomain-1.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-sphinxcontrib-httpdomain.spec ++++++
--- /var/tmp/diff_new_pack.N1t0ll/_old 2013-10-21 20:02:17.000000000 +0200
+++ /var/tmp/diff_new_pack.N1t0ll/_new 2013-10-21 20:02:17.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-sphinxcontrib-httpdomain
-Version: 1.1.9
+Version: 1.2.0
Release: 0
Summary: Sphinx domain for HTTP APIs
License: BSD-2-Clause
++++++ sphinxcontrib-httpdomain-1.1.9.tar.gz ->
sphinxcontrib-httpdomain-1.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-httpdomain-1.1.9/PKG-INFO
new/sphinxcontrib-httpdomain-1.2.0/PKG-INFO
--- old/sphinxcontrib-httpdomain-1.1.9/PKG-INFO 2013-08-07 18:26:56.000000000
+0200
+++ new/sphinxcontrib-httpdomain-1.2.0/PKG-INFO 2013-10-19 09:45:53.000000000
+0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: sphinxcontrib-httpdomain
-Version: 1.1.9
+Version: 1.2.0
Summary: Sphinx domain for HTTP APIs
Home-page: http://bitbucket.org/birkenfeld/sphinx-contrib
Author: Hong Minhee
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-httpdomain-1.1.9/setup.py
new/sphinxcontrib-httpdomain-1.2.0/setup.py
--- old/sphinxcontrib-httpdomain-1.1.9/setup.py 2013-04-16 22:42:36.000000000
+0200
+++ new/sphinxcontrib-httpdomain-1.2.0/setup.py 2013-08-07 20:24:15.000000000
+0200
@@ -15,7 +15,7 @@
setup(
name='sphinxcontrib-httpdomain',
- version='1.1.9',
+ version='1.2.0',
url='http://bitbucket.org/birkenfeld/sphinx-contrib',
download_url='http://pypi.python.org/pypi/sphinxcontrib-httpdomain',
license='BSD',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib/autohttp/tornado.py
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib/autohttp/tornado.py
--- old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib/autohttp/tornado.py
1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib/autohttp/tornado.py
2013-10-19 09:41:10.000000000 +0200
@@ -0,0 +1,133 @@
+"""
+ sphinxcontrib.autohttp.tornado
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ The sphinx.ext.autodoc-style HTTP API reference builder (from Tornado)
+ for sphinxcontrib.httpdomain.
+
+ :copyright: Copyright 2013 by Rodrigo Machado
+ :license: BSD, see LICENSE for details.
+
+"""
+
+import inspect
+import re
+try:
+ import cStringIO as StringIO
+except ImportError:
+ import StringIO
+
+from docutils import nodes
+from docutils.parsers.rst import directives
+from docutils.statemachine import ViewList
+
+from sphinx.util import force_decode
+from sphinx.util.compat import Directive
+from sphinx.util.nodes import nested_parse_with_titles
+from sphinx.util.docstrings import prepare_docstring
+from sphinx.pycode import ModuleAnalyzer
+
+from sphinxcontrib import httpdomain
+from sphinxcontrib.autohttp.common import http_directive, import_object
+
+
+def translate_tornado_rule(app, rule):
+ buf = StringIO.StringIO()
+ for name, filter, conf in app.router.parse_rule(rule):
+ if filter:
+ buf.write('(')
+ buf.write(name)
+ if filter != app.router.default_filter or conf:
+ buf.write(':')
+ buf.write(filter)
+ if conf:
+ buf.write(':')
+ buf.write(conf)
+ buf.write(')')
+ else:
+ buf.write(name)
+ return buf.getvalue()
+
+
+def get_routes(app):
+ for spec in app.handlers[0][1]:
+ handler = spec.handler_class
+ methods = inspect.getmembers(handler, predicate=inspect.ismethod)
+
+ doc_methods = list(handler.SUPPORTED_METHODS)
+ if 'HEAD' in doc_methods:
+ doc_methods.remove('HEAD')
+ if 'OPTIONS' in doc_methods:
+ doc_methods.remove('OPTIONS')
+
+ for method in methods:
+ if method[0].upper() not in doc_methods:
+ continue
+ path = spec.regex.pattern
+ yield method[0], path, handler
+
+
+def normalize_path(path):
+ if path.endswith('$'):
+ path = path[:-1]
+ return path
+
+
+class AutoTornadoDirective(Directive):
+
+ has_content = True
+ required_arguments = 1
+ option_spec = {'endpoints': directives.unchanged,
+ 'undoc-endpoints': directives.unchanged,
+ 'include-empty-docstring': directives.unchanged}
+
+ @property
+ def endpoints(self):
+ endpoints = self.options.get('endpoints', None)
+ if not endpoints:
+ return None
+ return frozenset(re.split(r'\s*,\s*', endpoints))
+
+ @property
+ def undoc_endpoints(self):
+ undoc_endpoints = self.options.get('undoc-endpoints', None)
+ if not undoc_endpoints:
+ return frozenset()
+ return frozenset(re.split(r'\s*,\s*', undoc_endpoints))
+
+ def make_rst(self):
+ app = import_object(self.arguments[0])
+ for method, path, handler in get_routes(app):
+ class_name = handler.__name__
+ method_name = getattr(handler, method).__name__
+ endpoint = '.'.join((class_name, method_name))
+
+ if self.endpoints and endpoint not in self.endpoints:
+ continue
+ if endpoint in self.undoc_endpoints:
+ continue
+
+ docstring = getattr(handler, method).__doc__ or ''
+ #if not isinstance(docstring, unicode):
+ # analyzer = ModuleAnalyzer.for_module(view.__module__)
+ # docstring = force_decode(docstring, analyzer.encoding)
+ if not docstring and 'include-empty-docstring' not in self.options:
+ continue
+ docstring = prepare_docstring(docstring)
+ for line in http_directive(method, normalize_path(path),
docstring):
+ yield line
+
+ def run(self):
+ node = nodes.section()
+ node.document = self.state.document
+ result = ViewList()
+ for line in self.make_rst():
+ result.append(line, '<autotornado>')
+ nested_parse_with_titles(self.state, result, node)
+ return node.children
+
+
+def setup(app):
+ if 'http' not in app.domains:
+ httpdomain.setup(app)
+ app.add_directive('autotornado', AutoTornadoDirective)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib/httpdomain.py
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib/httpdomain.py
--- old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib/httpdomain.py
2013-08-07 18:20:52.000000000 +0200
+++ new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib/httpdomain.py
2013-10-19 09:36:08.000000000 +0200
@@ -334,8 +334,8 @@
def generate(self, docnames=None):
content = {}
items = ((method, path, info)
- for method, routes in self.domain.routes.iteritems()
- for path, info in routes.iteritems())
+ for method, routes in self.domain.routes.items()
+ for path, info in routes.items())
items = sorted(items, key=lambda item: item[1])
for method, path, info in items:
entries = content.setdefault(self.grouping_prefix(path), [])
@@ -343,8 +343,7 @@
method.upper() + ' ' + path, 0, info[0],
http_resource_anchor(method, path), '', '', info[1]
])
- content = content.items()
- content.sort(key=lambda (k, v): k)
+ content = sorted(content.items(), key=lambda k: k[0])
return (content, True)
@@ -407,8 +406,8 @@
return dict((key, self.data[key]) for key in self.object_types)
def clear_doc(self, docname):
- for typ, routes in self.routes.iteritems():
- for path, info in routes.items():
+ for typ, routes in self.routes.items():
+ for path, info in list(routes.items()):
if info[0] == docname:
del routes[path]
@@ -425,8 +424,8 @@
contnode, title)
def get_objects(self):
- for method, routes in self.routes.iteritems():
- for path, info in routes.iteritems():
+ for method, routes in self.routes.items():
+ for path, info in routes.items():
anchor = http_resource_anchor(method, path)
yield (path, path, method, info[0], anchor, 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib_httpdomain.egg-info/PKG-INFO
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib_httpdomain.egg-info/PKG-INFO
---
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib_httpdomain.egg-info/PKG-INFO
2013-08-07 18:26:56.000000000 +0200
+++
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib_httpdomain.egg-info/PKG-INFO
2013-10-19 09:45:53.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: sphinxcontrib-httpdomain
-Version: 1.1.9
+Version: 1.2.0
Summary: Sphinx domain for HTTP APIs
Home-page: http://bitbucket.org/birkenfeld/sphinx-contrib
Author: Hong Minhee
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib_httpdomain.egg-info/SOURCES.txt
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib_httpdomain.egg-info/SOURCES.txt
---
old/sphinxcontrib-httpdomain-1.1.9/sphinxcontrib_httpdomain.egg-info/SOURCES.txt
2013-08-07 18:26:56.000000000 +0200
+++
new/sphinxcontrib-httpdomain-1.2.0/sphinxcontrib_httpdomain.egg-info/SOURCES.txt
2013-10-19 09:45:53.000000000 +0200
@@ -9,6 +9,7 @@
sphinxcontrib/autohttp/bottle.py
sphinxcontrib/autohttp/common.py
sphinxcontrib/autohttp/flask.py
+sphinxcontrib/autohttp/tornado.py
sphinxcontrib_httpdomain.egg-info/PKG-INFO
sphinxcontrib_httpdomain.egg-info/SOURCES.txt
sphinxcontrib_httpdomain.egg-info/dependency_links.txt
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]