~ubuntu-branches/ubuntu/lucid/loggerhead/lucid-security

« back to all changes in this revision

Viewing changes to loggerhead/controllers/changelog_ui.py

  • Committer: Bazaar Package Importer
  • Author(s): James Westby, Roland Mas, Jelmer Vernooij, James Westby
  • Date: 2009-08-26 13:18:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090826131803-0ce1fhaetci8b0c5
Tags: 1.17-0ubuntu1
[ Roland Mas ]
* Use the YUI library provided by libjs-yui. (Closes: #511286)

[ Jelmer Vernooij ]
* Use my debian.org address in Uploaders field.
* Add ${misc:Depends} to please lintian.
* Suggest recent version of paste, which doesn't expose internal port
  numbers in links. (Closes: #507000)
* Bump standards version to 3.8.1.

[ James Westby ]
* New upstream release.
* Drop get-orig-source rule in favour of debian/watch.
* Add python-pkg-resources and python-paste to Build-Depends,
  python-pkg-resources to Depends and python-simplejson to
  Recommends due to dependency changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
 
2
# Copyright (C) 2008, 2009 Canonical Ltd.
2
3
# Copyright (C) 2006  Robey Pointer <robey@lag.net>
3
4
# Copyright (C) 2006  Goffredo Baroncelli <kreijack@inwind.it>
4
5
#
17
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
#
19
20
 
 
21
import urllib
 
22
 
 
23
try:
 
24
    import simplejson
 
25
except ImportError:
 
26
    import json as simplejson
 
27
 
20
28
from paste.httpexceptions import HTTPServerError
21
29
 
22
30
from loggerhead import util
58
66
                scan_list = revid_list[i:]
59
67
            change_list = scan_list[:pagesize]
60
68
            changes = list(history.get_changes(change_list))
61
 
            history.add_changes(changes)
 
69
            data = {}
 
70
            for i, c in enumerate(changes):
 
71
                c.index = i
 
72
                data[str(i)] = urllib.quote(urllib.quote(c.revid, safe=''))
62
73
        except:
63
74
            self.log.exception('Exception fetching changes')
64
75
            raise HTTPServerError('Could not fetch changes')
71
82
            navigation.query = query
72
83
        util.fill_in_navigation(navigation)
73
84
 
74
 
        # add parent & merge-point branch-nick info, in case it's useful
75
 
        history.get_branch_nicks(changes)
76
 
 
77
85
        # Directory Breadcrumbs
78
86
        directory_breadcrumbs = (
79
87
            util.directory_breadcrumbs(
81
89
                self._branch.is_root,
82
90
                'changes'))
83
91
 
 
92
        show_tag_col = False
 
93
        for change in changes:
 
94
            if change.tags is not None:
 
95
                show_tag_col = True
 
96
                break
 
97
 
84
98
        return {
85
99
            'branch': self._branch,
86
100
            'changes': changes,
 
101
            'show_tag_col': show_tag_col,
 
102
            'data': simplejson.dumps(data),
87
103
            'util': util,
88
104
            'history': history,
89
105
            'revid': revid,