src/eric7/WebBrowser/WebBrowserSingleApplication.py

branch
eric7
changeset 10303
ee1aadab1215
parent 10301
b4299b82fe37
child 10439
21c28b0f9e41
diff -r 8cb0dabf852f -r ee1aadab1215 src/eric7/WebBrowser/WebBrowserSingleApplication.py
--- a/src/eric7/WebBrowser/WebBrowserSingleApplication.py	Sat Nov 11 10:13:29 2023 +0100
+++ b/src/eric7/WebBrowser/WebBrowserSingleApplication.py	Sat Nov 11 12:44:51 2023 +0100
@@ -11,7 +11,6 @@
 
 from PyQt6.QtCore import pyqtSignal
 
-from eric7.SystemUtilities import OSUtilities
 from eric7.Toolbox.SingleApplication import (
     SingleApplicationClient,
     SingleApplicationServer,
@@ -134,27 +133,23 @@
         """
         Public method to process the command line args passed to the UI.
 
-        @param args list of command line arguments
-        @type list of str
+        @param args namespace object containing the parsed command line parameters
+        @type argparse.Namespace
         @param disconnect flag indicating to disconnect when done
         @type bool
         """
-        # no args, return
-        if args is None:
+        if args.shutdown:
+            # send shutdown command and return
+            self.__shutdown()
             return
 
-        argChars = ("-", "/") if OSUtilities.isWindowsPlatform() else ("-",)
-
-        for arg in args:
-            if arg.startswith("--search="):
-                self.__search(arg.replace("--search=", ""))
-            elif arg.startswith("--newtab="):
-                self.__newTab(arg.replace("--newtab=", ""))
-            elif arg == "--shutdown":
-                self.__shutdown()
-            elif not arg.startswith(argChars):
-                # it is an URL
-                self.__loadUrl(arg)
+        if args.search:
+            self.__search(args.search)
+        if args.new_tab:
+            for url in args.new_tab:
+                self.__newTab(url)
+        if args.home:
+            self.__loadUrl(args.home)
 
         if disconnect:
             self.disconnect()

eric ide

mercurial