__init__.py
branchtls-sprint
changeset 1498 2c6eec0b46b9
parent 1398 5fe84a5f7035
child 1741 fe5266f0f88c
--- a/__init__.py	Tue Apr 28 10:11:08 2009 +0200
+++ b/__init__.py	Tue Apr 28 11:22:31 2009 +0200
@@ -74,7 +74,7 @@
             encoding = 'utf-8'
         self.encoding = encoding
         # cache result of execution for (rql expr / eids),
-        # should be emptied on commit/rollback of the server session / web 
+        # should be emptied on commit/rollback of the server session / web
         # connection
         self.local_perm_cache = {}
 
@@ -82,7 +82,7 @@
         if self.user:
             return self.user.property_value(key)
         return self.vreg.property_value(key)
-    
+
     def etype_rset(self, etype, size=1):
         """return a fake result set for a particular entity type"""
         from cubicweb.rset import ResultSet
@@ -114,7 +114,7 @@
             return None
 
     # url generation methods ##################################################
-    
+
     def build_url(self, method, base_url=None, **kwargs):
         """return an absolute URL using params dictionary key/values as URL
         parameters. Values are automatically URL quoted, and the
@@ -130,7 +130,7 @@
         if not kwargs:
             return u'%s%s' % (base_url, path)
         return u'%s%s?%s' % (base_url, path, self.build_url_params(**kwargs))
-        
+
 
     def build_url_params(self, **kwargs):
         """return encoded params to incorporate them in an URL"""
@@ -154,7 +154,7 @@
 
     def url_unquote(self, quoted):
         """returns a unicode unquoted string
-        
+
         decoding is based on `self.encoding` which is the encoding
         used in `url_quote`
         """
@@ -164,10 +164,10 @@
             return unicode(urlunquote(quoted), self.encoding)
         except UnicodeDecodeError: # might occurs on manually typed URLs
             return unicode(urlunquote(quoted), 'iso-8859-1')
-    
+
 
     # session's user related methods #####################################
-    
+
     @cached
     def user_data(self):
         """returns a dictionnary with this user's information"""
@@ -197,21 +197,21 @@
         return False
 
     # abstract methods to override according to the web front-end #############
-    
+
     def base_url(self):
         """return the root url of the application"""
         raise NotImplementedError
-    
+
     def decorate_rset(self, rset):
         """add vreg/req (at least) attributes to the given result set """
         raise NotImplementedError
-    
+
     def describe(self, eid):
         """return a tuple (type, sourceuri, extid) for the entity with id <eid>"""
         raise NotImplementedError
-        
+
 
-# XXX 2.45 is allowing nicer entity type names, use this map for bw compat    
+# XXX 2.45 is allowing nicer entity type names, use this map for bw compat
 ETYPE_NAME_MAP = {# 3.2 migration
                   'ECache': 'CWCache',
                   'EUser': 'CWUser',
@@ -268,7 +268,7 @@
                     'ezone': 'zone',
                     'i18ncontent': 'i18ncontent',
                     'svnfile': 'vcsfile',
-                    
+
                     'eclassschemes': 'keyword',
                     'eclassfolders': 'folder',
                     'eclasstags': 'tag',
@@ -300,4 +300,4 @@
         return obj.target
     except AttributeError:
         return neg_role(obj.role)
-        
+