added option to log DC core output

main
missytake 2023-05-22 16:00:30 +02:00
parent ebbb07bf1a
commit 1ff039152c
1 changed files with 22 additions and 2 deletions

View File

@ -29,9 +29,19 @@ def get_control_group(ac: deltachat.account.Account):
help="Specify backup file of your account to initialize account",
default=" ",
)
@click.option(
"--verbose",
"-v",
type=bool,
is_flag=True,
help="Show Delta Chat log output",
default=False,
)
@click.pass_context
def init(ctx, db_path, from_backup) -> None:
def init(ctx, db_path, from_backup, verbose) -> None:
ac = deltachat.account.Account(db_path)
if verbose:
ac.add_account_plugin(deltachat.events.FFIEventLogger(ac))
if not ac.is_configured():
if from_backup != " ":
ac.import_all(from_backup)
@ -133,9 +143,19 @@ def get_next_message_from_group(
default=os.getenv("HOME") + "/.config/DeltaChat/verificationbot/db.sqlite",
show_default=True,
)
@click.option(
"--verbose",
"-v",
type=bool,
is_flag=True,
help="Show Delta Chat log output",
default=False,
)
@click.pass_context
def run(ctx, db_path):
def run(ctx, db_path, verbose):
ac = deltachat.account.Account(db_path)
if verbose:
ac.add_account_plugin(deltachat.events.FFIEventLogger(ac))
if not ac.is_configured():
ctx.fail(
"Please run this first to initialize the bot:\n\n verificationbot init\n"