~canonical-isd-hackers/canonical-identity-provider/sst-changes

« back to all changes in this revision

Viewing changes to identityprovider/middleware/profile.py

  • Committer: Ricardo Kirkner
  • Date: 2011-07-11 19:00:03 UTC
  • Revision ID: ricardo.kirkner@canonical.com-20110711190003-6jyrni2wt4pk9lu2
moved imports into method to avoid requiring the python-profiler package unless needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import re
4
4
import os.path
5
5
 
6
 
from cProfile import Profile
7
 
from pstats import Stats
8
6
from django.conf import settings
9
7
 
10
8
 
17
15
        self.regex = re.compile(self.pattern)
18
16
 
19
17
    def process_view(self, request, view_func, view_args, view_kwargs):
 
18
        from cProfile import Profile
 
19
        from pstats import Stats
20
20
        full_name = "{v.__module__}.{v.func_name}".format(v=view_func)
21
21
        if self.regex.match(full_name):
22
22
            profile = Profile()