diff options
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/app.py_tmpl | 15 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/templates/error.html | 2 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/templates/index.html | 38 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/templates/layout.html | 16 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/tests/__init__.py_tmpl | 2 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/tests/config.py_tmpl | 22 | ||||
-rw-r--r-- | pecan/scaffolds/base/+package+/tests/test_functional.py_tmpl | 6 | ||||
-rw-r--r-- | pecan/scaffolds/base/config.py_tmpl | 4 | ||||
-rw-r--r-- | pecan/scaffolds/base/setup.py_tmpl | 20 |
10 files changed, 64 insertions, 62 deletions
diff --git a/.travis.yml b/.travis.yml index ca7f522..eecdb65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - PYTHONPATH='.' branches: only: + - master - next install: pip install -r requirements.txt --use-mirrors script: python setup.py test --functional diff --git a/pecan/scaffolds/base/+package+/app.py_tmpl b/pecan/scaffolds/base/+package+/app.py_tmpl index ca6c5f9..24d0dfe 100644 --- a/pecan/scaffolds/base/+package+/app.py_tmpl +++ b/pecan/scaffolds/base/+package+/app.py_tmpl @@ -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) ) diff --git a/pecan/scaffolds/base/+package+/templates/error.html b/pecan/scaffolds/base/+package+/templates/error.html index d8b4561..f2d9796 100644 --- a/pecan/scaffolds/base/+package+/templates/error.html +++ b/pecan/scaffolds/base/+package+/templates/error.html @@ -7,6 +7,6 @@ ## now define the body of the template <header> - <h1>Server Error ${status}</h1> + <h1>Server Error ${status}</h1> </header> <p>${message}</p> diff --git a/pecan/scaffolds/base/+package+/templates/index.html b/pecan/scaffolds/base/+package+/templates/index.html index 5215546..ce01e11 100644 --- a/pecan/scaffolds/base/+package+/templates/index.html +++ b/pecan/scaffolds/base/+package+/templates/index.html @@ -7,28 +7,28 @@ ## now define the body of the template <header> - <h1><img src="/images/logo.png" /></h1> + <h1><img src="/images/logo.png" /></h1> </header> <div id="content"> - <p>This is a sample Pecan project.</p> - - <p> - Instructions for getting started can be found online at <a - href="http://pecanpy.org" target="window">pecanpy.org</a> - </p> - - <p> - ...or you can search the documentation here: - </p> - - <form method="POST" action="/"> - <fieldset> - <input name="q" /> - <input type="submit" value="Search" /> - <fieldset> - <small>Enter search terms or a module, class or function name.</small> - </form> + <p>This is a sample Pecan project.</p> + + <p> + Instructions for getting started can be found online at <a + href="http://pecanpy.org" target="window">pecanpy.org</a> + </p> + + <p> + ...or you can search the documentation here: + </p> + + <form method="POST" action="/"> + <fieldset> + <input name="q" /> + <input type="submit" value="Search" /> + <fieldset> + <small>Enter search terms or a module, class or function name.</small> + </form> </div> diff --git a/pecan/scaffolds/base/+package+/templates/layout.html b/pecan/scaffolds/base/+package+/templates/layout.html index 6209e23..4090859 100644 --- a/pecan/scaffolds/base/+package+/templates/layout.html +++ b/pecan/scaffolds/base/+package+/templates/layout.html @@ -1,12 +1,12 @@ <html> - <head> - <title>${self.title()}</title> - ${self.style()} - ${self.javascript()} - </head> - <body> - ${self.body()} - </body> + <head> + <title>${self.title()}</title> + ${self.style()} + ${self.javascript()} + </head> + <body> + ${self.body()} + </body> </html> <%def name="title()"> diff --git a/pecan/scaffolds/base/+package+/tests/__init__.py_tmpl b/pecan/scaffolds/base/+package+/tests/__init__.py_tmpl index 91d3340..78ea527 100644 --- a/pecan/scaffolds/base/+package+/tests/__init__.py_tmpl +++ b/pecan/scaffolds/base/+package+/tests/__init__.py_tmpl @@ -11,7 +11,7 @@ class FunctionalTest(TestCase): Used for functional tests where you need to test your literal application and its integration with the framework. """ - + def setUp(self): self.app = load_test_app(os.path.join( os.path.dirname(__file__), diff --git a/pecan/scaffolds/base/+package+/tests/config.py_tmpl b/pecan/scaffolds/base/+package+/tests/config.py_tmpl index ba71dac..b745a8c 100644 --- a/pecan/scaffolds/base/+package+/tests/config.py_tmpl +++ b/pecan/scaffolds/base/+package+/tests/config.py_tmpl @@ -1,25 +1,25 @@ # 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 } } # Custom Configurations must be in Python dictionary format:: # # foo = {'bar':'baz'} -# +# # All configurations are accessible at:: # pecan.conf diff --git a/pecan/scaffolds/base/+package+/tests/test_functional.py_tmpl b/pecan/scaffolds/base/+package+/tests/test_functional.py_tmpl index be54cc7..beb89ee 100644 --- a/pecan/scaffolds/base/+package+/tests/test_functional.py_tmpl +++ b/pecan/scaffolds/base/+package+/tests/test_functional.py_tmpl @@ -4,16 +4,16 @@ from ${package}.tests import FunctionalTest class TestRootController(FunctionalTest): - + def test_get(self): response = self.app.get('/') 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' - + def test_get_not_found(self): response = self.app.get('/a/bogus/url', expect_errors=True) assert response.status_int == 404 diff --git a/pecan/scaffolds/base/config.py_tmpl b/pecan/scaffolds/base/config.py_tmpl index 06507d9..e37ffb0 100644 --- a/pecan/scaffolds/base/config.py_tmpl +++ b/pecan/scaffolds/base/config.py_tmpl @@ -8,7 +8,7 @@ server = { app = { 'root': '${package}.controllers.root.RootController', 'modules': ['${package}'], - 'static_root': '%(confdir)s/public', + 'static_root': '%(confdir)s/public', 'template_path': '%(confdir)s/${package}/templates', 'debug': True, 'errors': { @@ -19,7 +19,7 @@ app = { logging = { 'loggers': { - 'root' : {'level': 'INFO', 'handlers': ['console']}, + 'root': {'level': 'INFO', 'handlers': ['console']}, '${package}': {'level': 'DEBUG', 'handlers': ['console']} }, 'handlers': { diff --git a/pecan/scaffolds/base/setup.py_tmpl b/pecan/scaffolds/base/setup.py_tmpl index ed32100..ec47896 100644 --- a/pecan/scaffolds/base/setup.py_tmpl +++ b/pecan/scaffolds/base/setup.py_tmpl @@ -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']) ) |