| 137 | self.name_style = name_style |
| 138 | |
| 139 | def get_name(self, function, instance): |
| 140 | is_method = function.__code__.co_argcount > 0 and function.__code__.co_varnames[0] == "self" |
| 141 | if self.name_style == "func" or not is_method: |
| 142 | return "%s" % function.__name__ |
| 143 | if self.name_style == "class": |
| 144 | return "%s.%s" % (instance.__class__.__name__, function.__name__) |
| 145 | if self.name_style == "full": |
| 146 | return "%s.%s.%s" % (instance.__module__, instance.__class__.__name__, function.__name__) |
| 147 | |
| 148 | def time(self, function): |
| 149 | """ |