# Path: basic_editor/editor.py
# def run_basic_editor(cfg, default_content=None):
#     editor = EditorWindow(cfg)
#     if default_content is not None:
#         editor.set_content(default_content)
#     editor.mainloop()
# 
# Path: dragonpy/components/rom.py
# class ROMDownloadError(Exception):
#     def __init__(self, url, origin_err):
#         self.url = url
#         self.origin_err = origin_err
# 
# Path: dragonpy/core/configs.py
# class MachineDict(dict):
# class DummyMemInfo:
# class AddressAreas(dict):
# class BaseConfig:
#     DEFAULT = None
#     BURST_COUNT = 10000
#     DEFAULT_ROMS = {}
#     def register(self, name, cls, default=False):
#     def get_shortest(self, *args):
#     def __call__(self, *args):
#     def __init__(self, areas):
#     def add_area(self, start_addr, end_addr, txt):
#     def __init__(self, cfg_dict):
#     def _get_initial_Memory(self, size):
#     def get_initial_RAM(self):
#     def get_initial_ROM(self):
#     def print_debug_info(self):
# 
# Path: dragonpy/core/gui_starter.py
# VERBOSITY_DICT = {
#     1: "hardcode DEBUG ;)",
#     10: "DEBUG",
#     20: "INFO",
#     30: "WARNING",
#     40: "ERROR",
#     50: "CRITICAL/FATAL",
#     99: "nearly all off",
#     100: "all off",
# }
# 
# def gui_mainloop(confirm_exit=True):
#     """
#     Entrypoint to start the DragonPy "StarterGUI"
# 
#     Executed by "DragonPy" command, defined via [tool.poetry.scripts] in pyproject.toml
#     """
#     if confirm_exit:
# 
#         def confirm():
#             # don't close the terminal window directly
#             # important for windows users ;)
#             input("Please press [ENTER] to exit")
# 
#         atexit.register(confirm)
# 
#     print("\nrun DragonPy starter GUI...\n")
#     gui = StarterGUI(machine_dict)
#     gui.mainloop()


import argparse
import locale
import logging
import cmd2
import dragonpy
from pathlib import Path
from pprint import pprint
from cmd2 import Cmd2ArgumentParser
from creole.setup_utils import assert_rst_readme
from dev_shell.base_cmd2_app import DevShellBaseApp, run_cmd2_app
from dev_shell.command_sets import DevShellBaseCommandSet
from dev_shell.command_sets.dev_shell_commands import DevShellCommandSet as OriginDevShellCommandSet
from dev_shell.command_sets.dev_shell_commands import run_linters
from dev_shell.config import DevShellConfig
from dev_shell.utils.colorful import blue, bright_blue, bright_yellow, cyan, print_error
from dev_shell.utils.subprocess_utils import verbose_check_call
from poetry_publish.publish import poetry_publish
from basic_editor.editor import run_basic_editor
from dragonpy.components.rom import ROMDownloadError
from dragonpy.core.configs import machine_dict
from dragonpy.core.gui_starter import VERBOSITY_DICT, gui_mainloop
    parser.add_argument(
        '--machine',
        choices=sorted(machine_dict.keys()),
        default=machine_dict.DEFAULT,
        help='Used machine configuration (default: %(default)s)',
    )


def add_argument_verbosity(parser: Cmd2ArgumentParser):
    parser.add_argument(
        '--verbosity',
        type=int,
        choices=sorted(VERBOSITY_DICT.keys()),
        default=99,
        help='verbosity level to stdout (default: %(default)s)',
    )


@cmd2.with_default_category('DragonPy commands')
class DragonPyCommandSet(DevShellBaseCommandSet):
    def do_gui(self, statement: cmd2.Statement):
        """
        Start the DragonPy tkinter starter GUI
        """
        gui_mainloop(confirm_exit=False)

    def do_download_roms(self, statement: cmd2.Statement):
        """
        Download/Test only ROM files
        """

