Commit cdb3fbb9 authored by Romain Courteaud's avatar Romain Courteaud

Do not require the configuration file.

Allows to quickly run from a shell with a memory storage
parent 03730196
...@@ -9,11 +9,20 @@ def runUrlChecker(): ...@@ -9,11 +9,20 @@ def runUrlChecker():
@runUrlChecker.command("bot", short_help="Runs url checker bot.") @runUrlChecker.command("bot", short_help="Runs url checker bot.")
@click.option(
"--sqlite",
"-s",
help="The path of the sqlite DB.",
default=":memory:",
show_default=True,
)
@click.option("--dns", "-d", help="The IP of the DNS server.")
@click.option("--url", "-u", help="The url to check.") @click.option("--url", "-u", help="The url to check.")
@click.option("--domain", "-m", help="The domain to check.") @click.option("--domain", "-m", help="The domain to check.")
@click.option("--sqlite", "-s", help="The path of the sqlite DB.") @click.option(
@click.argument("configuration") "--configuration", "-f", help="The path of the configuration file."
def runWebBot(url, domain, sqlite, configuration): )
def runWebBot(sqlite, dns, url, domain, configuration):
# click.echo("Running url checker bot") # click.echo("Running url checker bot")
mapping = {} mapping = {}
...@@ -23,6 +32,8 @@ def runWebBot(url, domain, sqlite, configuration): ...@@ -23,6 +32,8 @@ def runWebBot(url, domain, sqlite, configuration):
mapping["DOMAIN"] = url mapping["DOMAIN"] = url
if sqlite: if sqlite:
mapping["SQLITE"] = sqlite mapping["SQLITE"] = sqlite
if dns:
mapping["DNS"] = dns
bot = create_bot(cfgfile=configuration, mapping=mapping) bot = create_bot(cfgfile=configuration, mapping=mapping)
return bot.run() return bot.run()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment