Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix PEP8 warnings in scaffolds #641

Closed
wants to merge 1 commit into from

3 participants

@wichert

Fix several PEP8 warnings in the scaffolds.

@mcdonc
Owner

Sorry, we can't think about merging this unless it doesnt throw off the line numbers in the tutorials (or it does and the references are fixed).

@ppaez
Collaborator

The changes proposed by @wichert are already in the master branch, I verified them. There is no need to merge this pull request and it can be closed.

@wichert wichert closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 27, 2012
  1. @wichert

    Fix PEP8 warnings in scaffolds

    wichert authored
This page is out of date. Refresh to see the latest.
View
2  CHANGES.txt
@@ -4,6 +4,8 @@ Next release
Bug Fixes
---------
+- Fix PEP8-warnings in scaffolds.
+
- Forward port from 1.3 branch: When no authentication policy was configured,
a call to ``pyramid.security.effective_principals`` would unconditionally
return the empty list. This was incorrect, it should have unconditionally
View
2  pyramid/scaffolds/alchemy/+package+/__init__.py
@@ -3,6 +3,7 @@
from .models import DBSession
+
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
@@ -13,4 +14,3 @@ def main(global_config, **settings):
config.add_route('home', '/')
config.scan()
return config.make_wsgi_app()
-
View
2  pyramid/scaffolds/alchemy/+package+/models.py
@@ -16,6 +16,7 @@
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
Base = declarative_base()
+
class MyModel(Base):
__tablename__ = 'models'
id = Column(Integer, primary_key=True)
@@ -25,4 +26,3 @@ class MyModel(Base):
def __init__(self, name, value):
self.name = name
self.value = value
-
View
4 pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py
@@ -15,12 +15,14 @@
Base,
)
+
def usage(argv):
cmd = os.path.basename(argv[0])
print('usage: %s <config_uri>\n'
- '(example: "%s development.ini")' % (cmd, cmd))
+ '(example: "%s development.ini")' % (cmd, cmd))
sys.exit(1)
+
def main(argv=sys.argv):
if len(argv) != 2:
usage(argv)
View
1  pyramid/scaffolds/starter/+package+/__init__.py
@@ -1,5 +1,6 @@
from pyramid.config import Configurator
+
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
View
2  pyramid/scaffolds/zodb/+package+/__init__.py
@@ -2,10 +2,12 @@
from pyramid_zodbconn import get_connection
from .models import appmaker
+
def root_factory(request):
conn = get_connection(request)
return appmaker(conn.root())
+
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
View
2  pyramid/scaffolds/zodb/+package+/models.py
@@ -1,8 +1,10 @@
from persistent.mapping import PersistentMapping
+
class MyModel(PersistentMapping):
__parent__ = __name__ = None
+
def appmaker(zodb_root):
if not 'app_root' in zodb_root:
app_root = MyModel()
Something went wrong with that request. Please try again.