diff options
| author | Yann Malet | 2011-09-11 05:30:17 +0200 | 
|---|---|---|
| committer | Yann Malet | 2011-09-11 05:30:17 +0200 | 
| commit | 2682e29116522cb64fd6e7c9d776a1e3b4c25a3a (patch) | |
| tree | d1098334b846d4f023ee3479558b8e1553b172d4 /debug_toolbar/panels/profiling.py | |
| parent | d3649d340a9a7e20235fa63615830b9b0b7edbdd (diff) | |
| download | django-debug-toolbar-2682e29116522cb64fd6e7c9d776a1e3b4c25a3a.tar.bz2 | |
pep 8 compliance
Diffstat (limited to 'debug_toolbar/panels/profiling.py')
| -rw-r--r-- | debug_toolbar/panels/profiling.py | 11 | 
1 files changed, 7 insertions, 4 deletions
diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py index e57aa97..01ae1e0 100644 --- a/debug_toolbar/panels/profiling.py +++ b/debug_toolbar/panels/profiling.py @@ -18,6 +18,7 @@ from pstats import Stats  from colorsys import hsv_to_rgb  import os +  class DjangoDebugToolbarStats(Stats):      __root = None @@ -29,8 +30,10 @@ class DjangoDebugToolbarStats(Stats):                      break          return self.__root +  class FunctionCall(object): -    def __init__(self, statobj, func, depth=0, stats=None, id=0, parent_ids=[], hsv=(0,0.5,1)): +    def __init__(self, statobj, func, depth=0, stats=None, +                 id=0, parent_ids=[], hsv=(0,0.5,1)):          self.statobj = statobj          self.func = func          if stats: @@ -50,7 +53,7 @@ class FunctionCall(object):          r,g,b = hsv_to_rgb(*self.hsv)          return 'rgb(%f%%,%f%%,%f%%)' %(r*100, g*100, b*100) -    def func_std_string(self): # match what old profile produced +    def func_std_string(self):  # match what old profile produced          func_name = self.func          if func_name[:2] == ('~', 0):              # special case for built-in functions @@ -63,7 +66,7 @@ class FunctionCall(object):              file_name, line_num, method = self.func              idx = file_name.find('/site-packages/')              if idx > -1: -                file_name=file_name[idx+14:] +                file_name = file_name[idx+14:]              file_path, file_name = file_name.rsplit(os.sep, 1) @@ -76,7 +79,7 @@ class FunctionCall(object):      def subfuncs(self):          i=0 -        h,s,v = self.hsv +        h, s, v = self.hsv          count = len(self.statobj.all_callees[self.func])          for func, stats in self.statobj.all_callees[self.func].iteritems():              i += 1  | 
