94 |
94 |
95 def __init__(self): |
95 def __init__(self): |
96 """ |
96 """ |
97 Constructor |
97 Constructor |
98 """ |
98 """ |
99 super.__init__(SAFile) |
99 super().__init__(SAFile) |
100 |
100 |
101 def processArgs(self, args): |
101 def processArgs(self, args): |
102 """ |
102 """ |
103 Public method to process the command line args passed to the UI. |
103 Public method to process the command line args passed to the UI. |
104 |
104 |
105 @param args list of files to open |
105 @param args namespace object containing the parsed command line parameters |
|
106 @type argparse.Namespace |
106 """ |
107 """ |
107 # no args, return |
|
108 if args is None: |
|
109 return |
|
110 |
|
111 uiFiles = [] |
108 uiFiles = [] |
112 qmFiles = [] |
109 qmFiles = [] |
113 |
110 |
114 for arg in args: |
111 for filename in args.file: |
115 ext = os.path.splitext(arg)[1].lower() |
112 ext = os.path.splitext(filename)[1].lower() |
116 |
113 |
117 if ext == ".ui": |
114 if ext == ".ui": |
118 uiFiles.append(arg) |
115 uiFiles.append(filename) |
119 elif ext == ".qm": |
116 elif ext == ".qm": |
120 qmFiles.append(arg) |
117 qmFiles.append(filename) |
|
118 elif ext == ".ts": |
|
119 qmFile = os.path.splitext(filename)[0] + ".qm" |
|
120 if os.path.exists(qmFile): |
|
121 qmFiles.append(qmFile) |
121 |
122 |
122 self.sendCommand(SALoadForm, uiFiles) |
123 self.sendCommand(SALoadForm, uiFiles) |
123 self.sendCommand(SALoadTranslation, qmFiles) |
124 self.sendCommand(SALoadTranslation, qmFiles) |
124 |
125 |
125 self.disconnect() |
126 self.disconnect() |