diff --git a/utils/configurator.py b/utils/configurator.py index 8b7ae8a..8e2e7e8 100644 --- a/utils/configurator.py +++ b/utils/configurator.py @@ -8,28 +8,30 @@ class Configurator: self.scrapy_settings = get_project_settings() - def set_output(self, filename, format): + def set_output(self, filename, fileformat): """ - This function manipulates the Scrapy settings that normally would be set in the settings file. In the Fourmi - project these are command line arguments. - :param docopt_arguments: A dictionary generated by docopt containing all CLI arguments. + This function manipulates the Scrapy output file settings that normally would be set in the settings file. + In the Fourmi project these are command line arguments. + :param filename: The filename of the file where the output will be put. + :param fileformat: The format in which the output will be. """ if filename != 'result.*format*': - self.scrapy_settings.overrides["FEED_URI"] = format - elif format == "jsonlines": + self.scrapy_settings.overrides["FEED_URI"] = fileformat + elif fileformat == "jsonlines": self.scrapy_settings.overrides["FEED_URI"] = "results.json" - elif format is not None: - self.scrapy_settings.overrides["FEED_URI"] = "results." + format + elif fileformat is not None: + self.scrapy_settings.overrides["FEED_URI"] = "results." + fileformat - if format is not None: - self.scrapy_settings.overrides["FEED_FORMAT"] = format + if fileformat is not None: + self.scrapy_settings.overrides["FEED_FORMAT"] = fileformat def start_log(self, logfile, verbose): """ This function starts the logging functionality of Scrapy using the settings given by the CLI. - :param docopt_arguments: A dictionary generated by docopt containing all CLI arguments. + :param logfile: The location where the logfile will be saved. + :param verbose: A boolean value to switch between loglevels. """ if logfile is not None: if verbose: