29 """ |
29 """ |
30 |
30 |
31 |
31 |
32 from logging import getLogger |
32 from logging import getLogger |
33 |
33 |
34 from logilab.common.deprecation import deprecated, class_renamed |
|
35 from logilab.common.logging_ext import set_log_methods |
34 from logilab.common.logging_ext import set_log_methods |
36 |
35 |
37 # first line imports for bw compat |
36 from logilab.common.registry import RegistrableObject, yes |
38 from logilab.common.registry import (objectify_predicate, traced_selection, Predicate, |
|
39 RegistrableObject, yes) |
|
40 |
37 |
41 |
|
42 objectify_selector = deprecated('[3.15] objectify_selector has been ' |
|
43 'renamed to objectify_predicates in ' |
|
44 'logilab.common.registry')(objectify_predicate) |
|
45 traced_selection = deprecated('[3.15] traced_selection has been ' |
|
46 'moved to logilab.common.registry')(traced_selection) |
|
47 Selector = class_renamed('Selector', Predicate, |
|
48 '[3.15] Selector has been renamed to Predicate ' |
|
49 'in logilab.common.registry') |
|
50 |
|
51 @deprecated('[3.15] lltrace decorator can now be removed') |
|
52 def lltrace(func): |
|
53 return func |
|
54 |
38 |
55 # the base class for all appobjects ############################################ |
39 # the base class for all appobjects ############################################ |
56 |
40 |
57 class AppObject(RegistrableObject): |
41 class AppObject(RegistrableObject): |
58 """This is the base class for CubicWeb application objects which are |
42 """This is the base class for CubicWeb application objects which are |
154 # these are overridden by set_log_methods below |
138 # these are overridden by set_log_methods below |
155 # only defining here to prevent pylint from complaining |
139 # only defining here to prevent pylint from complaining |
156 info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None |
140 info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None |
157 |
141 |
158 set_log_methods(AppObject, getLogger('cubicweb.appobject')) |
142 set_log_methods(AppObject, getLogger('cubicweb.appobject')) |
159 |
|
160 # defined here to avoid warning on usage on the AppObject class |
|
161 yes = deprecated('[3.15] yes has been moved to logilab.common.registry')(yes) |
|