r7233 - in branches/1.5/turbogears: . tests visit

0 views
Skip to first unread message

svn-c...@turbogears.org

unread,
Feb 19, 2011, 3:13:07 PM2/19/11
to turbogear...@googlegroups.com
Author: chrisz
Date: Sat Feb 19 14:13:05 2011
New Revision: 7233
URL: http://trac.turbogears.org/changeset/7233

Log:
Fixed visit configuration issue reported on the mailing list 2011-02-18.

Modified:
branches/1.5/turbogears/config.py
branches/1.5/turbogears/tests/configfile.cfg
branches/1.5/turbogears/tests/test_config.py
branches/1.5/turbogears/visit/api.py

Modified: branches/1.5/turbogears/config.py
==============================================================================
--- branches/1.5/turbogears/config.py Sun Jan 30 19:59:39 2011 (r7232)
+++ branches/1.5/turbogears/config.py Sat Feb 19 14:13:05 2011 (r7233)
@@ -288,10 +288,10 @@
configure_loggers(value)
elif key in server_sections and isinstance(value, dict):
server.update(value)
- for key in value:
- key = _check_name(key)
- if key:
- server[key] = value
+ for k, v in value.iteritems():
+ k = _check_name(k)
+ if k:
+ server[k] = v
else:
server[key] = value
key = _check_name(key)

Modified: branches/1.5/turbogears/tests/configfile.cfg
==============================================================================
--- branches/1.5/turbogears/tests/configfile.cfg Sun Jan 30 19:59:39 2011 (r7232)
+++ branches/1.5/turbogears/tests/configfile.cfg Sat Feb 19 14:13:05 2011 (r7233)
@@ -1,3 +1,4 @@
[global]
foo.bar = "blurb"
test.dir = "%(package_dir)s"
+visit.cookie.path = '/acme'

Modified: branches/1.5/turbogears/tests/test_config.py
==============================================================================
--- branches/1.5/turbogears/tests/test_config.py Sun Jan 30 19:59:39 2011 (r7232)
+++ branches/1.5/turbogears/tests/test_config.py Sat Feb 19 14:13:05 2011 (r7233)
@@ -32,6 +32,8 @@
assert cget('foo.bar') == 'blurb'
assert cget('tg.something') == 10
assert cget('test.dir').endswith('turbogears%stests' % os.path.sep)
+ assert cget('visit.cookie.path') == '/acme'
+ assert cget('tools.visit.cookie.path') == '/acme'


callnum = 0

Modified: branches/1.5/turbogears/visit/api.py
==============================================================================
--- branches/1.5/turbogears/visit/api.py Sun Jan 30 19:59:39 2011 (r7232)
+++ branches/1.5/turbogears/visit/api.py Sat Feb 19 14:13:05 2011 (r7233)
@@ -35,12 +35,12 @@
# Accessor functions for getting and setting the current visit information.

def current():
- """Retrieve the current visit record from the cherrypy request."""
+ """Retrieve the current visit record from the CherryPy request."""
return getattr(cherrypy.request, 'tg_visit', None)


def set_current(visit):
- """Set the current visit record on the cherrypy request being processed."""
+ """Set the current visit record on the CherryPy request being processed."""
cherrypy.request.tg_visit = visit


Reply all
Reply to author
Forward
0 new messages