##// END OF EJS Templates
Added readme, and changed version display
marcink -
r224:fdcef6ea default
parent child Browse files
Show More
@@ -1,19 +1,18 b''
1 This file is for you to describe the pylons_app application. Typically
2 you would include information such as the information below:
3
4 Installation and Setup
5 ======================
6
7 Install ``pylons_app`` using easy_install::
8
9 easy_install pylons_app
1 Pylons based replacement for hgwebdir. Fully customizable,
2 with authentication, permissions. Based on vcs library.
3 - has it's own middleware to handle mercurial protocol request each request can
4 be logged and authenticated +threaded performance unlikely to hgweb
5 - mako templates let's you cusmotize look and feel of appplication.
6 - diffs annotations and source code all colored by pygments.
7 - admin interface for performing user/permission managments as well as repository
8 managment
9 - added cache with invalidation on push/repo managment for high performance and
10 always upto date data.
11 - rss /atom feed customizable
12 - future support for git
13 - based on pylons 1.0 / sqlalchemy 0.6
10 14
11 Make a config file as follows::
12
13 paster make-config pylons_app config.ini
14
15 Tweak the config file as appropriate and then setup the application::
16
17 paster setup-app config.ini
18
19 Then you are ready to go.
15 ===
16 This software is still in beta mode. I don't guarantee that it'll work.
17 I started this project since i was tired of sad looks, and zero controll over
18 our company regular hgwebdir.
@@ -1,41 +1,41 b''
1 1 """The base Controller API
2 2
3 3 Provides the BaseController class for subclassing.
4 4 """
5 5 from beaker.cache import cache_region
6 6 from pylons import config, tmpl_context as c, request, session
7 7 from pylons.controllers import WSGIController
8 8 from pylons.templating import render_mako as render
9 9 from pylons_app.lib.auth import LoginRequired, AuthUser
10 10 from pylons_app.lib.utils import get_repo_slug
11 11 from pylons_app.model import meta
12 12 from pylons_app.model.hg_model import HgModel
13 from pylons_app import get_version
13 from pylons_app import __version__
14 14
15 15 @cache_region('long_term', 'cached_repo_list')
16 16 def _get_repos_cached():
17 17 return [rep for rep in HgModel().get_repos()]
18 18
19 19 @cache_region('long_term', 'full_changelog')
20 20 def _full_changelog_cached(repo_name):
21 21 return list(reversed(list(HgModel().get_repo(repo_name))))
22 22
23 23 class BaseController(WSGIController):
24 24
25 25 def __before__(self):
26 c.hg_app_version = get_version()
26 c.hg_app_version = __version__
27 27 c.repos_prefix = config['hg_app_name']
28 28 c.repo_name = get_repo_slug(request)
29 29 c.hg_app_user = session.get('hg_app_user', AuthUser())
30 30 c.cached_repo_list = _get_repos_cached()
31 31 self.sa = meta.Session
32 32
33 33 def __call__(self, environ, start_response):
34 34 """Invoke the Controller"""
35 35 # WSGIController.__call__ dispatches to the Controller method
36 36 # the request is routed to. This routing information is
37 37 # available in environ['pylons.routes_dict']
38 38 try:
39 39 return WSGIController.__call__(self, environ, start_response)
40 40 finally:
41 41 meta.Session.remove()
General Comments 0
You need to be logged in to leave comments. Login now