cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 20 May 2009 14:19:53 +0200
branchstable
changeset 1882 ce662160bb46
parent 1881 75540944ae18
child 1883 011e13d74cfc
cleanup
dbapi.py
web/views/baseviews.py
web/views/ibreadcrumbs.py
web/views/xmlrss.py
--- a/dbapi.py	Wed May 20 14:19:48 2009 +0200
+++ b/dbapi.py	Wed May 20 14:19:53 2009 +0200
@@ -50,7 +50,7 @@
         # resolve the Pyro object
         try:
             nshost, nsport = config['pyro-ns-host'], config['pyro-ns-port']
-            uri = locator.getNS(nshost, nsport) .resolve(nsid)
+            uri = locator.getNS(nshost, nsport).resolve(nsid)
         except ProtocolError:
             raise ConnectionError('Could not connect to the Pyro name server '
                                   '(host: %s:%i)' % (nshost, nsport))
--- a/web/views/baseviews.py	Wed May 20 14:19:48 2009 +0200
+++ b/web/views/baseviews.py	Wed May 20 14:19:53 2009 +0200
@@ -11,8 +11,8 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 #from __future__ import with_statement
-
 __docformat__ = "restructuredtext en"
+_ = unicode
 
 from rql import nodes
 
@@ -23,7 +23,6 @@
 from cubicweb.view import EntityView, AnyRsetView, View
 from cubicweb.common.uilib import cut, printable_value
 
-_ = unicode
 
 class NullView(AnyRsetView):
     """default view when no result has been found"""
@@ -204,9 +203,10 @@
     def cell_call(self, row, col):
         entity = self.entity(row, col)
         desc = cut(entity.dc_description(), 50)
-        self.w(u'<a href="%s" title="%s">' % (html_escape(entity.absolute_url()),
-                                              html_escape(desc)))
-        self.w(html_escape(self.view('textincontext', self.rset, row=row, col=col)))
+        self.w(u'<a href="%s" title="%s">' % (
+            html_escape(entity.absolute_url()), html_escape(desc)))
+        self.w(html_escape(self.view('textincontext', self.rset,
+                                     row=row, col=col)))
         self.w(u'</a>')
 
 
@@ -214,8 +214,12 @@
     id = 'outofcontext'
 
     def cell_call(self, row, col):
-        self.w(u'<a href="%s">' % self.entity(row, col).absolute_url())
-        self.w(html_escape(self.view('textoutofcontext', self.rset, row=row, col=col)))
+        entity = self.entity(row, col)
+        desc = cut(entity.dc_description(), 50)
+        self.w(u'<a href="%s" title="%s">' % (
+            html_escape(entity.absolute_url()), html_escape(desc)))
+        self.w(html_escape(self.view('textoutofcontext', self.rset,
+                                     row=row, col=col)))
         self.w(u'</a>')
 
 
--- a/web/views/ibreadcrumbs.py	Wed May 20 14:19:48 2009 +0200
+++ b/web/views/ibreadcrumbs.py	Wed May 20 14:19:53 2009 +0200
@@ -5,6 +5,7 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
+_ = unicode
 
 from logilab.mtconverter import html_escape
 
@@ -16,7 +17,6 @@
 from cubicweb.common.uilib import cut
 from cubicweb.web.component import EntityVComponent
 
-_ = unicode
 
 def bc_title(entity):
     textsize = entity.req.property_value('navigation.short-line-size')
@@ -80,7 +80,6 @@
 
     def cell_call(self, row, col):
         entity = self.entity(row, col)
-        desc = cut(entity.dc_description(), 50)
-        self.w(u'<a href="%s" title="%s">%s</a>' % (html_escape(entity.absolute_url()),
-                                                    html_escape(desc),
-                                                    bc_title(entity)))
+        desc = html_escape(cut(entity.dc_description(), 50))
+        self.w(u'<a href="%s" title="%s">%s</a>' % (
+            html_escape(entity.absolute_url()), desc, bc_title(entity)))
--- a/web/views/xmlrss.py	Wed May 20 14:19:48 2009 +0200
+++ b/web/views/xmlrss.py	Wed May 20 14:19:53 2009 +0200
@@ -5,6 +5,7 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
+_ = unicode
 
 from time import timezone
 
@@ -17,8 +18,6 @@
 from cubicweb.web.box import BoxTemplate
 from cubicweb.common.uilib import simple_sgml_tag
 
-_ = unicode
-
 
 # base xml views ##############################################################