PK H4'~iD D EGG-INFO/entry_points.txt
[paste.paster_command]
controller=pylons.commands:ControllerCommand
compile_templates=pylons.commands:CompileCommand
[paste.paster_create_template]
pylons=pylons.util:PylonsTemplate
[distutils.commands]
lang_extract = pylons.i18n:LangExtract
lang_compile = pylons.i18n:LangCompile
PK ﳼ4 EGG-INFO/not-zip-safePK H46p_ EGG-INFO/PKG-INFOMetadata-Version: 1.0
Name: Pylons
Version: 0.8.2
Summary: Pylons Web Framework
Home-page: http://pylons.groovie.org/
Author: Ben Bangert, James Gardner
Author-email: ben@groovie.org
License: UNKNOWN
Description:
The Pylons web framework is aimed at making webapps and large programmatic website
development in Python easy. Several key points:
* A framework to make writing web applications in Python easy
* Inspired by Rails and TurboGears
* Utilizes a minimalist, component-based philosophy that makes it easy to expand on
* Built mainly as a customization of Myghty with Routes and Paste integration
* Harness existing knowledge about Python
Knowing Python makes Pylons easy
---------------------------------
Pylons makes it easy to expand on your knowledge of Python to master Pylons for web
development. Using a MVC style dispath, Python knowledge is used at various levels:
* The Controller is just a basic Python class, called for each request. Customizing the
response is as easy as overriding __call__ to make your webapp work how you want.
* Myghty templating compiles directly to Python byte-code for speed and utilizes Python
for template control rather than creating its own template syntax for "for, while, etc"
Current Status
---------------
Pylons is currently quite stable (built mostly with the mature Myghty package), and is
being used in production environments. Dependant packages are automatically installed
from the following URL:
* `Dependant Packages svn `_
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
PK H4}>y9Y Y EGG-INFO/requires.txtRoutes>=1.3.2
Myghty>=1.0.1
Paste>=0.9.3
PasteDeploy>=0.5
PasteScript>=0.5
simplejson>=1.3
WSGIUtils>=0.7
WebHelpers>=0.1.2
nose>=0.8.7
[test]
py>=0.8.0_alpha2
[cheetah]
Cheetah>=1.0
TurboCheetah>=0.9.5
[pudge]
docutils>=0.4
elementtree>=1.2.6
kid>=0.9
pudge==dev,>=0.1.1dev
buildutils==dev,>=0.1.2dev
[kid]
kid>=0.9
TurboKid==dev,>=0.9.1devPK H4^QW W EGG-INFO/SOURCES.txtCHANGELOG
README.txt
setup.cfg
setup.py
Pylons.egg-info/PKG-INFO
Pylons.egg-info/SOURCES.txt
Pylons.egg-info/entry_points.txt
Pylons.egg-info/not-zip-safe
Pylons.egg-info/requires.txt
Pylons.egg-info/top_level.txt
docs/adding_docs.txt
docs/advanced.txt
docs/application_configuration.txt
docs/application_setup.txt
docs/cred.txt
docs/deployment.txt
docs/development.txt
docs/error_documents.txt
docs/faq.txt
docs/getting_started.txt
docs/index.txt
docs/install.txt
docs/interactive_debugger.txt
docs/internationalisation.txt
docs/logging.txt
docs/pylonsdev.txt
docs/security.txt
docs/security2.txt
docs/strangeness.txt
docs/template_plugins.txt
docs/testing_web_application.txt
docs/webserver_config.txt
docs/windowsnotes.txt
docs/wsgi.txt
docs/pudge_template/class.html
docs/pudge_template/common.html
docs/pudge_template/document.html
docs/pudge_template/layout.css
docs/pudge_template/layout.html
docs/pudge_template/master-index.html
docs/pudge_template/member.html
docs/pudge_template/module-index.html
docs/pudge_template/module.html
docs/pudge_template/package-index.html
docs/pudge_template/pudge.css
docs/pudge_template/rst.css
docs/pudge_template/transitions.html
ez_setup/README.txt
ez_setup/__init__.py
pylons/__init__.py
pylons/commands.py
pylons/config.py
pylons/controllers.py
pylons/database.py
pylons/error.py
pylons/helpers.py
pylons/middleware.py
pylons/myghtyroutes.py
pylons/util.py
pylons/wsgiapp.py
pylons/decorators/__init__.py
pylons/decorators/rest.py
pylons/i18n/__init__.py
pylons/i18n/msgfmt.py
pylons/i18n/pygettext.py
pylons/i18n/translation.py
pylons/media/img/bar-bg.png
pylons/media/img/bg.jpg
pylons/media/img/hatch-yellow.png
pylons/media/img/header.png
pylons/media/img/highlight.png
pylons/media/img/icon-16.png
pylons/media/img/logo.gif
pylons/media/img/main-nav-bg-on.png
pylons/media/img/main-nav-bg.png
pylons/media/img/plus.jpg
pylons/media/img/tab-brown.png
pylons/media/img/tab-white.png
pylons/media/img/tab-yellow-highlight.png
pylons/media/img/tab-yellow.png
pylons/media/img/warning.gif
pylons/media/style/orange.css
pylons/templates/__init__.py
pylons/templates/controller.py_tmpl
pylons/templates/test_controller.py_tmpl
pylons/templates/paster_template/README.txt_tmpl
pylons/templates/paster_template/development.ini_tmpl
pylons/templates/paster_template/setup.cfg_tmpl
pylons/templates/paster_template/setup.py_tmpl
pylons/templates/paster_template/+package+/__init__.py_tmpl
pylons/templates/paster_template/+package+/websetup.py_tmpl
pylons/templates/paster_template/+package+/components/empty.myt
pylons/templates/paster_template/+package+/config/__init__.py_tmpl
pylons/templates/paster_template/+package+/config/environment.py_tmpl
pylons/templates/paster_template/+package+/config/middleware.py_tmpl
pylons/templates/paster_template/+package+/config/routing.py_tmpl
pylons/templates/paster_template/+package+/controllers/__init__.py_tmpl
pylons/templates/paster_template/+package+/controllers/error.py_tmpl
pylons/templates/paster_template/+package+/controllers/template.py_tmpl
pylons/templates/paster_template/+package+/docs/index.txt_tmpl
pylons/templates/paster_template/+package+/i18n/__init__.py_tmpl
pylons/templates/paster_template/+package+/lib/__init__.py_tmpl
pylons/templates/paster_template/+package+/lib/app_globals.py_tmpl
pylons/templates/paster_template/+package+/lib/base.py_tmpl
pylons/templates/paster_template/+package+/lib/helpers.py_tmpl
pylons/templates/paster_template/+package+/models/__init__.py_tmpl
pylons/templates/paster_template/+package+/public/index.html_tmpl
pylons/templates/paster_template/+package+/templates/autohandler
pylons/templates/paster_template/+package+/tests/__init__.py_tmpl
pylons/templates/paster_template/+package+/tests/test_models.py_tmpl
pylons/templates/paster_template/+package+/tests/functional/__init__.py_tmpl
pylons/templates/paster_template/+project+.egg-info/paste_deploy_config.ini_tmpl_tmpl
tests/__init__.py
tests/conftest.py
tests/test_units/__init__.py
tests/test_webapps/test_make_project.py
tests/test_webapps/test_files/app_globals.py
tests/test_webapps/test_files/controller_test1.py
tests/test_webapps/test_files/functional_test_controller_test1.py
PK H4zm\
EGG-INFO/top_level.txttests
pylons
PK B4DF F pylons/__init__.py"""Base objects to be exported for use in Controllers"""
from pylons.controllers import Controller, RPCController
from pylons.decorators import jsonify
from pylons.helpers import SessionProxy, RequestProxy, MyghtyProxy, GlobalsProxy, RequestArgProxy
from pylons.util import RequestLocal, Buffet, Helpers
m = MyghtyProxy()
c = RequestLocal()
g = GlobalsProxy()
session = SessionProxy()
request = RequestProxy()
buffet = Buffet()
params = RequestArgProxy()
h = Helpers(m=m, c=c, session=session, request=request, buffet=buffet)
__all__ = ['Controller', 'RPCController', 'jsonify']
PK I4M- - pylons/__init__.pyc;
qDc @ s d Z d k l Z l Z d k l Z d k l Z l Z l Z l
Z
l Z d k l
Z
l Z l Z e Z e
Z e
Z e Z e Z e Z e Z e d e d e d e d e d e Z d
d d g Z d
S( s2 Base objects to be exported for use in Controllers( s
Controllers
RPCController( s jsonify( s SessionProxys RequestProxys MyghtyProxys GlobalsProxys RequestArgProxy( s RequestLocals Buffets Helperss ms cs sessions requests buffets
Controllers
RPCControllers jsonifyN( s __doc__s pylons.controllerss
Controllers
RPCControllers pylons.decoratorss jsonifys pylons.helperss SessionProxys RequestProxys MyghtyProxys GlobalsProxys RequestArgProxys pylons.utils RequestLocals Buffets Helperss ms cs gs sessions requests buffets paramss hs __all__( s RequestProxys cs __all__s gs SessionProxys requests jsonifys ms Buffets RequestArgProxys GlobalsProxys
Controllers sessions Helperss RequestLocals hs
RPCControllers paramss buffets MyghtyProxy( ( s? build/bdist.darwin-8.6.0-Power_Macintosh/egg/pylons/__init__.pys ? s
% 'PK Z4[T T pylons/commands.py"""Paster Commands, for use with paster in your project
The command(s) listed here are for use with Paste to enable easy creation of
various core Pylons templates.
Currently available commands are::
controller
"""
import os
import glob
from paste.script.command import Command, BadCommand
from paste.script.filemaker import FileOp
from paste.script import pluginlib, copydir
class ControllerCommand(Command):
"""Create a Controller and functional test for it
The Controller command will create the standard controller template
file and associated functional test to speed creation of controllers.
Example usage::
yourproj% paster controller comments
Creating yourproj/yourproj/controllers/comments.py
Creating yourproj/yourproj/tests/functional/test_comments.py
If you'd like to have controllers underneath a directory, just include
the path as the controller name and the necessary directories will be
created for you::
yourproj% paster controller admin/trackback
Creating yourproj/controllers/admin
Creating yourproj/yourproj/controllers/admin/trackback.py
Creating yourproj/yourproj/tests/functional/test_admin_trackback.py
"""
summary = "Create Controller"
usage = 'CONTROLLER_NAME'
min_args = 1
max_args = 1
group_name = 'pylons'
parser = Command.standard_parser(simulate=True)
parser.add_option('--no-test',
action='store_true',
dest='no_test',
help="Don't create the test; just the controller")
def command(self):
try:
self.verbose = 3
fo = FileOp(source_dir=os.path.join(os.path.dirname(__file__), 'templates'))
try:
name, dir = fo.parse_path_name_args(self.args[0])
except:
raise BadCommand('No egg_info directory was found')
fullname = os.path.join(dir, name)
if not fullname.startswith(os.sep): fullname = os.sep + fullname
testname = fullname.replace(os.sep, '_')[1:]
fo.template_vars.update({'name': name.title().replace('-', '_'),
'fullname': fullname,
'fname': os.path.join(dir, name),
'lname': name})
fo.copy_file(template='controller.py_tmpl',
dest=os.path.join('controllers', dir), filename=name)
if not self.options.no_test:
fo.copy_file(template='test_controller.py_tmpl',
dest=os.path.join('tests', 'functional'),
filename='test_'+testname)
except:
import sys
msg = str(sys.exc_info()[1])
raise BadCommand('An unknown error ocurred, %s' % msg)
PK I4P P pylons/commands.pyc;
wxDc @ se d Z d k Z d k Z d k l Z l Z d k l Z d k l Z l
Z
d e f d YZ d S( s Paster Commands, for use with paster in your project
The command(s) listed here are for use with Paste to enable easy creation of
various core Pylons templates.
Currently available commands are::
controller
N( s Commands
BadCommand( s FileOp( s pluginlibs copydirs ControllerCommandc B sf t Z d Z d Z d Z d Z d Z d Z e i d e
Z e i d d d d d
d d d
Z
RS( s8 Create a Controller and functional test for it
The Controller command will create the standard controller template
file and associated functional test to speed creation of controllers.
Example usage::
yourproj% paster controller comments
Creating yourproj/yourproj/controllers/comments.py
Creating yourproj/yourproj/tests/functional/test_comments.py
If you'd like to have controllers underneath a directory, just include
the path as the controller name and the necessary directories will be
created for you::
yourproj% paster controller admin/trackback
Creating yourproj/controllers/admin
Creating yourproj/yourproj/controllers/admin/trackback.py
Creating yourproj/yourproj/tests/functional/test_admin_trackback.py
s Create Controllers CONTROLLER_NAMEi s pylonss simulates --no-tests actions
store_trues dests no_tests helps* Don't create the test; just the controllerc C s yd | _ t d t i i t i i t d } y | i | i
d \ } } Wn t
d n Xt i i | | } | i t i o t i | } n | i t i d d } | i i h d | i i d d <d
| <d t i i | | <d | < | i d
d d t i i d | d | | i i o3 | i d
d d t i i d d d d | n Wn6 d k } t | i d } t
d | n Xd S( Ni s
source_dirs templatesi s No egg_info directory was founds _i s names -s fullnames fnames lnames templates controller.py_tmpls dests controllerss filenames test_controller.py_tmpls testss
functionals test_s An unknown error ocurred, %s( s selfs verboses FileOps oss paths joins dirnames __file__s fos parse_path_name_argss argss names dirs
BadCommands fullnames
startswiths seps replaces testnames
template_varss updates titles copy_files optionss no_tests syss strs exc_infos msg( s selfs names testnames syss msgs fullnames dirs fo( ( s? build/bdist.darwin-8.6.0-Power_Macintosh/egg/pylons/commands.pys command2 s, * U ( s __name__s
__module__s __doc__s summarys usages min_argss max_argss
group_names Commands standard_parsers Trues parsers
add_options command( ( ( s? build/bdist.darwin-8.6.0-Power_Macintosh/egg/pylons/commands.pys ControllerCommand s
( s __doc__s oss globs paste.script.commands Commands
BadCommands paste.script.filemakers FileOps paste.scripts pluginlibs copydirs ControllerCommand( s pluginlibs globs ControllerCommands FileOps copydirs Commands oss
BadCommand( ( s? build/bdist.darwin-8.6.0-Power_Macintosh/egg/pylons/commands.pys ? s
PK Z4
pylons/config.py"""Configuration setup for Myghty, and Paste error middleware
This module supplies pylons_config which handles setting up defaults
for Myghty, Paste errorware, and prefixing Routes if necessary.
"""
import os
from myghty.resolver import *
from paste.deploy.converters import asbool
import pylons.myghtyroutes
class Config(object):
"""Pylons configuration object
The Pylons configuration object is a per-application instance object
that retains the information regarding the global and app conf's as
well as per-application instance specific data such as the mapper, the
paths for this instance, and the myghty configuration.
The Config object is available in your application as a Pylons global
``pylons_config`` under the ``g`` object. There's several useful
attributes of the config object most people will be interested in:
``myghty``
The myghty configuration dict that was used to initialize Myghty
``map``
Mapper object used for Routing. Yes, it is possible to add routes
after your application has started running.
``paths``
An array of absolute paths that were defined in the applications
``config/environment.py`` module.
``global_conf``
Global configuration passed in from Paste, this corresponds to the
DEFAULTS section in the config file.
``app_conf``
Application specific configuration directives, passed in via Paste
from the app section of the config file.
"""
def __init__(self, myghty, map, paths):
self.myghty = myghty
self.map = map
self.paths = paths
self.global_conf = {}
self.app_conf = {}
def init_app(self, global_conf, app_conf, package):
"""Initialize configuration for the application
``global_config``
Several options are expected to be set for a Pylons web application.
They will be loaded from the global_config which has the main Paste
options. If ``debug`` is set to ``false`` as a global config option,
the following option *must* be set:
* error_to - The email address to send the debug error to
The optional config options in this case are:
* smtp_server - The SMTP server to use, defaults to 'localhost'
* error_log - A logfile to write the error to
* error_subject_prefix - The prefix of the error email subject
* from_address - Whom the error email should be from
``app_conf``
Defaults supplied via the [app:main] section from the Paste
config file. ``load_config`` only cares about whether a 'prefix'
option is set, if so it will update Routes to ensure URL's take
that into account.
``package``
The name of the application package, to be stored in the app_conf.
"""
self.global_conf = global_conf
self.app_conf = app_conf
self.package = package
app_conf['package'] = package
# Setup the prefix to override the routes if necessary.
prefix = app_conf.get('prefix')
if not prefix:
prefix = global_conf.get('prefix')
if prefix:
self.map.prefix = app_conf['prefix']
self.map._created_regs = False
cache_dir = app_conf.get('cache_dir')
if not cache_dir:
cache_dir = global_conf.get('cache_dir')
if not cache_dir:
raise Exception("No 'cache_dir' key specified in the config file.")
app_uuid = app_conf.get('app_instance_uuid') or global_conf.get('app_instance_uuid')
if not app_uuid:
raise Exception("No 'app__uuid' key specified in the config file.")
cache_dir = os.path.join(cache_dir, app_uuid)
myghty_defaults = {}
# Where does the sessions/cache/etc. go for this instance of the webapp?
myghty_defaults['data_dir'] = cache_dir
session_dir = app_conf.get('session_data_dir') or global_conf.get('session_data_dir')
if session_dir:
myghty_defaults['session_data_dir'] = session_dir
myghty_defaults['session_key'] = app_conf.get('session_key') or global_conf.get('session_key')
myghty_defaults['session_secret'] = app_conf.get('session_secret') or global_conf.get('session_secret')
# Raise a complete error for the error middleware to catch
myghty_defaults['raise_error'] = True
# Standard Pylons configuration directives for Myghty
myghty_defaults.setdefault('allow_globals', [])
myghty_defaults['allow_globals'].extend(['c', 'h', 's', 'session', 'request', 'g'])
myghty_defaults['component_root'] = [{os.path.basename(path): path} for \
path in self.paths['templates']]
# Pylons resolver strategy
myghty_defaults['resolver_strategy'] = [
ConditionalGroup(
context = 'request',
rules = [
PathTranslate(),
pylons.myghtyroutes.RoutesResolver(
mapper=self.map,
controller_root=self.paths['controllers'],
scan_controllers=asbool(global_conf.get('debug', 'true'))),
NotFound(),
]
),
URICache(rule = ResolveFile()),
ResolveUpwards(),
ResolveFile(),
]
errorware = {}
# Load the errorware configuration from the Paste configuration file
# These all have defaults, and emails are only sent if configured and
# if this application is running in production mode
errorware['debug'] = asbool(global_conf.get('debug', 'true'))
if not errorware['debug']:
errorware['debug'] = False
errorware['error_email'] = global_conf.get('email_to')
errorware['error_log'] = global_conf.get('error_log', None)
errorware['smtp_server'] = global_conf.get('smtp_server', 'localhost')
errorware['error_subject_prefix'] = global_conf.get('error_subject_prefix', 'WebApp Error: ')
errorware['from_address'] = global_conf.get('from_address',
global_conf.get('error_email_from', 'pylons@yourapp.com'))
errorware['error_message'] = global_conf.get('error_message', 'An internal server error occurred')
# Merge in the user-supplied Myghty values
myghty_defaults.update(self.myghty)
self.myghty = myghty_defaults
# Save our errorware values
self.errorware = errorware
PK I4 pylons/config.pyc;
wxDc @ sF d Z d k Z d k Td k l Z d k Z d e f d YZ d S( s Configuration setup for Myghty, and Paste error middleware
This module supplies pylons_config which handles setting up defaults
for Myghty, Paste errorware, and prefixing Routes if necessary.
N( s *( s asbools Configc B s t Z d Z d Z d Z RS( s Pylons configuration object
The Pylons configuration object is a per-application instance object
that retains the information regarding the global and app conf's as
well as per-application instance specific data such as the mapper, the
paths for this instance, and the myghty configuration.
The Config object is available in your application as a Pylons global
``pylons_config`` under the ``g`` object. There's several useful
attributes of the config object most people will be interested in:
``myghty``
The myghty configuration dict that was used to initialize Myghty
``map``
Mapper object used for Routing. Yes, it is possible to add routes
after your application has started running.
``paths``
An array of absolute paths that were defined in the applications
``config/environment.py`` module.
``global_conf``
Global configuration passed in from Paste, this corresponds to the
DEFAULTS section in the config file.
``app_conf``
Application specific configuration directives, passed in via Paste
from the app section of the config file.
c C s1 | | _ | | _ | | _ h | _ h | _ d S( N( s myghtys selfs maps pathss global_confs app_conf( s selfs myghtys maps paths( ( s= build/bdist.darwin-8.6.0-Power_Macintosh/egg/pylons/config.pys __init__' s
c C s~ | | _ | | _ | | _ | | d <| i d } | o | i d } n | o | d | i _ t | i _ n | i d } | ow | i d } | o t
d n | i d p
| i d } | o t
d n t i
i | | } n h } | | d <| i d p
| i d }
|
o |
| d