~mwhudson/loggerhead/yui

« back to all changes in this revision

Viewing changes to loggerhead/controllers/annotate_ui.py

  • Committer: Martin Albisetti
  • Date: 2008-10-25 19:27:10 UTC
  • mfrom: (219.2.15 abstract_path)
  • Revision ID: martin.albisetti@canonical.com-20081025192710-js2p07p94c7twp9t
 * Use paths to navigate instead of file_ids
 * Cleanups on different methods and variables
 * Fixed bugs: #260363, #269365 and #128926

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
    template_path = 'loggerhead.templates.annotate'
39
39
 
40
 
    def get_values(self, h, args, kw, headers):
41
 
        if len(args) > 0:
42
 
            revid = h.fix_revid(args[0])
43
 
        else:
44
 
            revid = h.last_revid
45
 
 
46
 
        path = None
47
 
        if len(args) > 1:
48
 
            path = '/'.join(args[1:])
49
 
            if not path.startswith('/'):
50
 
                path = '/' + path
51
 
 
52
 
        file_id = kw.get('file_id', None)
 
40
    def get_values(self, h, revid, path, kwargs, headers):
 
41
 
 
42
        revid = h.fix_revid(revid)
 
43
        file_id = kwargs.get('file_id', None)
53
44
        if (file_id is None) and (path is None):
54
 
            raise HTTPBadRequest('No file_id or filename provided to annotate')
 
45
            raise HTTPBadRequest('No file_id or filename '
 
46
                                 'provided to annotate')
55
47
 
56
48
        if file_id is None:
57
49
            file_id = h.get_file_id(revid, path)