MCPcopy Create free account
hub / github.com/chatmail/core / run_cmdline

Function run_cmdline

python/src/deltachat/__init__.py:40–66  ·  view source on GitHub ↗

Run a simple default command line app, registering the specified account plugins.

(argv=None, account_plugins=None)

Source from the content-addressed store, hash-verified

38
39
40def run_cmdline(argv=None, account_plugins=None):
41 """Run a simple default command line app, registering the specified
42 account plugins.
43 """
44 import argparse
45
46 if argv is None:
47 argv = sys.argv
48
49 parser = argparse.ArgumentParser(prog=argv[0] if argv else None)
50 parser.add_argument("db", action="store", help="database file")
51 parser.add_argument("--show-ffi", action="store_true", help="show low level ffi events")
52 parser.add_argument("--email", action="store", help="email address")
53 parser.add_argument("--password", action="store", help="password")
54
55 args = parser.parse_args(argv[1:])
56
57 ac = Account(args.db)
58 qr = ac.get_setup_contact_qr()
59 print(qr)
60
61 ac.run_account(addr=args.email, password=args.password, account_plugins=account_plugins, show_ffi=args.show_ffi)
62
63 addr = ac.get_config("addr")
64 print(f"{addr}: waiting for message")
65
66 ac.wait_shutdown()

Callers 1

mainFunction · 0.90

Calls 5

get_setup_contact_qrMethod · 0.95
run_accountMethod · 0.95
get_configMethod · 0.95
wait_shutdownMethod · 0.95
AccountClass · 0.70

Tested by

no test coverage detected