From 71ca8df3d9283db1389066caf5de78f07fa29eb7 Mon Sep 17 00:00:00 2001 From: Charlie Choiniere Date: Sun, 25 Mar 2012 09:54:51 -0400 Subject: [PATCH] Updated bunsen to work with Pyramid 1.3 --- .gitignore | 1 + bunsen/paster_templates/__init__.py | 9 ----- .../+package+/models/__init__.py | 15 -------- bunsen/scaffolds/__init__.py | 5 +++ .../+package+/__init__.py_tmpl | 6 ++-- .../+package+/models/__init__.py | 21 ++++++++++++ .../pyramid_template/+package+/routes.py | 0 .../+package+/scripts}/__init__.py | 0 .../+package+/scripts/initializedb.py_tmpl | 32 ++++++++++++++++++ .../+package+/static/crossdomain.xml | 0 .../+package+/static/css/normalize.css | 0 .../+package+/static/css/screen.css | 0 .../+package+/static/favicon.ico | Bin .../+package+/static/humans.txt | 0 .../+package+/static/img/pyramid-small.png | Bin .../+package+/static/img/pyramid.png | Bin .../+package+/static/img/transparent.gif | Bin .../+package+/static/js/script.js | 0 .../static/js/thirdparty/jquery-1.6.2.js | 0 .../static/js/thirdparty/jquery-1.6.2.min.js | 0 .../js/thirdparty/modernizr-2.0.6.min.js | 0 .../+package+/static/robots.txt | 0 .../+package+/subscribers.py_tmpl | 0 .../+package+/templates/404.html | 0 .../+package+/templates/500.html | 0 .../+package+/templates/base.html | 0 .../+package+/templates/index.html | 0 .../templates/macros/formhelpers.html | 0 .../pyramid_template/+package+/tests.py_tmpl | 0 .../+package+/views/__init__.py | 0 .../+package+/views/exceptions.py_tmpl | 0 .../+package+/views/home.py_tmpl | 0 .../pyramid_template/CHANGES.txt | 0 .../pyramid_template/MANIFEST.in_tmpl | 0 .../pyramid_template/README.txt_tmpl | 0 .../pyramid_template/development.ini_tmpl | 2 +- .../pyramid_template/production.ini_tmpl | 2 +- .../pyramid_template/setup.cfg_tmpl | 0 .../pyramid_template/setup.py_tmpl | 6 ++-- setup.py | 4 +-- 40 files changed, 70 insertions(+), 33 deletions(-) delete mode 100644 bunsen/paster_templates/__init__.py delete mode 100644 bunsen/paster_templates/pyramid_template/+package+/models/__init__.py create mode 100644 bunsen/scaffolds/__init__.py rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/__init__.py_tmpl (91%) create mode 100644 bunsen/scaffolds/pyramid_template/+package+/models/__init__.py rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/routes.py (100%) rename bunsen/{paster_templates/pyramid_template/+package+/views => scaffolds/pyramid_template/+package+/scripts}/__init__.py (100%) create mode 100644 bunsen/scaffolds/pyramid_template/+package+/scripts/initializedb.py_tmpl rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/crossdomain.xml (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/css/normalize.css (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/css/screen.css (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/favicon.ico (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/humans.txt (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/img/pyramid-small.png (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/img/pyramid.png (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/img/transparent.gif (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/js/script.js (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.js (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.min.js (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/js/thirdparty/modernizr-2.0.6.min.js (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/static/robots.txt (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/subscribers.py_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/templates/404.html (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/templates/500.html (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/templates/base.html (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/templates/index.html (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/templates/macros/formhelpers.html (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/tests.py_tmpl (100%) create mode 100644 bunsen/scaffolds/pyramid_template/+package+/views/__init__.py rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/views/exceptions.py_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/+package+/views/home.py_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/CHANGES.txt (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/MANIFEST.in_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/README.txt_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/development.ini_tmpl (98%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/production.ini_tmpl (98%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/setup.cfg_tmpl (100%) rename bunsen/{paster_templates => scaffolds}/pyramid_template/setup.py_tmpl (89%) diff --git a/.gitignore b/.gitignore index 7fde0ce..d554c05 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.pyc *.pyo *.DS_Store +/projectFilesBackup /tester /build /dist diff --git a/bunsen/paster_templates/__init__.py b/bunsen/paster_templates/__init__.py deleted file mode 100644 index 5f249c8..0000000 --- a/bunsen/paster_templates/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from paste.deploy.converters import asbool -from paste.script.templates import var -from paste.util.template import paste_script_template_renderer -from pyramid.paster import PyramidTemplate - -class BunsenTemplate(PyramidTemplate): - _template_dir = "pyramid_template" - summary = "A Pyramid project setup with URL Dispatch, Jinja2, SQLAlchemy, WTForms and more." - template_renderer = staticmethod(paste_script_template_renderer) diff --git a/bunsen/paster_templates/pyramid_template/+package+/models/__init__.py b/bunsen/paster_templates/pyramid_template/+package+/models/__init__.py deleted file mode 100644 index 3b59265..0000000 --- a/bunsen/paster_templates/pyramid_template/+package+/models/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -import logging -import transaction -from sqlalchemy.orm import sessionmaker, scoped_session -from sqlalchemy.ext.declarative import declarative_base -from zope.sqlalchemy import ZopeTransactionExtension - -log = logging.getLogger(__name__) - -Session = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) -Base = declarative_base() - -def initialize_sql(engine): - Base.metadata.bind = engine - Base.metadata.create_all(engine) - transaction.commit() diff --git a/bunsen/scaffolds/__init__.py b/bunsen/scaffolds/__init__.py new file mode 100644 index 0000000..8f5ad23 --- /dev/null +++ b/bunsen/scaffolds/__init__.py @@ -0,0 +1,5 @@ +from pyramid.scaffolds import PyramidTemplate + +class BunsenTemplate(PyramidTemplate): + _template_dir = "pyramid_template" + summary = "A Pyramid project setup with URL Dispatch, Jinja2, SQLAlchemy, WTForms and more." diff --git a/bunsen/paster_templates/pyramid_template/+package+/__init__.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/__init__.py_tmpl similarity index 91% rename from bunsen/paster_templates/pyramid_template/+package+/__init__.py_tmpl rename to bunsen/scaffolds/pyramid_template/+package+/__init__.py_tmpl index cd340db..542f391 100644 --- a/bunsen/paster_templates/pyramid_template/+package+/__init__.py_tmpl +++ b/bunsen/scaffolds/pyramid_template/+package+/__init__.py_tmpl @@ -4,7 +4,7 @@ import pyramid_jinja2 from pyramid.config import Configurator from sqlalchemy import engine_from_config -from {{package}}.models import initialize_sql +from {{package}}.models import DBSession def main(global_config, **settings): """ This function returns a Pyramid WSGI application. @@ -13,6 +13,7 @@ def main(global_config, **settings): # Configure database engine engine = engine_from_config(settings, 'sqlalchemy.') + DBSession.configure(bind=engine) # Configure Beaker sessions and caching session_factory = pyramid_beaker.session_factory_from_settings(settings) @@ -24,7 +25,7 @@ def main(global_config, **settings): config.add_renderer('.html', pyramid_jinja2.renderer_factory) # Configure static views - config.add_static_view('static', '{{package}}:static') + config.add_static_view('static', '{{package}}:static', cache_max_age=3600) # Configure Root-Relative static asset views. For usage documenation see # http://packages.python.org/pyramid_assetviews/#usage @@ -46,6 +47,5 @@ def main(global_config, **settings): # Initialize Database Tables config.scan("{{package}}.models") - initialize_sql(engine) return config.make_wsgi_app() diff --git a/bunsen/scaffolds/pyramid_template/+package+/models/__init__.py b/bunsen/scaffolds/pyramid_template/+package+/models/__init__.py new file mode 100644 index 0000000..c79c850 --- /dev/null +++ b/bunsen/scaffolds/pyramid_template/+package+/models/__init__.py @@ -0,0 +1,21 @@ +import logging +import transaction +from sqlalchemy.orm import sessionmaker, scoped_session +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy import Column, Integer, Text +from zope.sqlalchemy import ZopeTransactionExtension + +log = logging.getLogger(__name__) + +DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) +Base = declarative_base() + +class MyModel(Base): + __tablename__ = 'models' + id = Column(Integer, primary_key=True) + name = Column(Text, unique=True) + value = Column(Integer) + + def __init__(self, name, value): + self.name = name + self.value = value \ No newline at end of file diff --git a/bunsen/paster_templates/pyramid_template/+package+/routes.py b/bunsen/scaffolds/pyramid_template/+package+/routes.py similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/routes.py rename to bunsen/scaffolds/pyramid_template/+package+/routes.py diff --git a/bunsen/paster_templates/pyramid_template/+package+/views/__init__.py b/bunsen/scaffolds/pyramid_template/+package+/scripts/__init__.py similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/views/__init__.py rename to bunsen/scaffolds/pyramid_template/+package+/scripts/__init__.py diff --git a/bunsen/scaffolds/pyramid_template/+package+/scripts/initializedb.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/scripts/initializedb.py_tmpl new file mode 100644 index 0000000..3911b07 --- /dev/null +++ b/bunsen/scaffolds/pyramid_template/+package+/scripts/initializedb.py_tmpl @@ -0,0 +1,32 @@ +import os +import sys +import transaction + +from sqlalchemy import engine_from_config + +from pyramid.paster import get_appsettings +from pyramid.paster import setup_logging + +from {{package}}.models import DBSession +from {{package}}.models import MyModel +from {{package}}.models import Base + + +def usage(argv): + cmd = os.path.basename(argv[0]) + print('usage: %s \n' + '(example: "%s development.ini")' % (cmd, cmd)) + sys.exit(1) + +def main(argv=sys.argv): + if len(argv) != 2: + usage(argv) + config_uri = argv[1] + setup_logging(config_uri) + settings = get_appsettings(config_uri) + engine = engine_from_config(settings, 'sqlalchemy.') + DBSession.configure(bind=engine) + Base.metadata.create_all(engine) + with transaction.manager: + model = MyModel(name='one', value=1) + DBSession.add(model) \ No newline at end of file diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/crossdomain.xml b/bunsen/scaffolds/pyramid_template/+package+/static/crossdomain.xml similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/crossdomain.xml rename to bunsen/scaffolds/pyramid_template/+package+/static/crossdomain.xml diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/css/normalize.css b/bunsen/scaffolds/pyramid_template/+package+/static/css/normalize.css similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/css/normalize.css rename to bunsen/scaffolds/pyramid_template/+package+/static/css/normalize.css diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/css/screen.css b/bunsen/scaffolds/pyramid_template/+package+/static/css/screen.css similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/css/screen.css rename to bunsen/scaffolds/pyramid_template/+package+/static/css/screen.css diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/favicon.ico b/bunsen/scaffolds/pyramid_template/+package+/static/favicon.ico similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/favicon.ico rename to bunsen/scaffolds/pyramid_template/+package+/static/favicon.ico diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/humans.txt b/bunsen/scaffolds/pyramid_template/+package+/static/humans.txt similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/humans.txt rename to bunsen/scaffolds/pyramid_template/+package+/static/humans.txt diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/img/pyramid-small.png b/bunsen/scaffolds/pyramid_template/+package+/static/img/pyramid-small.png similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/img/pyramid-small.png rename to bunsen/scaffolds/pyramid_template/+package+/static/img/pyramid-small.png diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/img/pyramid.png b/bunsen/scaffolds/pyramid_template/+package+/static/img/pyramid.png similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/img/pyramid.png rename to bunsen/scaffolds/pyramid_template/+package+/static/img/pyramid.png diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/img/transparent.gif b/bunsen/scaffolds/pyramid_template/+package+/static/img/transparent.gif similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/img/transparent.gif rename to bunsen/scaffolds/pyramid_template/+package+/static/img/transparent.gif diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/js/script.js b/bunsen/scaffolds/pyramid_template/+package+/static/js/script.js similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/js/script.js rename to bunsen/scaffolds/pyramid_template/+package+/static/js/script.js diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.js b/bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.js similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.js rename to bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.js diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.min.js b/bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.min.js similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.min.js rename to bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/jquery-1.6.2.min.js diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/modernizr-2.0.6.min.js b/bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/modernizr-2.0.6.min.js similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/js/thirdparty/modernizr-2.0.6.min.js rename to bunsen/scaffolds/pyramid_template/+package+/static/js/thirdparty/modernizr-2.0.6.min.js diff --git a/bunsen/paster_templates/pyramid_template/+package+/static/robots.txt b/bunsen/scaffolds/pyramid_template/+package+/static/robots.txt similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/static/robots.txt rename to bunsen/scaffolds/pyramid_template/+package+/static/robots.txt diff --git a/bunsen/paster_templates/pyramid_template/+package+/subscribers.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/subscribers.py_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/subscribers.py_tmpl rename to bunsen/scaffolds/pyramid_template/+package+/subscribers.py_tmpl diff --git a/bunsen/paster_templates/pyramid_template/+package+/templates/404.html b/bunsen/scaffolds/pyramid_template/+package+/templates/404.html similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/templates/404.html rename to bunsen/scaffolds/pyramid_template/+package+/templates/404.html diff --git a/bunsen/paster_templates/pyramid_template/+package+/templates/500.html b/bunsen/scaffolds/pyramid_template/+package+/templates/500.html similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/templates/500.html rename to bunsen/scaffolds/pyramid_template/+package+/templates/500.html diff --git a/bunsen/paster_templates/pyramid_template/+package+/templates/base.html b/bunsen/scaffolds/pyramid_template/+package+/templates/base.html similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/templates/base.html rename to bunsen/scaffolds/pyramid_template/+package+/templates/base.html diff --git a/bunsen/paster_templates/pyramid_template/+package+/templates/index.html b/bunsen/scaffolds/pyramid_template/+package+/templates/index.html similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/templates/index.html rename to bunsen/scaffolds/pyramid_template/+package+/templates/index.html diff --git a/bunsen/paster_templates/pyramid_template/+package+/templates/macros/formhelpers.html b/bunsen/scaffolds/pyramid_template/+package+/templates/macros/formhelpers.html similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/templates/macros/formhelpers.html rename to bunsen/scaffolds/pyramid_template/+package+/templates/macros/formhelpers.html diff --git a/bunsen/paster_templates/pyramid_template/+package+/tests.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/tests.py_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/tests.py_tmpl rename to bunsen/scaffolds/pyramid_template/+package+/tests.py_tmpl diff --git a/bunsen/scaffolds/pyramid_template/+package+/views/__init__.py b/bunsen/scaffolds/pyramid_template/+package+/views/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bunsen/paster_templates/pyramid_template/+package+/views/exceptions.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/views/exceptions.py_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/views/exceptions.py_tmpl rename to bunsen/scaffolds/pyramid_template/+package+/views/exceptions.py_tmpl diff --git a/bunsen/paster_templates/pyramid_template/+package+/views/home.py_tmpl b/bunsen/scaffolds/pyramid_template/+package+/views/home.py_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/+package+/views/home.py_tmpl rename to bunsen/scaffolds/pyramid_template/+package+/views/home.py_tmpl diff --git a/bunsen/paster_templates/pyramid_template/CHANGES.txt b/bunsen/scaffolds/pyramid_template/CHANGES.txt similarity index 100% rename from bunsen/paster_templates/pyramid_template/CHANGES.txt rename to bunsen/scaffolds/pyramid_template/CHANGES.txt diff --git a/bunsen/paster_templates/pyramid_template/MANIFEST.in_tmpl b/bunsen/scaffolds/pyramid_template/MANIFEST.in_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/MANIFEST.in_tmpl rename to bunsen/scaffolds/pyramid_template/MANIFEST.in_tmpl diff --git a/bunsen/paster_templates/pyramid_template/README.txt_tmpl b/bunsen/scaffolds/pyramid_template/README.txt_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/README.txt_tmpl rename to bunsen/scaffolds/pyramid_template/README.txt_tmpl diff --git a/bunsen/paster_templates/pyramid_template/development.ini_tmpl b/bunsen/scaffolds/pyramid_template/development.ini_tmpl similarity index 98% rename from bunsen/paster_templates/pyramid_template/development.ini_tmpl rename to bunsen/scaffolds/pyramid_template/development.ini_tmpl index a564984..b2b9365 100644 --- a/bunsen/paster_templates/pyramid_template/development.ini_tmpl +++ b/bunsen/scaffolds/pyramid_template/development.ini_tmpl @@ -30,7 +30,7 @@ jinja2.directories = {{package}}:templates custom_500_error = false [server:main] -use = egg:Paste#http +use = egg:waitress#main host = 127.0.0.1 port = 5000 diff --git a/bunsen/paster_templates/pyramid_template/production.ini_tmpl b/bunsen/scaffolds/pyramid_template/production.ini_tmpl similarity index 98% rename from bunsen/paster_templates/pyramid_template/production.ini_tmpl rename to bunsen/scaffolds/pyramid_template/production.ini_tmpl index 702f862..247c56b 100644 --- a/bunsen/paster_templates/pyramid_template/production.ini_tmpl +++ b/bunsen/scaffolds/pyramid_template/production.ini_tmpl @@ -29,7 +29,7 @@ jinja2.directories = {{package}}:templates custom_500_error = true [server:main] -use = egg:Paste#http +use = egg:waitress#main host = 127.0.0.1 port = 5000 diff --git a/bunsen/paster_templates/pyramid_template/setup.cfg_tmpl b/bunsen/scaffolds/pyramid_template/setup.cfg_tmpl similarity index 100% rename from bunsen/paster_templates/pyramid_template/setup.cfg_tmpl rename to bunsen/scaffolds/pyramid_template/setup.cfg_tmpl diff --git a/bunsen/paster_templates/pyramid_template/setup.py_tmpl b/bunsen/scaffolds/pyramid_template/setup.py_tmpl similarity index 89% rename from bunsen/paster_templates/pyramid_template/setup.py_tmpl rename to bunsen/scaffolds/pyramid_template/setup.py_tmpl index 6e92911..3938b4d 100644 --- a/bunsen/paster_templates/pyramid_template/setup.py_tmpl +++ b/bunsen/scaffolds/pyramid_template/setup.py_tmpl @@ -16,6 +16,7 @@ requires = [ 'pyramid_tm', 'SQLAlchemy', 'transaction', + 'waitress', 'WTForms', 'zope.sqlalchemy', ] @@ -42,10 +43,11 @@ setup(name='{{package}}', zip_safe=False, test_suite='{{package}}', install_requires = requires, - entry_points = """\ + entry_points="""\ [paste.app_factory] main = {{package}}:main + [console_scripts] + initialize_{{project}}_db = {{package}}.scripts.initializedb:main """, - paster_plugins=['pyramid'], ) diff --git a/setup.py b/setup.py index e23de42..6c3f3b4 100644 --- a/setup.py +++ b/setup.py @@ -30,8 +30,8 @@ test_suite='bunsen', install_requires = requires, entry_points = """\ - [paste.paster_create_template] - bunsen = bunsen.paster_templates:BunsenTemplate + [pyramid.scaffold] + bunsen = bunsen.scaffolds:BunsenTemplate """, paster_plugins=['pyramid'], )