# Path: basic_editor/editor.py
# def run_basic_editor(cfg, default_content=None):
#     editor = EditorWindow(cfg)
#     if default_content is not None:
#         editor.set_content(default_content)
#     editor.mainloop()
# 
# Path: dragonpy/components/rom.py
# class ROMDownloadError(Exception):
#     def __init__(self, url, origin_err):
#         self.url = url
#         self.origin_err = origin_err
# 
# Path: dragonpy/core/configs.py
# class MachineDict(dict):
# class DummyMemInfo:
# class AddressAreas(dict):
# class BaseConfig:
#     DEFAULT = None
#     BURST_COUNT = 10000
#     DEFAULT_ROMS = {}
#     def register(self, name, cls, default=False):
#     def get_shortest(self, *args):
#     def __call__(self, *args):
#     def __init__(self, areas):
#     def add_area(self, start_addr, end_addr, txt):
#     def __init__(self, cfg_dict):
#     def _get_initial_Memory(self, size):
#     def get_initial_RAM(self):
#     def get_initial_ROM(self):
#     def print_debug_info(self):
# 
# Path: dragonpy/core/gui_starter.py
# VERBOSITY_DICT = {
#     1: "hardcode DEBUG ;)",
#     10: "DEBUG",
#     20: "INFO",
#     30: "WARNING",
#     40: "ERROR",
#     50: "CRITICAL/FATAL",
#     99: "nearly all off",
#     100: "all off",
# }
# 
# def gui_mainloop(confirm_exit=True):
#     """
#     Entrypoint to start the DragonPy "StarterGUI"
# 
#     Executed by "DragonPy" command, defined via [tool.poetry.scripts] in pyproject.toml
#     """
#     if confirm_exit:
# 
#         def confirm():
#             # don't close the terminal window directly
#             # important for windows users ;)
#             input("Please press [ENTER] to exit")
# 
#         atexit.register(confirm)
# 
#     print("\nrun DragonPy starter GUI...\n")
#     gui = StarterGUI(machine_dict)
#     gui.mainloop()


# Path: dragonpy/dev_shell.py
import argparse
import locale
import logging
import cmd2
import dragonpy
from pathlib import Path
from pprint import pprint
from cmd2 import Cmd2ArgumentParser
from creole.setup_utils import assert_rst_readme
from dev_shell.base_cmd2_app import DevShellBaseApp, run_cmd2_app
from dev_shell.command_sets import DevShellBaseCommandSet
from dev_shell.command_sets.dev_shell_commands import DevShellCommandSet as OriginDevShellCommandSet
from dev_shell.command_sets.dev_shell_commands import run_linters
from dev_shell.config import DevShellConfig
from dev_shell.utils.colorful import blue, bright_blue, bright_yellow, cyan, print_error
from dev_shell.utils.subprocess_utils import verbose_check_call
from poetry_publish.publish import poetry_publish
from basic_editor.editor import run_basic_editor
from dragonpy.components.rom import ROMDownloadError
from dragonpy.core.configs import machine_dict
from dragonpy.core.gui_starter import VERBOSITY_DICT, gui_mainloop

    parser.add_argument(
        '--machine',
        choices=sorted(machine_dict.keys()),
        default=machine_dict.DEFAULT,
        help='Used machine configuration (default: %(default)s)',
    )


def add_argument_verbosity(parser: Cmd2ArgumentParser):
    parser.add_argument(
        '--verbosity',
        type=int,
        choices=sorted(VERBOSITY_DICT.keys()),
        default=99,
        help='verbosity level to stdout (default: %(default)s)',
    )


@cmd2.with_default_category('DragonPy commands')
class DragonPyCommandSet(DevShellBaseCommandSet):
    def do_gui(self, statement: cmd2.Statement):
        """
        Start the DragonPy tkinter starter GUI
        """
        gui_mainloop(confirm_exit=False)

    def do_download_roms(self, statement: cmd2.Statement):
        """
        Download/Test only ROM files
        """

        roms = list(machine_dict.items())