(raw_args)
| 77 | |
| 78 | |
| 79 | def _launch_developer_console(raw_args) -> bool: |
| 80 | script_path = os.path.abspath(__file__) |
| 81 | python_cmd = [sys.executable, script_path] + list(raw_args) |
| 82 | command_line = subprocess.list2cmdline(python_cmd) |
| 83 | env = dict(os.environ) |
| 84 | env["TALON_DEV_CONSOLE"] = "1" |
| 85 | try: |
| 86 | subprocess.Popen( |
| 87 | ["cmd.exe", "/k", command_line], |
| 88 | creationflags=getattr(subprocess, "CREATE_NEW_CONSOLE", 0), |
| 89 | env=env, |
| 90 | ) |
| 91 | return True |
| 92 | except Exception as e: |
| 93 | logger.exception(f"Failed to launch developer console window: {e}") |
| 94 | show_error_popup( |
| 95 | t("errors.developer_console_failed", {"error": e}), |
| 96 | allow_continue=False, |
| 97 | ) |
| 98 | return False |
| 99 | |
| 100 | def parse_args(argv=None): |
| 101 | def _parse_bool(value: str) -> bool: |
no test coverage detected