Changeset 96

Show
Ignore:
Timestamp:
2009年08月23日 15时40分34秒 (2 years ago)
Author:
jiangx
Message:

Fixed #28: downgrade pylons framework from 0.9.7 to 0.9.6.2

Location:
branches/0.2.1.x
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • branches/0.2.1.x/pySvnManager.egg-info/requires.txt

    r55 r96  
    1 Pylons>=0.9.7rc1 
     1Pylons==0.9.6.2 
    22docutils 
    33Babel 
  • branches/0.2.1.x/pysvnmanager/config/environment.py

    r55 r96  
    11"""Pylons environment configuration""" 
    2 # -*- coding: utf-8 -*- 
    32import os 
    43 
    5 from mako.lookup import TemplateLookup 
    64from pylons import config 
    75 
     
    2220 
    2321    # 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) 
    2524 
    2625    config['routes.map'] = make_map() 
    27     config['pylons.app_globals'] = app_globals.Globals() 
     26    config['pylons.g'] = app_globals.Globals() 
    2827    config['pylons.h'] = pysvnmanager.lib.helpers 
    2928 
    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 
    3932    # CONFIGURATION OPTIONS HERE (note: all config options will override 
    4033    # any Pylons config options) 
  • branches/0.2.1.x/pysvnmanager/config/middleware.py

    r55 r96  
    11"""Pylons middleware initialization""" 
    2 from beaker.middleware import CacheMiddleware, SessionMiddleware 
    32from paste.cascade import Cascade 
    43from paste.registry import RegistryManager 
    54from paste.urlparser import StaticURLParser 
    65from paste.deploy.converters import asbool 
     6 
    77from pylons import config 
    8 from pylons.middleware import ErrorHandler, StatusCodeRedirect 
     8from pylons.error import error_template 
     9from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \ 
     10    StaticJavascripts 
    911from pylons.wsgiapp import PylonsApp 
    10 from routes.middleware import RoutesMiddleware 
    1112 
    1213from pysvnmanager.config.environment import load_environment 
     
    2627 
    2728    ``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> 
    3031        defaults to main). 
    31  
    3232    """ 
    3333    # Configure the Pylons environment 
     
    3636    # The Pylons WSGI app 
    3737    app = PylonsApp() 
    38      
     38 
    3939    # 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 
    4641    if asbool(full_stack): 
    4742        # 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']) 
    4945 
    5046        # Display error documents for 401, 403, 404 status codes (and 
    5147        # 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) 
    5649 
    5750    # Establish the Registry for this application 
    5851    app = RegistryManager(app) 
    5952 
    60     # Static files (If running in production, and Apache or another web  
    61     # server is handling this static content, remove the following 3 lines) 
     53    # Static files 
     54    javascripts_app = StaticJavascripts() 
    6255    static_app = StaticURLParser(config['pylons.paths']['static_files']) 
    63     app = Cascade([static_app, app]) 
     56    app = Cascade([static_app, javascripts_app, app]) 
    6457    return app 
  • branches/0.2.1.x/pysvnmanager/controllers/error.py

    r55 r96  
    2121 
    2222from paste.urlparser import StaticURLParser 
    23 from pylons import request 
    24 from pylons.controllers.util import forward 
    2523from pylons.middleware import error_document_template, media_path 
    26 from webhelpers.html.builder import literal 
    2724 
    28 from pysvnmanager.lib.base import BaseController 
     25from pysvnmanager.lib.base import * 
    2926 
    3027class ErrorController(BaseController): 
     
    4037    def document(self): 
    4138        """Render the error document""" 
    42         resp = request.environ.get('pylons.original_response') 
    43         content = literal(resp.body) or cgi.escape(request.GET.get('message')) 
    4439        page = error_document_template % \ 
    4540            dict(prefix=request.environ.get('SCRIPT_NAME', ''), 
    46                  code=cgi.escape(request.GET.get('code', str(resp.status_int))), 
    47                  message=content) 
     41                 code=cgi.escape(request.params.get('code', '')), 
     42                 message=cgi.escape(request.params.get('message', ''))) 
    4843        return page 
    4944 
  • branches/0.2.1.x/pysvnmanager/lib/app_globals.py

    r55 r96  
    1717 
    1818"""The application's Globals object""" 
     19from pylons import config 
    1920 
    2021class Globals(object): 
  • branches/0.2.1.x/pysvnmanager/lib/base.py

    r81 r96  
    1818"""The base Controller API 
    1919 
    20 Provides the BaseController class for subclassing. 
     20Provides the BaseController class for subclassing, and other objects 
     21utilized by Controllers. 
    2122""" 
     23from pylons import c, cache, config, g, request, response, session 
    2224from pylons.controllers import WSGIController 
    23 from pylons.templating import render_mako as render 
    24  
    25 from pylons import c, cache, config, g, request, response, session 
    2625from pylons.controllers.util import abort, etag_cache, redirect_to 
    2726from pylons.decorators import jsonify, validate 
    2827from pylons.i18n import _, ungettext, N_ 
     28from pylons.templating import render 
    2929from pylons.i18n import set_lang, add_fallback 
    3030import pysvnmanager.lib.helpers as h 
     
    7070        # the request is routed to. This routing information is 
    7171        # available in environ['pylons.routes_dict'] 
    72  
    7372        return WSGIController.__call__(self, environ, start_response) 
    7473 
  • branches/0.2.1.x/pysvnmanager/websetup.py

    r55 r96  
    3030log = logging.getLogger(__name__) 
    3131 
    32 def setup_app(command, conf, vars): 
     32def setup_config(command, filename, section, vars): 
    3333    """Place any commands to setup pysvnmanager here""" 
     34    conf = appconfig('config:' + filename) 
    3435    load_environment(conf.global_conf, conf.local_conf) 
    3536 
  • branches/0.2.1.x/setup.cfg

    r55 r96  
    55[easy_install] 
    66find_links = http://www.pylonshq.com/download/ 
     7 
     8[pudge] 
     9theme = pythonpaste.org 
     10 
     11# Add extra doc files here with spaces between them 
     12docs = docs/index.txt 
     13 
     14# Doc Settings 
     15doc_base = docs/ 
     16dest = docs/html 
     17 
     18# Add extra modules here separated with commas 
     19modules = pysvnmanager 
     20title = Pysvnmanager 
     21organization = Pylons 
     22 
     23# Highlight code-block sections with Pygments 
     24highlighter = pygments 
     25 
     26# Optionally add extra links 
     27#organization_url = http://pylonshq.com/ 
     28#trac_url = http://pylonshq.com/project 
     29settings = no_about=true 
     30 
     31# Optionally add extra settings 
     32#           link1=/community/ Community 
     33#           link2=/download/ Download 
     34 
     35[publish] 
     36doc-dir=docs/html 
     37make-dirs=1 
    738 
    839# Babel configuration 
  • branches/0.2.1.x/setup.py

    r55 r96  
    2626setup( 
    2727    name='pySvnManager', 
    28     version="0.3.0", 
     28    version="0.2.2", 
    2929    description='SVN authz web management tools.', 
    3030    author='Jiang Xin', 
     
    3232    url='https://sourceforge.net/projects/pysvnmanager', 
    3333    install_requires=[ 
    34             "Pylons>=0.9.7rc1", 
     34            "Pylons==0.9.6.2", 
    3535            "docutils", 
    3636            "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", 
    4040            #"python-ldap", 
    4141    ],