comparison bitsyblog/factory.py @ 59:0af1f4ae328d

fix a couple of basic things
author egj@socialplanning.org
date Mon, 04 Jan 2010 03:12:04 +0000
parents b97d11e2cf41
children f6a6a4b072e7
comparison
equal deleted inserted replaced
58:b97d11e2cf41 59:0af1f4ae328d
18 key_str = 'bitsyblog.%s' 18 key_str = 'bitsyblog.%s'
19 args = dict([ (key, app_conf[ key_str % key]) for key in config 19 args = dict([ (key, app_conf[ key_str % key]) for key in config
20 if app_conf.has_key(key_str % key) ]) 20 if app_conf.has_key(key_str % key) ])
21 app = BitsyBlog(**args) 21 app = BitsyBlog(**args)
22 secret = app_conf.get('secret', 'secret') 22 secret = app_conf.get('secret', 'secret')
23 return BitsyAuth(HTTPExceptionHandler(app), global_conf, app.passwords, app.newuser, 'bitsyblog', secret) 23 return BitsyAuth(HTTPExceptionHandler(app),
24 global_conf,
25 app.passwords,
26 app.newuser,
27 'bitsyblog',
28 secret)
24 29
25 30
26 def bitsierfactory(global_conf, **app_conf): 31 def bitsierfactory(global_conf, **app_conf):
27 """make single-user bitsyblog""" 32 """make single-user bitsyblog"""
28 key_str = 'bitsyblog.%s' 33 key_str = 'bitsyblog.%s'
30 if app_conf.has_key(key_str % key) ]) 35 if app_conf.has_key(key_str % key) ])
31 user = app_conf['bitsyblog.user'] 36 user = app_conf['bitsyblog.user']
32 app = BitsierBlog(**args) 37 app = BitsierBlog(**args)
33 app.user = user 38 app.user = user
34 secret = app_conf.get('secret', 'secret') 39 secret = app_conf.get('secret', 'secret')
35 auth = BitsyAuth(HTTPExceptionHandler(app), global_conf, app.passwords, newuser=None, site='bitsyblog', secret=secret) 40 auth = BitsyAuth(HTTPExceptionHandler(app),
41 global_conf,
42 app.passwords,
43 newuser=None,
44 site=app_conf.get('site', 'bitsyblog'),
45 secret=secret)
36 if not user in app.users: 46 if not user in app.users:
37 pw = getpass('Enter password for %s: ' % user) 47 pw = getpass('Enter password for %s: ' % user)
38 app.newuser(user, auth.hash(app.user, pw)) 48 app.newuser(user, auth.hash(app.user, pw))
39 return auth 49 return auth