Fix TracedMeta class
We shouldn't .pop() trace_private from trace_args because it will
work only for first method in class.
Change-Id: Id713d1a1a9452bbdd2f58fde9499159cdfc0a037
Boris Pavlovic
8 years ago
180 | 180 | def __init__(cls, cls_name, bases, attrs): |
181 | 181 | super(TracedMeta, cls).__init__(cls_name, bases, attrs) |
182 | 182 | |
183 | trace_args = getattr(cls, "__trace_args__", {}) | |
183 | trace_args = dict(getattr(cls, "__trace_args__", {})) | |
184 | trace_private = trace_args.pop("trace_private", False) | |
184 | 185 | if "name" not in trace_args: |
185 | 186 | raise TypeError("Please specify __trace_args__ class level " |
186 | 187 | "dictionary attribute with mandatory 'name' key - " |
192 | 193 | continue |
193 | 194 | if attr_name.startswith("__"): |
194 | 195 | continue |
195 | if (not trace_args.pop("trace_private", False) and | |
196 | attr_name.startswith("_")): | |
196 | if not trace_private and attr_name.startswith("_"): | |
197 | 197 | continue |
198 | 198 | |
199 | 199 | setattr(cls, attr_name, trace(**trace_args)(getattr(cls, |