# HG changeset patch # User Sylvain Thénault # Date 1449593994 -3600 # Node ID 8b8193046600fe937b387723909ad2efbdbf6939 # Parent 4f28cb25b6c168ecbc6644c515aa094bbe2241c2 [rest] a bit of pep8 diff -r 4f28cb25b6c1 -r 8b8193046600 ext/rest.py --- a/ext/rest.py Tue Dec 08 10:24:44 2015 +0100 +++ b/ext/rest.py Tue Dec 08 17:59:54 2015 +0100 @@ -51,7 +51,7 @@ from cubicweb import UnknownEid from cubicweb.ext.html4zope import Writer -from cubicweb.web.views import vid_from_rset # XXX better not to import c.w.views here... +from cubicweb.web.views import vid_from_rset # XXX better not to import c.w.views here... # We provide our own parser as an attempt to get rid of # state machine reinstanciation @@ -70,6 +70,7 @@ LOGGER = getLogger('cubicweb.rest') + def eid_reference_role(role, rawtext, text, lineno, inliner, options={}, content=[]): try: @@ -99,6 +100,7 @@ return [nodes.reference(rawtext, utils.unescape(rest), refuri=ref, **options)], [] + def rql_role(role, rawtext, text, lineno, inliner, options={}, content=[]): """``:rql:```` or ``:rql:`:``` @@ -132,6 +134,7 @@ set_classes(options) return [nodes.raw('', content, format='html')], [] + def bookmark_role(role, rawtext, text, lineno, inliner, options={}, content=[]): """``:bookmark:```` or ``:bookmark:`:``` @@ -189,6 +192,7 @@ set_classes(options) return [nodes.raw('', content, format='html')], [] + def winclude_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): """Include a reST file as part of the content of this reST file. @@ -254,6 +258,7 @@ winclude_directive.options = {'literal': directives.flag, 'encoding': directives.encoding} + class RQLTableDirective(Directive): """rql-table directive diff -r 4f28cb25b6c1 -r 8b8193046600 ext/test/unittest_rest.py --- a/ext/test/unittest_rest.py Tue Dec 08 10:24:44 2015 +0100 +++ b/ext/test/unittest_rest.py Tue Dec 08 17:59:54 2015 +0100 @@ -31,7 +31,7 @@ self.assertEqual(rest_publish(context, ':eid:`%s`' % context.eid), '

' '#%s

\n' % context.eid) - self.assertEqual(rest_publish(context, ':eid:`%s:some text`' % context.eid), + self.assertEqual(rest_publish(context, ':eid:`%s:some text`' % context.eid), '

' 'some text

\n')