~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/inventory_ui.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2007-10-29 22:20:14 UTC
  • mfrom: (140.1.1 add-check-target)
  • Revision ID: launchpad@pqm.canonical.com-20071029222014-55se2y53jk4yrrev
[r=lifeless] add a do-nothing make check

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
#
19
19
 
 
20
import datetime
20
21
import logging
 
22
import os
21
23
import posixpath
 
24
import textwrap
22
25
import time
23
26
 
24
27
import turbogears
25
 
from cherrypy import InternalError
 
28
from cherrypy import InternalError, session
26
29
 
27
30
from loggerhead import util
28
 
from loggerhead.templatefunctions import templatefunctions
29
31
 
30
32
 
31
33
log = logging.getLogger("loggerhead.controllers")
45
47
        self.log = branch.log
46
48
 
47
49
    @util.strip_whitespace
48
 
    @turbogears.expose(html='zpt:loggerhead.templates.inventory')
 
50
    @turbogears.expose(html='loggerhead.templates.inventory')
49
51
    def default(self, *args, **kw):
50
52
        z = time.time()
51
53
        h = self._branch.get_history()
65
67
                raise InternalError('Could not fetch changes')
66
68
 
67
69
            file_id = kw.get('file_id', inv.root.file_id)
68
 
            start_revid = kw.get('start_revid', None)
69
70
            sort_type = kw.get('sort', None)
70
71
 
71
72
            # no navbar for revisions
88
89
            if updir == '/':
89
90
                updir_file_id = None
90
91
 
91
 
            def url(pathargs, **kw):
92
 
                return self._branch.url(pathargs, **util.get_context(**kw))
93
 
 
94
92
            vals = {
95
93
                'branch': self._branch,
96
94
                'util': util,
104
102
                'history': h,
105
103
                'posixpath': posixpath,
106
104
                'navigation': navigation,
107
 
                'url': url,
108
 
                'start_revid': start_revid,
109
105
            }
110
 
            vals.update(templatefunctions)
111
106
            h.flush_cache()
112
107
            self.log.info('/inventory %r: %r secs' % (revid, time.time() - z))
113
108
            return vals