has_key is deprecated, converting uses to use "in" operator.

This commit is contained in:
Nathan Yergler
2011-10-01 15:10:41 -07:00
parent 243c3843bd
commit 285ffeddf3
8 changed files with 23 additions and 23 deletions

View File

@@ -103,10 +103,10 @@ def get_jinja_loader(user_template_path=None):
def get_staticdirector(app_config):
if app_config.has_key('direct_remote_path'):
if 'direct_remote_path' in app_config:
return staticdirect.RemoteStaticDirect(
app_config['direct_remote_path'].strip())
elif app_config.has_key('direct_remote_paths'):
elif 'direct_remote_paths' in app_config:
direct_remote_path_lines = app_config[
'direct_remote_paths'].strip().splitlines()
return staticdirect.MultiRemoteStaticDirect(

View File

@@ -40,25 +40,25 @@ def setup_celery_from_config(app_config, global_config,
- set_environ: if set, this will CELERY_CONFIG_MODULE to the
settings_module
"""
if global_config.has_key('celery'):
if 'celery' in global_config:
celery_conf = global_config['celery']
else:
celery_conf = {}
celery_settings = {}
# set up mongodb stuff
celery_settings['CELERY_RESULT_BACKEND'] = 'mongodb'
if not celery_settings.has_key('BROKER_BACKEND'):
if 'BROKER_BACKEND' not in celery_settings:
celery_settings['BROKER_BACKEND'] = 'mongodb'
celery_mongo_settings = {}
if app_config.has_key('db_host'):
if 'db_host' in app_config:
celery_mongo_settings['host'] = app_config['db_host']
if celery_settings['BROKER_BACKEND'] == 'mongodb':
celery_settings['BROKER_HOST'] = app_config['db_host']
if app_config.has_key('db_port'):
if 'db_port' in app_config:
celery_mongo_settings['port'] = app_config['db_port']
if celery_settings['BROKER_BACKEND'] == 'mongodb':
celery_settings['BROKER_PORT'] = app_config['db_port']