fix copyright + trailing whitespaces
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 18 May 2009 08:29:36 +0200
changeset 26 38795a236973
parent 25 fb294a8849d9
child 27 590da2e84eab
fix copyright + trailing whitespaces
__init__.py
__pkginfo__.py
entities.py
hooks.py
schema.py
setup.py
test/unittest_classification.py
views.py
--- a/__init__.py	Mon May 18 08:25:38 2009 +0200
+++ b/__init__.py	Mon May 18 08:29:36 2009 +0200
@@ -1,7 +1,7 @@
 """pluggable mixins for the Cubicweb classification schemes package
 
 :organization: Logilab
-:copyright: 2007-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -14,7 +14,7 @@
     pass
 else:
     from cubicweb.common import mixins
-    
+
     def kwvocab_from_rset(rset):
         vocabbyscheme = {}
         for e in rset.entities():
@@ -31,10 +31,10 @@
                 # insert separators
                 vocab.append( (None, '----') )
         return  'eid', vocab
-    
+
     FACETTES.add( ('applied_to', 'object', 'name', kwvocab_from_rset) )
 
-    
+
     class ClassifiableMixIn(object):
         """base mixin providing helper methods for classifiable entities.
         This mixin will be automatically set on class supporting the 'applied_to'
--- a/__pkginfo__.py	Mon May 18 08:25:38 2009 +0200
+++ b/__pkginfo__.py	Mon May 18 08:29:36 2009 +0200
@@ -8,7 +8,7 @@
 version = '.'.join(str(num) for num in numversion)
 
 license = 'LGPL'
-copyright = '''Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE).
+copyright = '''Copyright (c) 2003-2009 LOGILAB S.A. (Paris, FRANCE).
 http://www.logilab.fr/ -- mailto:contact@logilab.fr'''
 
 author = "Logilab"
--- a/entities.py	Mon May 18 08:25:38 2009 +0200
+++ b/entities.py	Mon May 18 08:29:36 2009 +0200
@@ -1,7 +1,7 @@
 """entity classes for classification schemes entities
 
 :organization: Logilab
-:copyright: 2007-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -17,18 +17,18 @@
     def parent(self):
         """overriden from TreeMixIn"""
         return None
-    
+
     def children(self, entities=True):
         """TreeMixIn interface"""
         return self.related('included_in', 'object', entities=entities)
 
-    
+
 class Keyword(TreeMixIn, AnyEntity):
     id = 'Keyword'
     fetch_attrs, fetch_order = fetch_config(['name'])
 
     tree_attribute = 'subkeyword_of'
-    
+
     @property
     def classification(self):
         return self.included_in[0]
@@ -37,11 +37,10 @@
         if self.subkeyword_of:
             return self.subkeyword_of[0]
         return self.classification
-    
+
     def dc_long_title(self):
         try:
             return '%s (%s)' % (self.name, self.req._(self.state))
         except IndexError:
             # XXX no state yet, due to notification before state has been set
             return self.name
-
--- a/hooks.py	Mon May 18 08:25:38 2009 +0200
+++ b/hooks.py	Mon May 18 08:29:36 2009 +0200
@@ -1,7 +1,7 @@
 """specific hooks for Classification and Keyword entities
 
 :organization: Logilab
-:copyright: 2007-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -30,8 +30,8 @@
         if not rset:
             msg = session._("this keyword can't be applied to this kind of entity")
             raise ValidationError(None, msg)
-            
-            
+
+
 class SetIncludedInRelationOp(PreCommitOperation):
     """delay this operation to commit to avoid conflict with a late rql query
     already setting the relation
@@ -60,7 +60,7 @@
             session.execute('SET SK included_in C WHERE SK eid %(x)s, '
                             'SK subkeyword_of K, K included_in C',
                             {'x': subkw.eid}, 'x')
-            
+
 
 class SetIncludedInRelationHook(Hook):
     """sets the included_in relation on a subkeyword if not already set
@@ -82,7 +82,7 @@
 class KeywordNotificationView(NotificationView):
     accepts = ('Keyword',)
     msgid_timestamp = True
-    
+
     def recipients(self):
         """Returns the project's interested people (entities)"""
         creator = self.entity(0).created_by[0]
@@ -95,7 +95,7 @@
         entity = self.entity(0)
         context['kw'] = entity.name
         return context
