Changeset 96
- Timestamp:
- 2009年08月23日 15时40分34秒 (2 years ago)
- Location:
- branches/0.2.1.x
- Files:
-
- 9 modified
-
pySvnManager.egg-info/requires.txt (modified) (1 diff)
-
pysvnmanager/config/environment.py (modified) (2 diffs)
-
pysvnmanager/config/middleware.py (modified) (3 diffs)
-
pysvnmanager/controllers/error.py (modified) (2 diffs)
-
pysvnmanager/lib/app_globals.py (modified) (1 diff)
-
pysvnmanager/lib/base.py (modified) (2 diffs)
-
pysvnmanager/websetup.py (modified) (1 diff)
-
setup.cfg (modified) (1 diff)
-
setup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.2.1.x/pySvnManager.egg-info/requires.txt
r55 r96 1 Pylons >=0.9.7rc11 Pylons==0.9.6.2 2 2 docutils 3 3 Babel -
branches/0.2.1.x/pysvnmanager/config/environment.py
r55 r96 1 1 """Pylons environment configuration""" 2 # -*- coding: utf-8 -*-3 2 import os 4 3 5 from mako.lookup import TemplateLookup6 4 from pylons import config 7 5 … … 22 20 23 21 # Initialize config with the basic options 24 config.init_app(global_conf, app_conf, package='pysvnmanager', paths=paths) 22 config.init_app(global_conf, app_conf, package='pysvnmanager', 23 template_engine='mako', paths=paths) 25 24 26 25 config['routes.map'] = make_map() 27 config['pylons. app_globals'] = app_globals.Globals()26 config['pylons.g'] = app_globals.Globals() 28 27 config['pylons.h'] = pysvnmanager.lib.helpers 29 28 30 # Create the Mako TemplateLookup, with the default auto-escaping 31 config['pylons.app_globals'].mako_lookup = TemplateLookup( 32 directories=paths['templates'], 33 module_directory=os.path.join(app_conf['cache_dir'], 'templates'), 34 input_encoding='utf-8', output_encoding='utf-8', 35 imports=['from webhelpers.html import escape'], 36 ) 37 #default_filters=['escape']) 38 29 # Customize templating options via this variable 30 tmpl_options = config['buffet.template_options'] 31 39 32 # CONFIGURATION OPTIONS HERE (note: all config options will override 40 33 # any Pylons config options) -
branches/0.2.1.x/pysvnmanager/config/middleware.py
r55 r96 1 1 """Pylons middleware initialization""" 2 from beaker.middleware import CacheMiddleware, SessionMiddleware3 2 from paste.cascade import Cascade 4 3 from paste.registry import RegistryManager 5 4 from paste.urlparser import StaticURLParser 6 5 from paste.deploy.converters import asbool 6 7 7 from pylons import config 8 from pylons.middleware import ErrorHandler, StatusCodeRedirect 8 from pylons.error import error_template 9 from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \ 10 StaticJavascripts 9 11 from pylons.wsgiapp import PylonsApp 10 from routes.middleware import RoutesMiddleware11 12 12 13 from pysvnmanager.config.environment import load_environment … … 26 27 27 28 ``app_conf`` 28 The application's local configuration. Normally specified in 29 the[app:<name>] section of the Paste ini file (where <name>29 The application's local configuration. Normally specified in the 30 [app:<name>] section of the Paste ini file (where <name> 30 31 defaults to main). 31 32 32 """ 33 33 # Configure the Pylons environment … … 36 36 # The Pylons WSGI app 37 37 app = PylonsApp() 38 38 39 39 # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) 40 41 # Routing/Session/Cache Middleware 42 app = RoutesMiddleware(app, config['routes.map']) 43 app = SessionMiddleware(app, config) 44 app = CacheMiddleware(app, config) 45 40 46 41 if asbool(full_stack): 47 42 # Handle Python exceptions 48 app = ErrorHandler(app, global_conf, **config['pylons.errorware']) 43 app = ErrorHandler(app, global_conf, error_template=error_template, 44 **config['pylons.errorware']) 49 45 50 46 # Display error documents for 401, 403, 404 status codes (and 51 47 # 500 when debug is disabled) 52 if asbool(config['debug']): 53 app = StatusCodeRedirect(app) 54 else: 55 app = StatusCodeRedirect(app, [400, 401, 403, 404, 500]) 48 app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf) 56 49 57 50 # Establish the Registry for this application 58 51 app = RegistryManager(app) 59 52 60 # Static files (If running in production, and Apache or another web61 # server is handling this static content, remove the following 3 lines)53 # Static files 54 javascripts_app = StaticJavascripts() 62 55 static_app = StaticURLParser(config['pylons.paths']['static_files']) 63 app = Cascade([static_app, app])56 app = Cascade([static_app, javascripts_app, app]) 64 57 return app -
branches/0.2.1.x/pysvnmanager/controllers/error.py
r55 r96 21 21 22 22 from paste.urlparser import StaticURLParser 23 from pylons import request24 from pylons.controllers.util import forward25 23 from pylons.middleware import error_document_template, media_path 26 from webhelpers.html.builder import literal27 24 28 from pysvnmanager.lib.base import BaseController25 from pysvnmanager.lib.base import * 29 26 30 27 class ErrorController(BaseController): … … 40 37 def document(self): 41 38 """Render the error document""" 42 resp = request.environ.get('pylons.original_response')43 content = literal(resp.body) or cgi.escape(request.GET.get('message'))44 39 page = error_document_template % \ 45 40 dict(prefix=request.environ.get('SCRIPT_NAME', ''), 46 code=cgi.escape(request. GET.get('code', str(resp.status_int))),47 message=c ontent)41 code=cgi.escape(request.params.get('code', '')), 42 message=cgi.escape(request.params.get('message', ''))) 48 43 return page 49 44 -
branches/0.2.1.x/pysvnmanager/lib/app_globals.py
r55 r96 17 17 18 18 """The application's Globals object""" 19 from pylons import config 19 20 20 21 class Globals(object): -
branches/0.2.1.x/pysvnmanager/lib/base.py
r81 r96 18 18 """The base Controller API 19 19 20 Provides the BaseController class for subclassing. 20 Provides the BaseController class for subclassing, and other objects 21 utilized by Controllers. 21 22 """ 23 from pylons import c, cache, config, g, request, response, session 22 24 from pylons.controllers import WSGIController 23 from pylons.templating import render_mako as render24 25 from pylons import c, cache, config, g, request, response, session26 25 from pylons.controllers.util import abort, etag_cache, redirect_to 27 26 from pylons.decorators import jsonify, validate 28 27 from pylons.i18n import _, ungettext, N_ 28 from pylons.templating import render 29 29 from pylons.i18n import set_lang, add_fallback 30 30 import pysvnmanager.lib.helpers as h … … 70 70 # the request is routed to. This routing information is 71 71 # available in environ['pylons.routes_dict'] 72 73 72 return WSGIController.__call__(self, environ, start_response) 74 73 -
branches/0.2.1.x/pysvnmanager/websetup.py
r55 r96 30 30 log = logging.getLogger(__name__) 31 31 32 def setup_ app(command, conf, vars):32 def setup_config(command, filename, section, vars): 33 33 """Place any commands to setup pysvnmanager here""" 34 conf = appconfig('config:' + filename) 34 35 load_environment(conf.global_conf, conf.local_conf) 35 36 -
branches/0.2.1.x/setup.cfg
r55 r96 5 5 [easy_install] 6 6 find_links = http://www.pylonshq.com/download/ 7 8 [pudge] 9 theme = pythonpaste.org 10 11 # Add extra doc files here with spaces between them 12 docs = docs/index.txt 13 14 # Doc Settings 15 doc_base = docs/ 16 dest = docs/html 17 18 # Add extra modules here separated with commas 19 modules = pysvnmanager 20 title = Pysvnmanager 21 organization = Pylons 22 23 # Highlight code-block sections with Pygments 24 highlighter = pygments 25 26 # Optionally add extra links 27 #organization_url = http://pylonshq.com/ 28 #trac_url = http://pylonshq.com/project 29 settings = no_about=true 30 31 # Optionally add extra settings 32 # link1=/community/ Community 33 # link2=/download/ Download 34 35 [publish] 36 doc-dir=docs/html 37 make-dirs=1 7 38 8 39 # Babel configuration -
branches/0.2.1.x/setup.py
r55 r96 26 26 setup( 27 27 name='pySvnManager', 28 version="0. 3.0",28 version="0.2.2", 29 29 description='SVN authz web management tools.', 30 30 author='Jiang Xin', … … 32 32 url='https://sourceforge.net/projects/pysvnmanager', 33 33 install_requires=[ 34 "Pylons >=0.9.7rc1",34 "Pylons==0.9.6.2", 35 35 "docutils", 36 36 "Babel", 37 #"Mako>=0.2.2",38 #"WebHelpers>=0.6.1",39 #"Routes>=1.9.2",37 "Mako>=0.2.2", 38 "WebHelpers>=0.6", 39 "Routes>=1.9.2", 40 40 #"python-ldap", 41 41 ],
![(please configure the [header_logo] section in trac.ini)](/trac/pysvnmanager/chrome/common/trac_banner.png)