From dabc1f700b4df912dbec6985a60c9d6c1f9f8f3c Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 21 Jun 2023 19:04:59 -0700 Subject: [PATCH] Add cron helptext to source edit page --- intake/app.py | 10 ++++++++++ intake/cli.py | 1 - intake/templates/edit.jinja2 | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/intake/app.py b/intake/app.py index 77c42d1..6484659 100644 --- a/intake/app.py +++ b/intake/app.py @@ -25,6 +25,15 @@ from intake.source import LocalSource, execute_action, Item app = Flask(__name__) +CRON_HELPTEXT = """cron spec: +* * * * * ++-------------- minute (0 - 59) + +----------- hour (0 - 23) + +-------- day of month (1 - 31) + +----- month (1 - 12) + +-- day of week (0 Sun - 6 Sat)""" + + def item_sort_key(item: Item): return item.sort_key @@ -276,6 +285,7 @@ def source_edit(name): subtitle=source.source_name, config=config_str, error_message=error_message, + helptext=CRON_HELPTEXT, ) diff --git a/intake/cli.py b/intake/cli.py index 5d6f227..d537bbb 100644 --- a/intake/cli.py +++ b/intake/cli.py @@ -334,7 +334,6 @@ def cmd_run(cmd_args): from intake.app import app app.config["INTAKE_DATA"] = data_path - print(app.config) app.run(port=args.port, debug=args.debug) return 0 except Exception as ex: diff --git a/intake/templates/edit.jinja2 b/intake/templates/edit.jinja2 index 459f9f4..9dba556 100644 --- a/intake/templates/edit.jinja2 +++ b/intake/templates/edit.jinja2 @@ -79,6 +79,10 @@ span.error-message { {% endif %}

+{% if helptext -%} +
{{ helptext }}
+
+{%- endif %}