2016-12-16 00:29:59 -06:00

14 lines
390 B
Python

"""Outputters take scraped objects and save them to a certain format."""
from . import json, pickle
OUTPUTTERS = [json, pickle]
def get_outputter(name):
"""Get the outputter with the specified name."""
for outputter in OUTPUTTERS:
if outputter.__name__.endswith(".{}".format(name)):
return outputter
raise Exception("Unknown outputter: {}".format(name))