~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to wsgitest.py

  • Committer: Michael Hudson
  • Date: 2008-06-18 01:05:15 UTC
  • mto: This revision was merged to the branch mainline in revision 164.
  • Revision ID: michael.hudson@canonical.com-20080618010515-n7ojcoqox01tcb7t
reduce scope of the try:

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        b.lock_read()
36
36
        try:
37
37
            _history = History.from_branch(b)
38
 
            _history.use_file_cache(FileChangeCache(_history, sql_dir))
39
 
            if not self.folder:
40
 
                name = os.path.basename(os.path.abspath(path))
41
 
            else:
42
 
                name = self.folder
43
 
            h = BranchWSGIApp(_history, name).app
44
 
            self.root.cache[path] = h
45
 
            return h
46
38
        finally:
47
39
            b.unlock()
 
40
        _history.use_file_cache(FileChangeCache(_history, sql_dir))
 
41
        if not self.folder:
 
42
            name = os.path.basename(os.path.abspath(path))
 
43
        else:
 
44
            name = self.folder
 
45
        h = BranchWSGIApp(_history, name).app
 
46
        self.root.cache[path] = h
 
47
        return h
48
48
 
49
49
    def __call__(self, environ, start_response):
50
50
        path = os.path.join(self.root.folder, self.folder)
90
90
 
91
91
 
92
92
httpserver.serve(app, host='127.0.0.1', port='9876')
93