Add mock mode support and input validation
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
import gi
|
||||
@@ -11,21 +12,30 @@ from .ui.window import InstallerWindow
|
||||
|
||||
|
||||
class IridiumInstallerApp(Adw.Application):
|
||||
def __init__(self):
|
||||
def __init__(self, mock_mode=False):
|
||||
super().__init__(
|
||||
application_id="org.iridium.Installer",
|
||||
flags=Gio.ApplicationFlags.FLAGS_NONE,
|
||||
)
|
||||
self.mock_mode = mock_mode
|
||||
|
||||
def do_activate(self):
|
||||
win = self.props.active_window
|
||||
if not win:
|
||||
win = InstallerWindow(application=self)
|
||||
win = InstallerWindow(application=self, mock_mode=self.mock_mode)
|
||||
win.present()
|
||||
|
||||
|
||||
def main():
|
||||
app = IridiumInstallerApp()
|
||||
parser = argparse.ArgumentParser(description="Iridium OS Installer")
|
||||
parser.add_argument(
|
||||
"--mock",
|
||||
action="store_true",
|
||||
help="Run in mock mode (no actual changes to disk)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
app = IridiumInstallerApp(mock_mode=args.mock)
|
||||
return app.run(sys.argv)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user