More misc. Python3 cleanup.
This commit is contained in:
@@ -125,9 +125,6 @@ class ShellCommand(BaseCommand):
|
|||||||
locs['model'] = model
|
locs['model'] = model
|
||||||
|
|
||||||
# insert the pecan locals
|
# insert the pecan locals
|
||||||
exec(
|
|
||||||
'from pecan import abort, conf, redirect, request, response'
|
|
||||||
) in locs
|
|
||||||
from pecan import abort, conf, redirect, request, response
|
from pecan import abort, conf, redirect, request, response
|
||||||
locs['abort'] = abort
|
locs['abort'] = abort
|
||||||
locs['conf'] = conf
|
locs['conf'] = conf
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class Config(object):
|
|||||||
self.__values__[key] = ConfigDict(value)
|
self.__values__[key] = ConfigDict(value)
|
||||||
else:
|
else:
|
||||||
self.__values__[key] = Config(value, filename=self.__file__)
|
self.__values__[key] = Config(value, filename=self.__file__)
|
||||||
elif isinstance(value, str) and '%(confdir)s' in value:
|
elif isinstance(value, six.string_types) and '%(confdir)s' in value:
|
||||||
confdir = os.path.dirname(self.__file__) or os.getcwd()
|
confdir = os.path.dirname(self.__file__) or os.getcwd()
|
||||||
self.__values__[key] = value.replace('%(confdir)s', confdir)
|
self.__values__[key] = value.replace('%(confdir)s', confdir)
|
||||||
else:
|
else:
|
||||||
@@ -221,7 +221,7 @@ def set_config(config, overwrite=False):
|
|||||||
if overwrite is True:
|
if overwrite is True:
|
||||||
_runtime_conf.empty()
|
_runtime_conf.empty()
|
||||||
|
|
||||||
if isinstance(config, str):
|
if isinstance(config, six.string_types):
|
||||||
config = conf_from_file(config)
|
config = conf_from_file(config)
|
||||||
_runtime_conf.update(config)
|
_runtime_conf.update(config)
|
||||||
if config.__file__:
|
if config.__file__:
|
||||||
|
|||||||
Reference in New Issue
Block a user