moved scaffolds up one dir

This commit is contained in:
Lance Edgar 2012-06-10 23:01:46 -05:00
parent c0b507f1a1
commit ba092f90e4
20 changed files with 36 additions and 36 deletions

View file

@ -1,35 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# edbob -- Pythonic Software Framework
# Copyright © 2010-2012 Lance Edgar
#
# This file is part of edbob.
#
# edbob is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# edbob is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
# more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with edbob. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
"""
``edbob.pyramid.scaffolds`` -- App Scaffolding
"""
from pyramid.scaffolds import PyramidTemplate
class Template(PyramidTemplate):
_template_dir = 'edbob'
summary = "Pyramid edbob project"

View file

@ -1,59 +0,0 @@
#!/usr/bin/env python
"""
``{{package}}`` -- {{project}} application
"""
import os.path
from pyramid.config import Configurator
from pyramid.authentication import SessionAuthenticationPolicy
import edbob
from edbob.pyramid.auth import EdbobAuthorizationPolicy
from {{package}}._version import __version__
def main(global_config, **settings):
"""
This function returns a Pyramid WSGI application.
"""
# Here you can insert any code to modify the ``settings`` dict.
# You can:
# * Add additional keys to serve as constants or "global variables" in the
# application.
# * Set default values for settings that may have been omitted.
# * Override settings that you don't want the user to change.
# * Raise an exception if a setting is missing or invalid.
# * Convert values from strings to their intended type.
settings['mako.directories'] = [
'{{package}}:templates',
'edbob.pyramid:templates',
]
config = Configurator(settings=settings)
# Configure session
config.include('pyramid_beaker')
# Configure auth
config.set_authentication_policy(SessionAuthenticationPolicy())
config.set_authorization_policy(EdbobAuthorizationPolicy())
# Include "core" stuff provided by edbob.
config.include('edbob.pyramid')
# Additional config is defined elsewhere within {{project}}. This includes
# incorporating the various views etc. exposed by other packages.
config.include('{{package}}.subscribers')
config.include('{{package}}.views')
# Configure edbob. Note that this is done last, primarily to allow logging
# to leverage edbob's config inheritance.
edbob.basic_logging()
edbob.init('{{package}}', os.path.abspath(settings['edbob.config']))
return config.make_wsgi_app()

View file

@ -1 +0,0 @@
__version__ = '0.1a1'

View file

@ -1,86 +0,0 @@
#!/usr/bin/env python
"""
``{{package}}.commands`` -- Console Commands
"""
import sys
import edbob
from edbob import commands
from {{package}} import __version__
class Command(commands.Command):
"""
The primary command for {{project}}.
"""
name = '{{package}}'
version = __version__
description = "{{project}}"
long_description = ''
class InitCommand(commands.Subcommand):
"""
Initializes the database; called as ``{{package}} initialize``. This is
meant to be leveraged as part of setting up the application. The database
used by this command will be determined by config, for example::
.. highlight:: ini
[edbob.db]
sqlalchemy.url = postgresql://user:pass@localhost/{{package}}
"""
name = 'initialize'
description = "Initialize the database"
def run(self, args):
from edbob.db import engine, Session
from edbob.db.util import install_core_schema
from edbob.db.exceptions import CoreSchemaAlreadyInstalled
from edbob.db.extensions import activate_extension
# Install core schema to database.
try:
install_core_schema(engine)
except CoreSchemaAlreadyInstalled, err:
print '%s:' % err
print ' %s' % engine.url
return
# Activate extensions.
activate_extension('auth')
# activate_extension('shrubbery')
# Okay, on to bootstrapping...
session = Session()
# This creates an 'admin' user with 'admin' password.
import edbob.db.auth
edbob.db.auth.init_database(engine, session)
# Do any other bootstrapping you like here...
session.commit()
session.close()
print "Initialized database:"
print ' %s' % engine.url
def main(*args):
"""
The primary entry point for the command system.
"""
if args:
args = list(args)
else:
args = sys.argv[1:]
cmd = Command()
cmd.run(*args)

View file

@ -1,23 +0,0 @@
#!/usr/bin/env python
"""
``{{package}}.filemon`` -- Windows File Monitor
"""
from edbob import filemon_server
class FileMonitorService(filemon_server.FileMonitorService):
"""
Implements the {{project}} file monitor Windows service.
"""
_svc_name_ = "{{project}} File Monitor"
_svc_display_name_ = "{{project}} : File Monitoring Service"
appname = '{{package}}'
if __name__ == '__main__':
import win32serviceutil
win32serviceutil.HandleCommandLine(FileMonitorService)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,2 +0,0 @@
User-agent: *
Disallow: /

