PEP8 Updates
This commit is contained in:
commit
61c87661ec
@ -35,6 +35,8 @@ class MemcacheMiddleware(object):
|
||||
def filter_factory(global_conf, **local_conf):
|
||||
conf = global_conf.copy()
|
||||
conf.update(local_conf)
|
||||
|
||||
def cache_filter(app):
|
||||
return MemcacheMiddleware(app, conf)
|
||||
|
||||
return cache_filter
|
||||
|
@ -56,14 +56,15 @@ def monkey_patch_mimetools():
|
||||
|
||||
mimetools.Message.parsetype = parsetype
|
||||
|
||||
|
||||
def get_socket(conf, default_port=8080):
|
||||
"""Bind socket to bind ip:port in conf
|
||||
|
||||
:param conf: Configuration dict to read settings from
|
||||
:param default_port: port to use if not specified in conf
|
||||
|
||||
:returns : a socket object as returned from socket.listen or ssl.wrap_socket
|
||||
if conf specifies cert_file
|
||||
:returns : a socket object as returned from socket.listen or
|
||||
ssl.wrap_socket if conf specifies cert_file
|
||||
"""
|
||||
bind_addr = (conf.get('bind_ip', '0.0.0.0'),
|
||||
int(conf.get('bind_port', default_port)))
|
||||
|
@ -96,9 +96,11 @@ def delay_denial(func):
|
||||
return func(*a, **kw)
|
||||
return wrapped
|
||||
|
||||
|
||||
def get_account_memcache_key(account):
|
||||
return 'account/%s' % account
|
||||
|
||||
|
||||
def get_container_memcache_key(account, container):
|
||||
return 'container/%s/%s' % (account, container)
|
||||
|
||||
@ -298,7 +300,8 @@ class Controller(object):
|
||||
:param additional_info: additional information to log
|
||||
"""
|
||||
self.app.logger.exception(
|
||||
_('ERROR with %(type)s server %(ip)s:%(port)s/%(device)s re: %(info)s'),
|
||||
_('ERROR with %(type)s server %(ip)s:%(port)s/%(device)s re: '
|
||||
'%(info)s'),
|
||||
{'type': typ, 'ip': node['ip'], 'port': node['port'],
|
||||
'device': node['device'], 'info': additional_info})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user