Skip to content

Commit

Permalink
modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Feb 15, 2012
1 parent 7a05ff5 commit d718d18
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,8 @@
Next release Next release
------------ ------------


- Use pyramid_tm and pyramid_zodbconn rather than repoze equivalents.

- Changed to disuse repoze.who and use decorators instead of ZCML. - Changed to disuse repoze.who and use decorators instead of ZCML.


- Forked from repoze.cluebin after 0.1. - Forked from repoze.cluebin after 0.1.
10 changes: 5 additions & 5 deletions cluegun/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authentication import AuthTktAuthenticationPolicy
from cluegun.models import appmaker from cluegun.models import appmaker


from repoze.zodbconn.finder import PersistentApplicationFinder from pyramid_zodbconn import get_connection

def root_factory(request):
conn = get_connection(request)
return appmaker(conn.root())


def main(global_config, **settings): def main(global_config, **settings):
db_path = settings.get('db_path', None)
if db_path is None:
raise ValueError('db_path must not be None')
passwd_file = settings.get('password_file', None) passwd_file = settings.get('password_file', None)
if passwd_file is None: if passwd_file is None:
raise ValueError('password_file must not be None') raise ValueError('password_file must not be None')
root_factory = PersistentApplicationFinder('file://%s' % db_path, appmaker)
config = Configurator( config = Configurator(
root_factory = root_factory, root_factory = root_factory,
settings = settings, settings = settings,
Expand Down
14 changes: 6 additions & 8 deletions development.ini
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,12 @@
[app:cluegun] [app:main]
use = egg:cluegun use = egg:cluegun
db_path = %(here)s/cluegun.db
password_file = %(here)s/cluegun.passwd password_file = %(here)s/cluegun.passwd

pyramid.includes = pyramid_tm
[pipeline:main] pyramid_zodbconn
pipeline = egg:repoze.zodbconn#closer tm.attempts = 3
egg:repoze.tm2#tm zodbconn.uri = file://%(here)s/cluegun.db
cluegun


[server:main] [server:main]
use = egg:Paste#http use = egg:waitress#main
host = 0.0.0.0 host = 0.0.0.0
port = 6543 port = 6543
7 changes: 4 additions & 3 deletions setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()


requires = [ requires = [
'pyramid>=1.0a7', 'pyramid>=1.3a7',
'repoze.tm2', 'pyramid_tm',
'repoze.monty', 'repoze.monty',
'ZODB3', 'ZODB3',
'Pygments', 'Pygments',
'FormEncode', 'FormEncode',
'repoze.zodbconn', 'pyramid_zodbconn',
'repoze.folder', 'repoze.folder',
'waitress',
] ]


__version__ = '0.0' __version__ = '0.0'
Expand Down

0 comments on commit d718d18

Please sign in to comment.