()
| 596 | |
| 597 | |
| 598 | def main(): |
| 599 | parser = argparse.ArgumentParser() |
| 600 | parser.add_argument("-p", "--profile", |
| 601 | help=_("Choose a profile to start with."), |
| 602 | default="default") |
| 603 | parser.add_argument("-m", "--module", |
| 604 | help=_("Start the wizard of a module manually, skipping " |
| 605 | "the framework wizard.")) |
| 606 | args = parser.parse_args() |
| 607 | |
| 608 | data = DataModel(args.profile) |
| 609 | data.load_config() |
| 610 | |
| 611 | if args.module: |
| 612 | mid, iid = data.split_cid(args.module) |
| 613 | if callable(data.modules[mid].wizard): |
| 614 | data.modules[mid].wizard(data.profile, iid) |
| 615 | return |
| 616 | else: |
| 617 | print(_("{module_id} did not register any wizard " |
| 618 | "program to start with.").format(module_id=args.module)) |
| 619 | exit(1) |
| 620 | |
| 621 | prerequisite_check() |
| 622 | |
| 623 | print_wrapped(_("Welcome to EH Forwarder Bot Setup Wizard. This program " |
| 624 | "will guide you to finish up the last few steps to " |
| 625 | "get EFB ready to use.\n" |
| 626 | "\n" |
| 627 | "To use this wizard in another supported language, " |
| 628 | "please change your system language or modify the " |
| 629 | "language environment variable and restart the wizard.")) |
| 630 | |
| 631 | print() |
| 632 | |
| 633 | data.profile = input(_("Profile") + f": [{data.profile}] ") or data.profile |
| 634 | print() |
| 635 | |
| 636 | choose_master_channel(data) |
| 637 | choose_slave_channels(data) |
| 638 | choose_middlewares(data) |
| 639 | confirmation(data) |
| 640 | |
| 641 | print_wrapped(_("Some more advanced settings, such as granulated log control, " |
| 642 | "are not included in this wizard. For further details, you may want to " |
| 643 | "refer to the documentation.\n\n" |
| 644 | "https://ehforwarderbot.readthedocs.io/en/latest/config.html")) |
| 645 | print() |
| 646 | |
| 647 | modules_count = 1 |
| 648 | missing_wizards = [] |
| 649 | if not data.has_wizard(data.config['master_channel']): |
| 650 | missing_wizards.append(data.config['master_channel']) |
| 651 | for i in data.config['slave_channels']: |
| 652 | modules_count += 1 |
| 653 | if not data.has_wizard(i): |
| 654 | missing_wizards.append(i) |
| 655 | for i in data.config['middlewares']: |
no test coverage detected