src/eric7/Tools/TRSingleApplication.py

branch
eric7
changeset 10303
ee1aadab1215
parent 10301
b4299b82fe37
child 10431
64157aeb0312
--- a/src/eric7/Tools/TRSingleApplication.py	Sat Nov 11 10:13:29 2023 +0100
+++ b/src/eric7/Tools/TRSingleApplication.py	Sat Nov 11 12:44:51 2023 +0100
@@ -96,28 +96,29 @@
         """
         Constructor
         """
-        super.__init__(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
-
         uiFiles = []
         qmFiles = []
 
-        for arg in args:
-            ext = os.path.splitext(arg)[1].lower()
+        for filename in args.file:
+            ext = os.path.splitext(filename)[1].lower()
 
             if ext == ".ui":
-                uiFiles.append(arg)
+                uiFiles.append(filename)
             elif ext == ".qm":
-                qmFiles.append(arg)
+                qmFiles.append(filename)
+            elif ext == ".ts":
+                qmFile = os.path.splitext(filename)[0] + ".qm"
+                if os.path.exists(qmFile):
+                    qmFiles.append(qmFile)
 
         self.sendCommand(SALoadForm, uiFiles)
         self.sendCommand(SALoadTranslation, qmFiles)

eric ide

mercurial