Merge pull request #154 from marksteve/next

Base scaffold cleanup
This commit is contained in:
Ryan Petrello
2012-12-09 20:19:38 -08:00
10 changed files with 63 additions and 61 deletions

View File

@@ -6,6 +6,7 @@ env:
- PYTHONPATH='.'
branches:
only:
- master
- next
install: pip install -r requirements.txt --use-mirrors
script: python setup.py test --functional

View File

@@ -1,15 +1,16 @@
from pecan import make_app
from ${package} import model
def setup_app(config):
model.init_model()
return make_app(
config.app.root,
static_root = config.app.static_root,
template_path = config.app.template_path,
logging = getattr(config, 'logging', {}),
debug = getattr(config.app, 'debug', False),
force_canonical = getattr(config.app, 'force_canonical', True)
static_root=config.app.static_root,
template_path=config.app.template_path,
logging=getattr(config, 'logging', {}),
debug=getattr(config.app, 'debug', False),
force_canonical=getattr(config.app, 'force_canonical', True)
)

View File

@@ -1,19 +1,19 @@
# Server Specific Configurations
server = {
'port' : '8080',
'host' : '0.0.0.0'
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root' : '${package}.controllers.root.RootController',
'modules' : ['${package}'],
'static_root' : '%(confdir)s/../../public',
'template_path' : '%(confdir)s/../templates',
'debug' : True,
'errors' : {
'404' : '/error/404',
'__force_dict__' : True
'root': '${package}.controllers.root.RootController',
'modules': ['${package}'],
'static_root': '%(confdir)s/../../public',
'template_path': '%(confdir)s/../templates',
'debug': True,
'errors': {
'404': '/error/404',
'__force_dict__': True
}
}

View File

@@ -10,7 +10,7 @@ class TestRootController(FunctionalTest):
assert response.status_int == 200
def test_search(self):
response = self.app.post('/', params={'q' : 'RestController'})
response = self.app.post('/', params={'q': 'RestController'})
assert response.status_int == 302
assert response.headers['Location'] == 'http://pecan.readthedocs.org/en/latest/search.html?q=RestController'

View File

@@ -19,7 +19,7 @@ app = {
logging = {
'loggers': {
'root' : {'level': 'INFO', 'handlers': ['console']},
'root': {'level': 'INFO', 'handlers': ['console']},
'${package}': {'level': 'DEBUG', 'handlers': ['console']}
},
'handlers': {

View File

@@ -7,16 +7,16 @@ except ImportError:
from setuptools import setup, find_packages
setup(
name = '${package}',
version = '0.1',
description = '',
author = '',
author_email = '',
install_requires = [
name='${package}',
version='0.1',
description='',
author='',
author_email='',
install_requires=[
"pecan",
],
test_suite = '${package}',
zip_safe = False,
include_package_data = True,
packages = find_packages(exclude=['ez_setup'])
test_suite='${package}',
zip_safe=False,
include_package_data=True,
packages=find_packages(exclude=['ez_setup'])
)