Changeset 2477 for palm/trunk/SCRIPTS/palmrungui.py
- Timestamp:
- Sep 18, 2017 8:42:29 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrungui.py
r2413 r2477 25 25 # ----------------- 26 26 # $Id$ 27 # Renamed restart run appendix from "f" to "r". Bugfix for displaying restart runs.> 28 # Revised list of recently submitted jobs 29 # 30 # 2413 2017-09-06 12:48:29Z maronga 27 31 # Renamed to palmrungui and adapted for use with palmrun instead of mrun. 28 32 # … … 88 92 89 93 self.setupUi(self) 90 self.recent_jobs( 10)94 self.recent_jobs(50) 91 95 commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline") 92 96 commandline.setText("") … … 176 180 177 181 # Reload recent jobs 178 self.recent_jobs( 10)182 self.recent_jobs(50) 179 183 180 184 … … 200 204 i=len(history)-1 201 205 count = 0 202 while i>=0 and count< 10:206 while i>=0 and count<number: 203 207 timestamp = history[i][:16] 204 208 listitem = history[i][17:len(history[i])-1] 205 listitem = filter(None,listitem.split(" -d"))[1]206 listitem = filter(None,listitem.split(" -"))[0]207 listitem = listitem.replace(" ","");208 209 matchitems = list_jobname.findItems(listitem, QtCore.Qt.MatchExactly) 209 210 210 211 if ( len(matchitems) == 0 ): 212 listitem = filter(None,listitem.split(" -d"))[1] 213 listitem = filter(None,listitem.split(" -"))[0] 214 listitem = listitem.replace(" ",""); 211 215 list_jobname.addItem(listitem); 212 216 s = "%s (%s)" % (listitem,timestamp) … … 262 266 263 267 264 # select a job via doubleclick from list268 # select a job via click from list 265 269 ################################# 266 270 def choosejob_list(self): … … 272 276 # Reload list 273 277 self.setupUi(self) 274 self.recent_jobs( 10)278 self.recent_jobs(50) 275 279 276 280 # Set selected item to jobname … … 300 304 self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline); 301 305 self.setup_gui(palmrunline); 306 self.list_jobname.item(itemint).setSelected(True); 307 302 308 return 303 309 i = i-1 … … 375 381 else: 376 382 # Check if user code is available 377 usercode = "%s/ USER_CODE/%s" % (version_path,param[0])378 383 usercode = "%s/JOBS/%s/USER_CODE" % (version_path,param[0]) 384 379 385 if (os.path.exists(usercode) is True): 380 386 self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='green'>User code found.</font>") … … 390 396 391 397 jobname = self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text() 392 restartfile = "%s/JOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)398 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 393 399 394 400 if (os.path.exists(restartfile) == True): … … 397 403 398 404 if ( drop_job == "Restart run (coupled atmosphere ocean)" ): 399 restartfileo = "%s/JOBS/%s/INPUT/%s_p3do f" % (version_path,jobname,jobname)405 restartfileo = "%s/JOBS/%s/INPUT/%s_p3dor" % (version_path,jobname,jobname) 400 406 if (os.path.exists(restartfileo) == True): 401 407 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("hooo") 402 408 403 409 else: 404 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3do ffile found!</font>")410 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dor file found!</font>") 405 411 406 412 else: 407 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile found!</font>")413 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>") 408 414 409 415 … … 435 441 436 442 elif (drop_job == "Restart run"): 437 rc_flag = " f"443 rc_flag = "r" 438 444 439 445 elif (drop_job == "Precursor run (atmosphere)"): … … 447 453 448 454 elif (drop_job == "Restart run (coupled atmosphere ocean)"): 449 rc_flag = " f"455 rc_flag = "r" 450 456 451 457 param[0] = "\"d3%s" % (rc_flag) … … 525 531 param[0]="%s restart" % (param[0]) 526 532 527 # Check if _p3d ffile is available, otherwise notice user533 # Check if _p3dr file is available, otherwise notice user 528 534 if (status_restarts == 2): 529 535 jobname = str(self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text())[len(version_path)+len("/JOBS/"):] 530 restartfile = "%s/JOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)536 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 531 537 532 538 if (os.path.exists(restartfile) == True): … … 534 540 535 541 else: 536 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile found!</font>")542 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>") 537 543 538 544 else: … … 767 773 self.setupUi(self) 768 774 self.tabWidget.setCurrentIndex(0) 769 self.recent_jobs( 10)775 self.recent_jobs(50) 770 776 771 777 # Safes current commandline and user Parameters to .sav file … … 974 980 options_all = optionssplit[j] 975 981 options_2 = optionssplit[j][:2] 982 976 983 if (options_2 == "ts"): 977 984 self.group_runcontrol.findChild(QtGui.QCheckBox,"check_ts").setChecked(True) … … 1004 1011 self.group_runcontrol.findChild(QtGui.QCheckBox,"check_pts").setChecked(True) 1005 1012 1006 if (options_2 == "d3"): 1007 if (options_all[:3][ :-1] == "#"):1013 if (options_2 == "d3"): 1014 if (options_all[:3][-1] == "#"): 1008 1015 self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 1009 1010 elif (options_all[:3][:-1] == "f"): 1016 elif (options_all[:3][-1] == "r"): 1011 1017 self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 1012 1018 1013 elif (options_all[:3][ :-1] == "o"):1019 elif (options_all[:3][-1] == "o"): 1014 1020 ocean_run = True 1015 1021 … … 1019 1025 jobname = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(version_path)+len("/JOBS/"):] 1020 1026 1021 restartfile = "%sJOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)1027 restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 1022 1028 if (os.path.exists(restartfile) == True): 1023 1029 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("") 1024 1030 1025 1031 else: 1026 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile \found!</font>")1032 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file \found!</font>") 1027 1033 j = j+1 1028 1034
Note: See TracChangeset
for help on using the changeset viewer.