View file

@ -1,21 +0,0 @@
#!/usr/bin/env python
"""
``{{package}}.subscribers`` -- Pyramid Event Subscribers
"""
import {{package}}
def before_render(event):
"""
Adds goodies to the global template renderer context.
"""
renderer_globals = event
renderer_globals['{{package}}'] = {{package}}
def includeme(config):
config.include('edbob.pyramid.subscribers')
config.add_subscriber(before_render, 'pyramid.events.BeforeRender')

View file

@ -1,8 +0,0 @@
<%inherit file="/edbob/base.mako" />
<%def name="global_title()">{{project}}</%def>
<%def name="home_link()"><h1 class="right">${h.link_to("{{project}}", url('home'))}</h1></%def>
<%def name="footer()">
{{project}} v${ {{package}}.__version__} powered by
${h.link_to("edbob", 'http://edbob.org/', target='_blank')} v${edbob.__version__}
</%def>
${parent.body()}

View file

@ -1,13 +0,0 @@
<%inherit file="/base.mako" />
<%def name="title()">Home</%def>
<h1>Welcome to {{project}}</h1>
<p>You must choose, but choose wisely:</p>
<br />
<ul style="line-height: 200%;">
<li>some...</li>
<li>...links</li>
</ul>

View file

@ -1,2 +0,0 @@
<%inherit file="/edbob/index.mako" />
${parent.body()}

View file

@ -1,48 +0,0 @@
#!/usr/bin/env python
"""
``{{package}}.views`` -- Views
"""
import os
import os.path
from pyramid.response import Response
_here = os.path.join(os.path.dirname(__file__), os.pardir)
_favicon = open(os.path.join(_here, 'static', 'favicon.ico'), 'rb').read()
_favicon_response = Response(content_type='image/x-icon', body=_favicon)
def favicon_ico(context, request):
return _favicon_response
def home(context, request):
return {}
_robots = open(os.path.join(_here, 'static', 'robots.txt')).read()
_robots_response = Response(content_type='text/plain', body=_robots)
def robots_txt(context, request):
return _robots_response
def includeme(config):
config.add_route('home', '/')
config.add_view(home, route_name='home', renderer='/home.mako')
config.add_route('favicon.ico', '/favicon.ico')
config.add_view(favicon_ico, route_name='favicon.ico')
config.add_route('robots.txt', '/robots.txt')
config.add_view(robots_txt, route_name='robots.txt')
config.include('edbob.pyramid.views.auth')
config.include('edbob.pyramid.views.people')
config.include('edbob.pyramid.views.roles')
config.include('edbob.pyramid.views.users')

View file

@ -1,5 +0,0 @@
0.1a1
-----
- Initial version

View file

@ -1,2 +0,0 @@
include *.txt *.ini *.cfg *.rst
recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml

View file

@ -1,22 +0,0 @@
{{project}}
===========
Welcome to the {{project}} project.
Getting Started
---------------
{{project}} should install and run without issue on Linux and Windows::
.. highlight:: sh
$ virtualenv {{package}}
$ cd <{{package}}-src-dir>
$ python setup.py develop
$ cd <virtual-env-dir>
$ {{package}} make-app <app-dir>
$ cd <app-dir>
$ {{package}} -c development.ini initialize
$ pserve --reload development.ini

View file

@ -1,69 +0,0 @@
############################################################
#
# {{project}} configuration (development)
#
# This file is meant to be used as a sample only. Please
# copy it to a location of your choice and edit for your
# development needs.
#
# This file is meant to inherit from the production.ini
# found in the same directory. However note that edbob's
# configuration inheritance mechanism does NOT (yet) work
# for Pyramid (I think), so you'll have to be sure to
# specify everything required for it here.
#
############################################################
[{{package}}]
whatever = you like
####################
# Pyramid
####################
[app:main]
use = egg:{{package}}
pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = true
pyramid.default_locale_name = en
pyramid.includes =
pyramid_debugtoolbar
# Hack so edbob can find this file from within WSGI app.
edbob.config = %(here)s/development.ini
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
####################
# edbob
####################
[edbob]
include_config = ['%(here)s/production.ini']
[edbob.db]
sqlalchemy.url = sqlite:///{{package}}.sqlite
####################
# logging
####################
[logger_root]
level = INFO
[logger_edbob]
level = INFO
[logger_{{package_logger}}]
level = DEBUG

