[PATCH 5 of 8 sherpa] Cosmetic / docstring fixes

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Feb 28 17:08:19 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1488297722 -3600
#      Tue Feb 28 17:02:02 2017 +0100
# Node ID 38a9301ee8770f5d34790f8bd075921e5b5f5503
# Parent  2256c2d83372b7cc975449219a1e98b2427355e2
Cosmetic / docstring fixes

diff --git a/cubicweb_sherpa/views/__init__.py b/cubicweb_sherpa/views/__init__.py
--- a/cubicweb_sherpa/views/__init__.py
+++ b/cubicweb_sherpa/views/__init__.py
@@ -18,10 +18,11 @@
 from jinja2 import Environment, PackageLoader, select_autoescape
 
 from cubicweb.view import View
 from cubicweb.web.views import urlrewrite, startup
 
+
 _REWRITE_RULES = []
 _JINJA_ENV = Environment(loader=PackageLoader('cubicweb_sherpa.views'),
                          autoescape=select_autoescape(enabled_extensions=('html',)))
 
 
@@ -44,13 +45,14 @@ class JinjaStaticView(View):
                             title=self._cw._(self.title),
                             data_url=self._cw.datadir_url))
 
 
 def jinja_static_view(template_name, title=None, regid=None, path=None):
-    """Generate a sub-class of JinjaStaticView parametrized with its `template_name` and `title`.
+    """Generate a sub-class of :class:`JinjaStaticView` parametrized with its `template_name` and
+    `title`.
 
-    `__regid__` is built by prepending 'sherpa.' to template_name or may be explicitly specified
+    `__regid__` is built by prepending 'sherpa.' to `template_name` or may be explicitly specified
     using `regid`.
 
     A path to access to view is automatically generated and will match `template_name` unless
     explicitly specified using `path` argument.
     """
@@ -65,14 +67,14 @@ def jinja_static_view(template_name, tit
     return type(class_name, (JinjaStaticView,), {'__regid__': regid,
                                                  'template_name': template_name,
                                                  'title': title})
 
 
+IndexView = jinja_static_view('index', 'view_index', regid='index', path='/')
 ProjectView = jinja_static_view('project', u'Sherpa un générateur de profils')
 UtilisationView = jinja_static_view('utilisation', u'Pour commencer')
 SedaView = jinja_static_view('seda', u'Le SEDA')
-IndexView = jinja_static_view('index', regid='index', path='/')
 AProposView = jinja_static_view('apropos', u'À propos')
 ContactView = jinja_static_view('contact', 'Contact')
 
 
 # add our rewrite rules, has to be done once the list if filled because of metaclass magic
diff --git a/cubicweb_sherpa/views/management.py b/cubicweb_sherpa/views/management.py
--- a/cubicweb_sherpa/views/management.py
+++ b/cubicweb_sherpa/views/management.py
@@ -11,10 +11,12 @@
 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 # details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""Views related to edition management (dashboard, custom edition forms / display, etc).
+"""
 
 from logilab.mtconverter import xml_escape
 
 from cubicweb.predicates import relation_possible, one_line_rset, non_final_entity
 from cubicweb.web import action, formwidgets
@@ -24,11 +26,12 @@ from cubicweb.web.views import actions, 
 from cubes.relationwidget.views import RelationFacetWidget
 
 
 class SherpaSecurityManagementView(management.SecurityManagementView):
     """Security view overriden to hide permissions definitions and using a
-    RelationFacetWidget to edit owner"""
+    RelationFacetWidget to edit owner.
+    """
     __select__ = (management.SecurityManagementView.__select__ &
                   relation_possible('owned_by', action='add', strict=True))
 
     def entity_call(self, entity):
         w = self.w


More information about the saem-devel mailing list