def load_config(config): from ckan.lib.cli import CkanCommand cmd = CkanCommand(name=None) class Options(object): pass cmd.options = Options() cmd.options.config = config cmd._load_config() return
def _load_config(): # We want CKAN environment loaded. Here we fake that this is a CKAN command. global _config_loaded if _config_loaded: return _config_loaded = True command = CkanCommand(None) command.options = FakeOptions() command._load_config()