View file

@ -1,131 +0,0 @@
############################################################
#
# {{project}} configuration (production)
#
# This file is meant to be used as a sample only. Please
# copy it to a location of your choice and edit for your
# production needs.
#
############################################################
[{{package}}]
whatever = you like
####################
# pyramid
####################
[app:main]
use = egg:{{package}}
pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = false
pyramid.default_locale_name = en
# Hack so edbob can find this file from within WSGI app.
edbob.config = %(here)s/production.ini
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
####################
# alembic
####################
[alembic]
# path to migration scripts
script_location = schema
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
sqlalchemy.url = postgresql://user:pass@localhost/{{package}}
####################
# edbob
####################
[edbob]
init = edbob.time, edbob.db
# shell.python = ipython
[edbob.db]
sqlalchemy.url = postgresql://user:pass@localhost/{{package}}
[edbob.mail]
smtp.server = localhost
# smtp.username = user
# smtp.password = pass
sender.default = {{package}}@example.com
recipients.default = [
'Joe Blow <owner@example.com>',
'managers@example.com',
'support@example.com',
]
subject.default = Message from {{project}}
[edbob.time]
timezone = US/Central
####################
# logging
####################
[loggers]
keys = root, edbob, {{package_logger}}
[handlers]
keys = file, console, email
[formatters]
keys = generic, console
[logger_root]
# handlers = file, console, email
handlers = file, console
level = WARNING
[logger_edbob]
qualname = edbob
handlers =
# level = INFO
[logger_{{package_logger}}]
qualname = {{package}}
handlers =
level = WARNING
[handler_file]
class = FileHandler
args = ('{{package}}.log', 'a')
formatter = generic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
formatter = console
# level = NOTSET
[handler_email]
class = handlers.SMTPHandler
args = ('mail.example.com', '{{package}}@example.com', ['support@example.com'], '[{{project}} error]',
('user', 'pass'))
level = ERROR
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
datefmt = %Y-%m-%d %H:%M:%S
[formatter_console]
format = %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

View file

@ -1,30 +0,0 @@
[egg_info]
tag_build = .dev
[nosetests]
match = ^test
nocapture = 1
cover-package = {{package}}
with-coverage = 1
cover-erase = 1
[compile_catalog]
directory = {{package}}/locale
domain = {{project}}
statistics = true
[extract_messages]
add_comments = TRANSLATORS:
output_file = {{package}}/locale/{{project}}.pot
width = 80
[init_catalog]
domain = {{project}}
input_file = {{package}}/locale/{{project}}.pot
output_dir = {{package}}/locale
[update_catalog]
domain = {{project}}
input_file = {{package}}/locale/{{project}}.pot
output_dir = {{package}}/locale
previous = true

View file

@ -1,87 +0,0 @@
#!/usr/bin/env python
import os.path
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
execfile(os.path.join(here, '{{package}}', '_version.py'))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
#
# Version numbers within comments below have specific meanings.
# Basically the 'low' value is a "soft low," and 'high' a "soft high."
# In other words:
#
# If either a 'low' or 'high' value exists, the primary point to be
# made about the value is that it represents the most current (stable)
# version available for the package (assuming typical public access
# methods) whenever this project was started and/or documented.
# Therefore:
#
# If a 'low' version is present, you should know that attempts to use
# versions of the package significantly older than the 'low' version
# may not yield happy results. (A "hard" high limit may or may not be
# indicated by a true version requirement.)
#
# Similarly, if a 'high' version is present, and especially if this
# project has laid dormant for a while, you may need to refactor a bit
# when attempting to support a more recent version of the package. (A
# "hard" low limit should be indicated by a true version requirement
# when a 'high' version is present.)
#
# In any case, developers and other users are encouraged to play
# outside the lines with regard to these soft limits. If bugs are
# encountered then they should be filed as such.
#
# package # low high
'edbob[db,pyramid]', # 0.1a1.dev
]
setup(
name = '{{package}}',
version = __version__,
description = "{{project}}",
long_description = README + '\n\n' + CHANGES,
author = "",
author_email = '',
url = '',
# license = "GNU Affero GPL v3",
classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Pylons',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
],
install_requires = requires,
tests_require = requires,
packages = find_packages(),
include_package_data = True,
zip_safe = False,
entry_points = """
[console_scripts]
{{package}} = {{package}}.commands:main
[{{package}}.commands]
initialize = {{package}}.commands:InitCommand
[paste.app_factory]
main = {{package}}:main
""",
)