src/eric7/EricWidgets/EricSingleApplication.py

branch
eric7
changeset 10303
ee1aadab1215
parent 10301
b4299b82fe37
child 10423
299802979277
diff -r 8cb0dabf852f -r ee1aadab1215 src/eric7/EricWidgets/EricSingleApplication.py
--- a/src/eric7/EricWidgets/EricSingleApplication.py	Sat Nov 11 10:13:29 2023 +0100
+++ b/src/eric7/EricWidgets/EricSingleApplication.py	Sat Nov 11 12:44:51 2023 +0100
@@ -37,7 +37,7 @@
         """
         Constructor
         """
-        SingleApplicationServer.__init__(self, SAFile)
+        super().__init__(SAFile)
 
     def handleCommand(self, command, arguments):
         """
@@ -106,38 +106,28 @@
         """
         Constructor
         """
-        SingleApplicationClient.__init__(self, SAFile)
+        super().__init__(SAFile)
 
     def processArgs(self, args):
         """
         Public method to process the command line args passed to the UI.
 
-        @param args list of files to open
+        @param args namespace object containing the parsed command line parameters
+        @type argparse.Namespace
         """
-        # no args, return
-        if args is None:
-            return
-
-        if "--" in args:
-            # store args after a '--' as a space delimited list of command args, if any
-            ddindex = args.index("--")
-            argsStr = " ".join(args[ddindex + 1:])
-            args = args[:ddindex]
-        else:
-            argsStr = None
-
-        for arg in args:
-            ext = os.path.normcase(os.path.splitext(arg)[1])
+        for filename in args.file_or_project:
+            ext = os.path.normcase(os.path.splitext(filename)[1])
 
             if ext in (".epj", ".e4p"):
-                self.__openProject(arg)
+                self.__openProject(filename)
             elif ext in (".emj", ".e4m", ".e5m"):
-                self.__openMultiProject(arg)
+                self.__openMultiProject(filename)
             else:
-                self.__openFile(arg)
+                self.__openFile(filename)
 
-        # send any args we had
-        if argsStr is not None:
+        if args.dd_args:
+            # send any args we had
+            argsStr = " ".join(args.dd_args)
             self.__sendArguments(argsStr)
 
         self.disconnect()

eric ide

mercurial