nicer deprecation warnings
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Sep 2009 11:04:59 +0200
changeset 3405 9d31c9cb8103
parent 3404 9cb6b0cc2a7c
child 3406 e343f37f7013
nicer deprecation warnings
entities/wfobjs.py
entity.py
rset.py
vregistry.py
--- a/entities/wfobjs.py	Wed Sep 23 11:03:57 2009 +0200
+++ b/entities/wfobjs.py	Wed Sep 23 11:04:59 2009 +0200
@@ -502,7 +502,7 @@
         super(WorkflowableMixIn, self).clear_all_caches()
         clear_cache(self, 'cwetype_workflow')
 
-    @deprecated('get transition from current workflow and use its may_be_fired method')
+    @deprecated('[3.5] get transition from current workflow and use its may_be_fired method')
     def can_pass_transition(self, trname):
         """return the Transition instance if the current user can fire the
         transition with the given name, else None
@@ -512,7 +512,7 @@
             return tr
 
     @property
-    @deprecated('use printable_state')
+    @deprecated('[3.5] use printable_state')
     def displayable_state(self):
         return self.req._(self.state)
 
--- a/entity.py	Wed Sep 23 11:03:57 2009 +0200
+++ b/entity.py	Wed Sep 23 11:04:59 2009 +0200
@@ -284,7 +284,7 @@
             try:
                 kwargs['_restpath'] = self.rest_path(kwargs.get('base_url'))
             except TypeError:
-                warn('%s: rest_path() now take use_ext_eid argument, '
+                warn('[3.4] %s: rest_path() now take use_ext_eid argument, '
                      'please update' % self.__regid__, DeprecationWarning)
                 kwargs['_restpath'] = self.rest_path()
         else:
--- a/rset.py	Wed Sep 23 11:03:57 2009 +0200
+++ b/rset.py	Wed Sep 23 11:04:59 2009 +0200
@@ -386,7 +386,7 @@
         """
         if col is None:
             from warnings import warn
-            msg = 'col parameter will become mandatory in future version'
+            msg = '[3.2] col parameter will become mandatory in future version'
             warn(msg, DeprecationWarning, stacklevel=3)
             col = 0
         etype = self.description[row][col]
--- a/vregistry.py	Wed Sep 23 11:03:57 2009 +0200
+++ b/vregistry.py	Wed Sep 23 11:04:59 2009 +0200
@@ -61,7 +61,7 @@
 def class_regid(cls):
     """returns a unique identifier for an appobject class"""
     if 'id' in cls.__dict__:
-        warn('%s.%s: id is deprecated, use __regid__'
+        warn('[3.6] %s.%s: id is deprecated, use __regid__'
              % (cls.__module__, cls.__name__), DeprecationWarning)
         cls.__regid__ = cls.id
     if hasattr(cls, 'id'):