# HG changeset patch # User Laurent Peuch # Date 1549979930 -3600 # Node ID 77342fae06fb93e3e4434d8185395dff3ded617c # Parent 72ba5f5278e012b629c570418c37806f58436695 [doc] respect pep8 in code examples diff -r 72ba5f5278e0 -r 77342fae06fb doc/tutorials/base/customizing-the-application.rst --- a/doc/tutorials/base/customizing-the-application.rst Tue Feb 12 14:58:26 2019 +0100 +++ b/doc/tutorials/base/customizing-the-application.rst Tue Feb 12 14:58:50 2019 +0100 @@ -254,10 +254,12 @@ from cubicweb.web.views import basetemplates + class MyHTMLPageFooter(basetemplates.HTMLPageFooter): def footer_content(self): - self.w(u'This website has been created with CubicWeb.') + self.w(u'This website has been created with CubicWeb.') + def registration_callback(vreg): vreg.register_all(globals().values(), __name__, (MyHTMLPageFooter,)) @@ -313,12 +315,14 @@ from cubicweb.predicates import is_instance from cubicweb.web.views import primary + class CommunityPrimaryView(primary.PrimaryView): __select__ = is_instance('Community') def cell_call(self, row, col): entity = self.cw_rset.get_entity(row, col) self.w(u'

Welcome to the "%s" community

' % entity.printable_value('name')) + if entity.description: self.w(u'

%s

' % entity.printable_value('description')) @@ -422,8 +426,10 @@ def cell_call(self, row, col): entity = self.cw_rset.get_entity(row, col) self.w(u'

Welcome to the "%s" community

' % entity.printable_value('name')) + if entity.display_cw_logo(): self.w(u'') + if entity.description: self.w(u'

%s

' % entity.printable_value('description')) @@ -476,6 +482,7 @@ cardinality = '1*' composite = 'object' + class tags(RelationDefinition): subject = 'Tag' object = ('Community', 'BlogEntry') @@ -519,13 +526,14 @@ __select__ = is_instance('Community') def render_entity_title(self, entity): - self.w(u'

Welcome to the "%s" community

' % entity.printable_value('name')) + self.w(u'

Welcome to the "%s" community

' % entity.printable_value('name')) def render_entity_attributes(self, entity): - if entity.display_cw_logo(): - self.w(u'') - if entity.description: - self.w(u'

%s

' % entity.printable_value('description')) + if entity.display_cw_logo(): + self.w(u'') + + if entity.description: + self.w(u'

%s

' % entity.printable_value('description')) It appears now properly: