~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/branch.py

  • Committer: Martin Pool
  • Date: 2011-11-23 08:18:35 UTC
  • mfrom: (431.2.27 export-tarball)
  • mto: This revision was merged to the branch mainline in revision 461.
  • Revision ID: mbp@canonical.com-20111123081835-mhqxfi9pwpyullub
Merge tarball download support from xaav

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 
#
 
16
 
17
17
"""The WSGI application for serving a Bazaar branch."""
18
18
 
19
19
import logging
34
34
from loggerhead.controllers.atom_ui import AtomUI
35
35
from loggerhead.controllers.changelog_ui import ChangeLogUI
36
36
from loggerhead.controllers.diff_ui import DiffUI
37
 
from loggerhead.controllers.download_ui import DownloadUI
 
37
from loggerhead.controllers.download_ui import DownloadUI, DownloadTarballUI
38
38
from loggerhead.controllers.filediff_ui import FileDiffUI
39
39
from loggerhead.controllers.inventory_ui import InventoryUI
40
40
from loggerhead.controllers.revision_ui import RevisionUI
50
50
 
51
51
    def __init__(self, branch, friendly_name=None, config={},
52
52
                 graph_cache=None, branch_link=None, is_root=False,
53
 
                 served_url=_DEFAULT, use_cdn=False, private=False):
 
53
                 served_url=_DEFAULT, use_cdn=False, private=False,
 
54
                 export_tarballs=True):
 
55
        """Create branch-publishing WSGI app.
 
56
 
 
57
        :param export_tarballs: If true, allow downloading snapshots of revisions
 
58
            as tarballs.
 
59
        """
54
60
        self.branch = branch
55
61
        self._config = config
56
62
        self.friendly_name = friendly_name
63
69
        self.served_url = served_url
64
70
        self.use_cdn = use_cdn
65
71
        self.private = private
 
72
        self.export_tarballs = export_tarballs
66
73
 
67
74
    def public_private_css(self):
68
75
        if self.private:
131
138
        'revision': RevisionUI,
132
139
        'search': SearchUI,
133
140
        'view': ViewUI,
 
141
        'tarball': DownloadTarballUI,
134
142
        }
135
143
 
136
144
    def last_updated(self):