Changeset 4405 for palm/trunk/SCRIPTS/palmrungui
- Timestamp:
- Feb 12, 2020 7:11:11 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrungui
r4394 r4405 25 25 # ----------------- 26 26 # $Id$ 27 # Major revisions: New layout. Merged with palm job manager (palm_jm). 28 # Minor revisions: Misc. bugs fixed. 29 # 30 # 4394 2020-02-04 21:40:38Z maronga 27 31 # Bugfix: harmonized naming convention of configuration files 28 32 # … … 74 78 import subprocess 75 79 from PyQt4 import QtCore, QtGui, uic 76 from PyQt4.QtCore import QProcess 80 from PyQt4.QtCore import QProcess,pyqtSlot,SIGNAL,SLOT 77 81 from time import strftime 78 82 import os 83 import shutil 84 79 85 80 86 … … 95 101 96 102 palmrunline = "" 103 set_list = [] 97 104 98 105 Ui_MainWindow = uic.loadUiType("%s/palmrungui_files/mainwindow.ui" % (palm_bin))[0] … … 114 121 super(Mainwindow, self).__init__() 115 122 self.setupUi(self) 116 117 self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png")) 123 124 self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png")) 118 125 119 126 self.recent_jobs(50) 127 self.load_jobs() 128 120 129 commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline") 121 130 commandline.setText("") … … 143 152 commandline.setText(palmrunline) 144 153 self.setup_gui(palmrunline) 145 154 155 156 157 QtGui.QApplication.processEvents() 158 159 146 160 147 161 # starts xterm with palmrun commandline … … 224 238 j = 0; 225 239 226 list_jobname = self.group_ job.findChild(QtGui.QListWidget,"list_jobname")240 list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname") 227 241 list_jobname.clear() 228 242 … … 261 275 ############################### 262 276 def enable_coupled(self): 263 coupledState = self.group_ job.findChild(QtGui.QComboBox, "drop_job").currentText()277 coupledState = self.group_execution.findChild(QtGui.QComboBox, "drop_job").currentText() 264 278 group = self.group_execution.findChild(QtGui.QGroupBox, "group_coupled") 265 279 … … 269 283 self.group_coupled.setEnabled(False) 270 284 271 272 # select a job via "select"-button 273 ################################ 274 def choosejob(self): 275 jobDir = "%s/JOBS" % (palm_dir) 276 277 # Pick a job from dialog 278 filename = QtGui.QFileDialog.getExistingDirectory(self, "Open a folder", jobDir, QtGui.QFileDialog.ShowDirsOnly) 279 280 # If a file was selected, load it into mainwindow 281 if ( filename != ""): 282 jobname = os.path.basename(unicode(filename)) 283 self.group_job.findChild(QtGui.QLineEdit,"line_jobname").setText(jobname) 284 self.group_job.findChild(QtGui.QListWidget,"list_jobname").clearSelection() 285 286 # Change palmrunline accordingly 287 self.change_commandline("r","") 288 self.change_commandline("a","") 289 return 290 else: 291 return 292 293 285 294 286 # select a job via click from list 295 287 ################################# 296 288 def choosejob_list(self): 297 289 # Get selected item from list 298 list_jobname = self.group_ job.findChild(QtGui.QListWidget,"list_jobname")290 list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname") 299 291 filename = str(list_jobname.currentItem().text()) 292 293 timestamp = filename[len(filename)-17:][:16] 294 jobname = filename[:len(filename) - 19]; 295 300 296 itemint = list_jobname.currentRow() 301 297 302 298 # Reload list 303 self.setupUi(self)304 299 self.recent_jobs(50) 300 self.load_jobs() 305 301 306 302 # Set selected item to jobname 307 303 list_jobname.item(itemint).setSelected(True); 308 304 309 timestamp = filename[len(filename)-17:][:16] 310 jobname = filename[:len(filename) - 19]; 305 # Set selected item to jobname in "available jobs" list 306 item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive) 307 self.list_jobs.setCurrentItem(item2int[0]) 308 self.update_input() 311 309 312 310 fileDir = "%s/.palmrungui.history" % (palm_dir) … … 338 336 ###################################################### 339 337 def change_rc_list(self): 340 drop_job = self.group_ job.findChild(QtGui.QComboBox,"drop_job").currentText()338 drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText() 341 339 self.change_commandline("a","") 342 340 … … 381 379 # Change in parameter "r" (jobname) 382 380 if (id_str == "r"): 383 filename = str(self.group_ job.findChild(QtGui.QLineEdit,"line_jobname").text())381 filename = str(self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").text()) 384 382 s = filename.split("JOBS/") 385 383 param[0] = s[len(s)-1] … … 387 385 if ( initialize == True ):#and self.group_runcontrol.isEnabled() == True ): 388 386 self.group_execution.setEnabled(True) 389 self.group_ job.findChild(QtGui.QComboBox,"drop_job").setEnabled(True)387 self.group_execution.findChild(QtGui.QComboBox,"drop_job").setEnabled(True) 390 388 self.group_advanced.setEnabled(True) 391 389 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) … … 394 392 elif ( param[0] == ""): 395 393 self.group_execution.setEnabled(False) 396 self.group_ job.findChild(QtGui.QComboBox,"drop_job").setEnabled(False)394 self.group_execution.findChild(QtGui.QComboBox,"drop_job").setEnabled(False) 397 395 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False) 398 396 self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(False) … … 400 398 self.delete_commandline("r") 401 399 self.change_commandline("a","remove") 402 self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("")403 400 return 1 404 401 405 402 else: 406 # Check if user code is available 407 usercode = "%s/JOBS/%s/USER_CODE" % (palm_dir,param[0]) 408 409 if (os.path.exists(usercode) is True): 410 self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='green'>User code found.</font>") 411 412 else: 413 self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='red'>Warning: no user code found!</font>") 414 415 416 # Check if _pdf file is available, otherwise notice user 417 drop_job = self.group_job.findChild(QtGui.QComboBox,"drop_job").currentText() 403 404 # Check if _p3dr file is available, otherwise notice user 405 drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText() 418 406 if ( self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").checkState() == 2 or 419 407 drop_job == "Restart run" or drop_job == "Restart run (coupled atmosphere ocean)" ): 420 408 421 jobname = self.group_ job.findChild(QtGui.QLineEdit, "line_jobname").text()409 jobname = self.group_execution.findChild(QtGui.QLineEdit, "line_jobname").text() 422 410 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname) 423 411 … … 446 434 elif (id_str == "a"): 447 435 448 drop_job = self.group_ job.findChild(QtGui.QComboBox,"drop_job").currentText()436 drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText() 449 437 rc_flag = "#" 450 438 … … 485 473 # Check if _p3dr file is available, otherwise notice user 486 474 if (status_restarts == 2): 487 jobname = str(self.group_ job.findChild(QtGui.QLineEdit, "line_jobname").text())[len(palm_dir)+len("/JOBS/"):]475 jobname = str(self.group_execution.findChild(QtGui.QLineEdit, "line_jobname").text()) 488 476 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname) 489 490 477 if (os.path.exists(restartfile) == True): 491 478 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("") … … 544 531 tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_host").text() 545 532 self.change_commandline("c",tmptext) 546 547 elif ( self.sender() == self.group_job.findChild(QtGui.QLineEdit, "line_jobname") ):548 tmptext = self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text()549 self.change_commandline("r",tmptext)550 533 551 534 elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_q")): … … 731 714 self.setupUi(self) 732 715 self.tabWidget.setCurrentIndex(0) 716 self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png")) 733 717 self.recent_jobs(50) 718 self.load_jobs() 734 719 735 720 # Safes current commandline and user Parameters to .sav file … … 772 757 file.close() 773 758 774 # Execute command which starts jobmanager (start palm_jm)775 #######################################################776 def start_jobmanager(self):777 subprocess.Popen(["nohup","palm_jm",">>","/dev/null", "2>&1","&"])778 759 779 760 # Executes command which starts watchdog (start palm_wd) … … 798 779 def setup_gui(self, palmrun_str): 799 780 800 self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))781 #self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png")) 801 782 802 783 # Some initial settings … … 813 794 814 795 else: 815 self.group_ job.setEnabled(True)796 self.group_execution.setEnabled(True) 816 797 817 798 # Loop for all parameters in palmrunline … … 831 812 832 813 if ( options != ""): 833 self.group_ job.findChild(QtGui.QLineEdit,"line_jobname").setText(options)814 self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(options) 834 815 nojob = False 835 816 … … 925 906 926 907 elif ( parameter == "y"): 927 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3)908 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 928 909 929 910 … … 944 925 if (options_2 == "d3"): 945 926 if (options_all[:3][-1] == "#"): 946 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0)927 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 947 928 elif (options_all[:3][-1] == "r"): 948 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1)929 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 949 930 950 931 elif (options_all[:3][-1] == "o"): … … 954 935 self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").setChecked(True) 955 936 # Check if _pdf file is available, otherwise notice user 956 jobname = str(self.group_ job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(palm_dir)+len("/JOBS/"):]937 jobname = str(self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").text()) 957 938 958 939 restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname) … … 974 955 if ( ocean_run == True ): 975 956 if ( coupled_run == True ): 976 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(4)957 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(4) 977 958 978 959 else: 979 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3)960 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 980 961 981 962 if ( user != ""): … … 991 972 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False) 992 973 self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(False) 993 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setEnabled(False)974 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(False) 994 975 self.group_advanced.setEnabled(False) 995 976 self.check_advanced.setEnabled(False) … … 999 980 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) 1000 981 self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(True) 1001 self.group_ job.findChild(QtGui.QComboBox, "drop_job").setEnabled(True)982 self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(True) 1002 983 self.group_advanced.setEnabled(True) 1003 984 … … 1049 1030 self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline) 1050 1031 self.setup_gui(palmrunline) 1032 1033 1034 1035 def update_all(self): 1036 1037 self.setEnabled(False) 1038 self.list_input.clear() 1039 self.list_user.clear() 1040 self.list_monitoring.clear() 1041 self.list_output.clear() 1042 self.load_jobs() 1043 self.setEnabled(True) 1044 1045 # Load jobs into list 1046 def load_jobs(self): 1047 1048 self.list_jobs.clear() 1049 self.push_copy.setEnabled(False) 1050 self.push_create_set.setEnabled(False) 1051 1052 self.line_path.setText(job_dir + "/") 1053 1054 list_of_files = os.listdir(job_dir) 1055 1056 for i in range(0,len(list_of_files)): 1057 tmp_file = job_dir + "/" + list_of_files[i] 1058 1059 if ( os.path.isdir(tmp_file) ): 1060 self.list_jobs.addItem(str(list_of_files[i])) 1061 1062 1063 # Update input and user code lists 1064 def update_input(self): 1065 1066 self.list_input.clear() 1067 self.list_user.clear() 1068 self.list_monitoring.clear() 1069 self.list_output.clear() 1070 self.push_copy.setEnabled(True) 1071 self.push_create_set.setEnabled(True) 1072 1073 job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/INPUT" 1074 1075 if ( os.path.isdir(job_to_show) ): 1076 1077 list_of_files = os.listdir(job_to_show) 1078 1079 for i in range(0,len(list_of_files)): 1080 tmp_file = job_to_show + "/" + list_of_files[i] 1081 1082 if ( os.path.isfile(tmp_file) ): 1083 self.list_input.addItem(str(list_of_files[i])) 1084 1085 job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/USER_CODE" 1086 1087 if ( os.path.isdir(job_to_show) ): 1088 1089 list_of_files = os.listdir(job_to_show) 1090 1091 for i in range(0,len(list_of_files)): 1092 tmp_file = job_to_show + "/" + list_of_files[i] 1093 1094 if ( os.path.isfile(tmp_file) ): 1095 self.list_user.addItem(str(list_of_files[i])) 1096 1097 job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/MONITORING" 1098 1099 if ( os.path.isdir(job_to_show) ): 1100 1101 list_of_files = os.listdir(job_to_show) 1102 1103 for i in range(0,len(list_of_files)): 1104 tmp_file = job_to_show + "/" + list_of_files[i] 1105 1106 if ( os.path.isfile(tmp_file) ): 1107 self.list_monitoring.addItem(str(list_of_files[i])) 1108 1109 job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/OUTPUT" 1110 1111 if ( os.path.isdir(job_to_show) ): 1112 1113 list_of_files = os.listdir(job_to_show) 1114 1115 for i in range(0,len(list_of_files)): 1116 tmp_file = job_to_show + "/" + list_of_files[i] 1117 1118 if ( os.path.isfile(tmp_file) ): 1119 self.list_output.addItem(str(list_of_files[i])) 1120 1121 self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(self.list_jobs.currentItem().text()) 1122 self.group_history.findChild(QtGui.QListWidget,"list_jobname").clearSelection() 1123 1124 # Change palmrunline accordingly 1125 self.change_commandline("r","") 1126 self.change_commandline("a","") 1127 1128 1129 # Make a copy of a job 1130 def copy_job(self): 1131 1132 self.setEnabled(False) 1133 old_job_name = self.list_jobs.currentItem().text() 1134 1135 text, ret = QtGui.QInputDialog.getText(self, "Copy job", "Enter new job name:", mode = QtGui.QLineEdit.Normal, text = old_job_name) 1136 1137 if ( ret ): 1138 new_job_name = str(text) 1139 else: 1140 self.setEnabled(True) 1141 return 1142 1143 new_input_dir = job_dir + "/" + new_job_name + "/INPUT" 1144 1145 # check if a job exists with the new job name 1146 if ( os.path.isdir(new_input_dir) ): 1147 notify = QtGui.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.") 1148 self.setEnabled(True) 1149 return 1150 else: 1151 os.makedirs(new_input_dir) 1152 1153 # copy and rename input files (if present) 1154 job_to_copy = job_dir + "/" + old_job_name + "/INPUT" 1155 1156 if ( os.path.isdir(job_to_copy) ): 1157 1158 list_of_files = os.listdir(job_to_copy) 1159 1160 for i in range(0,len(list_of_files)): 1161 1162 tmp_file = job_to_copy + "/" + list_of_files[i] 1163 new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name) 1164 shutil.copy(tmp_file, new_file) 1165 1166 1167 1168 1169 new_user_dir = job_dir + "/" + new_job_name + "/USER_CODE" 1170 1171 # check if user code exists in the new job directory 1172 if ( os.path.isdir(new_user_dir) ): 1173 notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.") 1174 self.setEnabled(True) 1175 return 1176 else: 1177 os.makedirs(new_user_dir) 1178 1179 1180 # copy user code files (if present) 1181 user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE" 1182 1183 if ( os.path.isdir(user_to_copy) ): 1184 1185 list_of_files = os.listdir(user_to_copy) 1186 1187 for i in range(0,len(list_of_files)): 1188 1189 tmp_file = user_to_copy + "/" + list_of_files[i] 1190 new_file = new_user_dir + "/" + list_of_files[i] 1191 shutil.copy(tmp_file, new_file) 1192 1193 self.load_jobs() 1194 self.list_input.clear() 1195 self.list_user.clear() 1196 self.list_monitoring.clear() 1197 self.list_output.clear() 1198 self.setEnabled(True) 1199 1200 1201 # Create a whole set of jobs 1202 def create_set(self): 1203 1204 global set_list 1205 # disable mainwindow 1206 self.setEnabled(False) 1207 1208 # show Options Dialog 1209 opt = CreateSetBox() 1210 opt.exec_() 1211 1212 old_job_name = self.list_jobs.currentItem().text() 1213 1214 for j in range(0,len(set_list)): 1215 1216 if ( set_list[j] != "" ): 1217 new_job_name = str(set_list[j]) 1218 new_input_dir = job_dir + "/" + str(set_list[j]) + "/INPUT" 1219 else: 1220 continue 1221 1222 # check if a job exists with the new job name 1223 if ( os.path.isdir(new_input_dir) ): 1224 notify = QtGui.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.") 1225 self.setEnabled(True) 1226 return 1227 else: 1228 os.makedirs(new_input_dir) 1229 1230 # copy and rename input files (if present) 1231 job_to_copy = job_dir + "/" + old_job_name + "/INPUT" 1232 1233 if ( os.path.isdir(job_to_copy) ): 1234 1235 list_of_files = os.listdir(job_to_copy) 1236 1237 for i in range(0,len(list_of_files)): 1238 1239 tmp_file = job_to_copy + "/" + list_of_files[i] 1240 new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name) 1241 shutil.copy(tmp_file, new_file) 1242 1243 1244 new_user_dir = job_dir + "/" + new_job_name + "/USER_CODE" 1245 1246 # check if user code exists in the new job directory 1247 if ( os.path.isdir(new_user_dir) ): 1248 notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.") 1249 self.setEnabled(True) 1250 return 1251 else: 1252 os.makedirs(new_user_dir) 1253 1254 1255 # copy user code files (if present) 1256 user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE" 1257 1258 if ( os.path.isdir(user_to_copy) ): 1259 1260 list_of_files = os.listdir(user_to_copy) 1261 1262 for i in range(0,len(list_of_files)): 1263 1264 tmp_file = user_to_copy + "/" + list_of_files[i] 1265 new_file = new_user_dir + "/" + list_of_files[i] 1266 shutil.copy(tmp_file, new_file) 1267 1268 self.load_jobs() 1269 self.list_input.clear() 1270 self.list_user.clear() 1271 self.list_monitoring.clear() 1272 self.list_output.clear() 1273 1274 self.setEnabled(True) 1275 set_list = [] 1276 1277 # Add a custom context menu 1278 def openmenuinput(self, position): 1279 1280 menu = QtGui.QMenu() 1281 1282 selection = self.list_input.selectedItems() 1283 1284 if ( len(selection) != 0 ): 1285 1286 openAction = menu.addAction('Open selected files') 1287 openAction.setStatusTip('Open file(s) in your favorite editor') 1288 openAction.triggered.connect(self.OpenFilesInput) 1289 action = menu.exec_(self.list_input.mapToGlobal(position)) 1290 1291 # Add a custom context menu 1292 def openmenuuser(self, position): 1293 1294 menu = QtGui.QMenu() 1295 1296 selection = self.list_user.selectedItems() 1297 1298 if ( len(selection) != 0 ): 1299 1300 openAction = menu.addAction('Open selected files') 1301 openAction.setStatusTip('Open file(s) in your favorite editor') 1302 openAction.triggered.connect(self.OpenFilesUser) 1303 action = menu.exec_(self.list_user.mapToGlobal(position)) 1304 1305 # Add a custom context menu 1306 def openmenuoutput(self, position): 1307 1308 menu = QtGui.QMenu() 1309 1310 selection = self.list_output.selectedItems() 1311 1312 print("test") 1313 if ( len(selection) != 0 ): 1314 1315 openAction = menu.addAction('Open selected files') 1316 openAction.setStatusTip('Open file(s) in your favorite editor') 1317 openAction.triggered.connect(self.OpenFilesOutput) 1318 action = menu.exec_(self.list_output.mapToGlobal(position)) 1319 1320 # Add a custom context menu 1321 def openmenumonitoring(self, position): 1322 1323 menu = QtGui.QMenu() 1324 1325 selection = self.list_monitoring.selectedItems() 1326 1327 if ( len(selection) != 0 ): 1328 1329 openAction = menu.addAction('Open selected files') 1330 openAction.setStatusTip('Open file(s) in your favorite editor') 1331 openAction.triggered.connect(self.OpenFilesMonitoring) 1332 action = menu.exec_(self.list_monitoring.mapToGlobal(position)) 1333 1334 def OpenFilesInput(self): 1335 1336 sel_job = self.list_jobs.currentItem().text() 1337 sel_files = self.list_input.selectedItems() 1338 1339 input_dir = job_dir + "/" + sel_job + "/INPUT/" 1340 1341 open_files = "" 1342 for i in range(0,len(sel_files)): 1343 open_files = open_files + "xdg-open " + input_dir + sel_files[i].text() + "; " 1344 1345 os.system(str(open_files)) 1346 1347 def OpenFilesUser(self): 1348 1349 sel_job = self.list_jobs.currentItem().text() 1350 sel_files = self.list_user.selectedItems() 1351 1352 input_dir = job_dir + "/" + sel_job + "/USER_CODE/" 1353 1354 open_files = "" 1355 for i in range(0,len(sel_files)): 1356 open_files = open_files + "xdg-open " + input_dir + sel_files[i].text() + "; " 1357 1358 os.system(str(open_files)) 1359 selection = self.list_jobs.selectedItems() 1360 1361 def OpenFilesMonitoring(self): 1362 1363 sel_job = self.list_jobs.currentItem().text() 1364 sel_files = self.list_monitoring.selectedItems() 1365 1366 input_dir = job_dir + "/" + sel_job + "/MONITORING/" 1367 1368 open_files = "" 1369 for i in range(0,len(sel_files)): 1370 open_files = open_files + "xdg-open " + input_dir + sel_files[i].text() + "; " 1371 1372 os.system(str(open_files)) 1373 selection = self.list_jobs.selectedItems() 1374 1375 def OpenFilesOutput(self): 1376 1377 sel_job = self.list_jobs.currentItem().text() 1378 sel_files = self.list_output.selectedItems() 1379 1380 input_dir = job_dir + "/" + sel_job + "/OUTPUT/" 1381 1382 open_files = "" 1383 for i in range(0,len(sel_files)): 1384 open_files = open_files + "xdg-open " + input_dir + sel_files[i].text() + "; " 1385 1386 os.system(str(open_files)) 1387 selection = self.list_jobs.selectedItems() 1388 1389 # Message box for showing RUN_CONTROL output 1390 class CreateSetBox(QtGui.QDialog): 1391 def __init__(self): 1392 1393 super(CreateSetBox, self).__init__() 1394 1395 uic.loadUi(palm_bin + '/palmrungui_files/create_set.ui', self) 1396 1397 self.show() 1398 1399 return 1400 1401 # Cancel button 1402 def rejected(self): 1403 1404 self.close() 1405 1406 return 1407 1408 1409 # OK button 1410 def accept(self): 1411 1412 global set_list 1413 1414 text = self.list.toPlainText() 1415 set_list = text.split('\n') 1416 self.close() 1417 1418 return 1419 1420 1051 1421 1052 1422
Note: See TracChangeset
for help on using the changeset viewer.