mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 09:35:44 +00:00
63 lines
1.5 KiB
Python
63 lines
1.5 KiB
Python
import click
|
|
|
|
import tembo
|
|
|
|
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
|
|
|
|
|
|
@click.group(context_settings=CONTEXT_SETTINGS, options_metavar="<options>")
|
|
def run():
|
|
"""
|
|
Tembo - an organiser for work notes.
|
|
"""
|
|
print(tembo.CONFIG.base_path)
|
|
# print(tembo.CONFIG.scopes)
|
|
|
|
|
|
@click.command(options_metavar="<options>")
|
|
@click.argument("scope", metavar="<scope>")
|
|
@click.argument(
|
|
"inputs",
|
|
nargs=-1,
|
|
metavar="<inputs>",
|
|
)
|
|
def new(scope, inputs):
|
|
"""
|
|
Create a new note.
|
|
|
|
<scope> The name of the scope in the Tembo config.yml.
|
|
|
|
<inputs> Any input tokens needed in the Tembo config.yml.
|
|
|
|
Example: tembo new meeting my_presentation
|
|
"""
|
|
|
|
# for user_scope in tembo.CONFIG.scopes:
|
|
# print(f"passed in scope: {scope}")
|
|
# print(f'config scope: {user_scope["name"]}')
|
|
# if user_scope["name"] == scope:
|
|
# print(True)
|
|
|
|
# TODO: write check for if titles is missing
|
|
from panaetius.utilities import Squash
|
|
|
|
for user_scope in tembo.CONFIG.scopes:
|
|
print(Squash({"titles": user_scope["titles"]}).as_dict)
|
|
|
|
# click.echo(inputs)
|
|
# click.echo(type(inputs))
|
|
|
|
# if len(inputs) == 0, pass None is as user_input
|
|
|
|
|
|
# TODO: decide on a date format to pass in
|
|
@click.command(options_metavar="<options>")
|
|
@click.option("--scope", "-s", help="The name of the scope in the Tembo config.yml.")
|
|
@click.option("--date", "-d", help="")
|
|
def archive(scope, date):
|
|
print(f"{scope}, {date}")
|
|
|
|
|
|
run.add_command(new)
|
|
run.add_command(archive)
|