r7242 - in branches: 1.1/turbogears 1.5/turbogears

0 views
Skip to first unread message

svn-c...@turbogears.org

unread,
Mar 8, 2011, 5:58:51 AM3/8/11
to turbogear...@googlegroups.com
Author: chrisz
Date: Tue Mar 8 04:58:48 2011
New Revision: 7242
URL: http://trac.turbogears.org/changeset/7242

Log:
Some whitespace clean-up.

Modified:
branches/1.1/turbogears/controllers.py
branches/1.5/turbogears/controllers.py

Modified: branches/1.1/turbogears/controllers.py
==============================================================================
--- branches/1.1/turbogears/controllers.py Mon Mar 7 14:21:55 2011 (r7241)
+++ branches/1.1/turbogears/controllers.py Tue Mar 8 04:58:48 2011 (r7242)
@@ -88,7 +88,7 @@
css.sort(key=lambda obj: getattr(obj, 'order', 0))
output['tg_css'] = css
for location in iter(js_location):
- js[location].sort(key=lambda obj: getattr(obj, 'order', 0))
+ js[location].sort(key=lambda obj: getattr(obj, 'order', 0))
output['tg_js_%s' % location] = js[location]

tg_flash = _get_flash()
@@ -500,7 +500,7 @@
msglogfunc = {0: msglog.info, 1: msglog.warning, 2: msglog.error}

@classmethod
- def _cp_log_message(cls, msg, context = 'nocontext', severity = 0):
+ def _cp_log_message(cls, msg, context='nocontext', severity=0):
"""Default method for logging messages (errors and app-specific info)"""
log = cls.msglogfunc[severity]
text = ''.join((context, ': ', msg))
@@ -524,7 +524,7 @@
username = '-'
except AttributeError:
username = '-'
- request_date = time.strftime('%d/%b/%Y:%H:%M:%S +0000',time.gmtime())
+ request_date = time.strftime('%d/%b/%Y:%H:%M:%S +0000', time.gmtime())
request_info = {
'host': request.headers.get('X-Forwarded-For')
or request.remote_host or request.remote_addr,
@@ -559,7 +559,8 @@
def __get__(self, obj, cls=None):
"""Return True if object has a method for HTTP method of current request
"""
- if cls is None: cls = obj
+ if cls is None:
+ cls = obj
cp_methodname = cherrypy.request.method
methodname = cp_methodname.lower()
method = getattr(cls, methodname, None)
@@ -665,6 +666,7 @@
tgpath += '?' + query_string
return tgpath

+
def get_server_name():
"""Return name of the server this application runs on.

@@ -681,6 +683,7 @@
get('server.socket_port', 8080))
return host

+
def absolute_url(tgpath='/', params=None, **kw):
"""Return absolute URL (including schema and host to this server).

@@ -719,6 +722,7 @@
base_url = get('base_url_filter.base_url').rstrip('/')
return '%s%s' % (base_url, url(tgpath, params, **kw))

+
def check_app_root():
"""Sets request.app_root if needed."""
if hasattr(request, 'app_root'):

Modified: branches/1.5/turbogears/controllers.py
==============================================================================
--- branches/1.5/turbogears/controllers.py Mon Mar 7 14:21:55 2011 (r7241)
+++ branches/1.5/turbogears/controllers.py Tue Mar 8 04:58:48 2011 (r7242)
@@ -522,7 +522,8 @@
def __get__(self, obj, cls=None):
"""Return True if object has a method for HTTP method of current request
"""
- if cls is None: cls = obj
+ if cls is None:
+ cls = obj
cp_methodname = cherrypy.request.method
methodname = cp_methodname.lower()
method = getattr(cls, methodname, None)

Reply all
Reply to author
Forward
0 new messages