-    
+
 
 class KeywordStatusChanged(StatusChangeMixIn, KeywordNotificationView):
     content = _("""
@@ -109,7 +109,7 @@
 
 
 class KeywordNameChanged(KeywordNotificationView):
-    id = 'notif_after_update_entity' 
+    id = 'notif_after_update_entity'
 
     content = _("keyword name changed from %(oldname)s to %(kw)s")
 
@@ -132,7 +132,7 @@
         entity = self.entity(0)
         return self.req._('keyword name changed from %s to %s') % (
             self.get_oldname(entity), entity.name)
-        
+
 
 class KeywordAddedView(ContentAddedView):
     """get notified from new keywords"""
@@ -161,7 +161,7 @@
         else:
             session.unsafe_execute('SET X in_state ST WHERE ST name "validation pending", X is ET, ST state_of ET, X eid %(x)s',
                                    {'x' : entity.eid}, 'x')
-                
+
 
 class AfterAddAnyEntity(Hook):
     """make initial state be a default state"""
@@ -170,5 +170,3 @@
 
     def call(self, session, entity):
         SetKeywordInitialStateOp(session, entity=entity)
-
-               
--- a/schema.py	Mon May 18 08:25:38 2009 +0200
+++ b/schema.py	Mon May 18 08:29:36 2009 +0200
@@ -1,3 +1,10 @@
+"""This cube handles classification schemes.
+
+:organization: Logilab
+:copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
+"""
+
 class Classification(MetaUserEntityType):
     """classification schemes are used by users to classify entities.
     """
@@ -26,7 +33,7 @@
     """
     permissions = {
         #'read' : ('managers', 'users', 'guests'),
-        'read' : ('managers', 
+        'read' : ('managers',
                   ERQLExpression('X in_state ST, ST name "keyword validated"'),
                   ERQLExpression('X owned_by U')),
         'add' : ('managers', 'users'),
@@ -34,7 +41,7 @@
         'update' : ('managers',),
         }
     name = String(required=True, fulltextindexed=True, indexed=True, maxsize=128)
-    
+
     subkeyword_of = SubjectRelation('Keyword', cardinality='?*',
                                     description=_('which keyword (if any) this keyword specializes'),
                                     # if no included_in set, it'll be automatically added by a hook
--- a/setup.py	Mon May 18 08:25:38 2009 +0200
+++ b/setup.py	Mon May 18 08:29:36 2009 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # pylint: disable-msg=W0404,W0622,W0704,W0613,W0152
-# Copyright (c) 2003-2004 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2009 LOGILAB S.A. (Paris, FRANCE).
 # http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This program is free software; you can redistribute it and/or modify it under
@@ -48,7 +48,7 @@
 
 BASE_BLACKLIST = ('CVS', 'debian', 'dist', 'build', '__buildlog')
 IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc')
-    
+
 
 def ensure_scripts(linux_scripts):
     """creates the proper script names required for each platform
@@ -77,6 +77,6 @@
                  scripts=ensure_scripts(scripts),
                  data_files=data_files,
                  **kwargs)
-            
+
 if __name__ == '__main__' :
     install()
--- a/test/unittest_classification.py	Mon May 18 08:25:38 2009 +0200
+++ b/test/unittest_classification.py	Mon May 18 08:29:36 2009 +0200
@@ -11,7 +11,7 @@
         self.kw1 = self.execute('INSERT Keyword K: K name "kwgroup", K included_in C WHERE C name "classif1"')[0][0]
         self.kw2 = self.execute('INSERT Keyword K: K name "kwuser", K included_in C WHERE C name "classif2"')[0][0]
         #self.zone = self.add_entity('Zone', name=u"Paris")
-    
+
     def test_application_of_bad_keyword_fails(self):
         self.assertRaises(ValidationError, self.execute,
                           'SET K applied_to G WHERE G is CWGroup, K name "kwuser"')
@@ -24,12 +24,12 @@
         rset = self.execute('Any N WHERE C name N, K included_in C, K name "kwgroup2"')
         self.assertEquals(len(rset), 1)
         self.assertEqual(rset[0][0], 'classif1')
-        
+
 
     def test_cannot_create_subkeyword_from_other_classification(self):
         self.execute('SET X subkeyword_of Y WHERE X eid %s, Y eid %s' % (self.kw1, self.kw2))
         self.assertRaises(ValidationError, self.commit)
-        
+
 
     def test_cannot_create_cycles(self):
         # direct obvious cycle
@@ -45,7 +45,7 @@
     def test_keyword_workflow_and_permissions(self):
         user = self.create_user('toto')
         cnx = self.login('toto')
-        
+
         kw1 = self.execute('INSERT Keyword K: K name "xyz"')[0][0]
         self.execute('SET K included_in C WHERE K eid %(x)s, C name "classif1"',
                      {'x' : kw1})
@@ -73,7 +73,7 @@
         keywords = self.execute('Any K WHERE K included_in C, C name "classif1"')
         # 'xyz' should now be visible
         self.assertEquals(len(keywords), 2)
-        
+
 
 class KeywordTC(EnvBasedTC):
     def setup_database(self):
@@ -99,9 +99,9 @@
         state = self.execute('Any SN WHERE K in_state S, S name SN, K eid %(k)s',
                              {'k' : kweid})[0][0]
         self.assertEquals(state, u'validation pending')
-        
-        
-        
+
+
+
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main
--- a/views.py	Mon May 18 08:25:38 2009 +0200
+++ b/views.py	Mon May 18 08:29:36 2009 +0200
@@ -1,7 +1,7 @@
 """Specific views for keywords / classification schemes
 
 :organization: Logilab
-:copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -159,6 +159,5 @@
         self.exception(unicode(ex))
         return self.req._('A problem occured while applying keywords')
     return msg
+
 JSonController.js_add_keywords = js_add_keywords
-
-