def handle(self, *args, **options):
url = options['url']
name = options['name']
if url or name:
if not name or not url:
raise CommandError(MISSING_ARG_MSG)
index_catalog(DataJson(url), name)
return
catalogs = yaml.load(requests.get(CATALOGS_INDEX).text)
for catalog_id, values in catalogs.items():
if values['federado'] and values['formato'] == 'json':
try:
catalog = DataJson(values['url'])
except (IOError, ValueError) as e:
logging.warn(READ_ERROR, catalog_id, e)
continue
index_catalog(catalog, catalog_id)
评论列表
文章目录