Changeset 2484 for palm/trunk/SCRIPTS/palm_jm
- Timestamp:
- Sep 20, 2017 2:22:42 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_jm
r2068 r2484 16 16 # 17 17 # Copyright 1997-2016 Leibniz Universitaet Hannover 18 # --------------------------------------------------------------------------------#18 ##--------------------------------------------------------------------------------# 19 19 # 20 20 # Current revisions: … … 25 25 # ----------------- 26 26 # $Id$ 27 # Adapted for palmrun with USER_CODE always stored under /JOBS/name/USER_CODE/. 28 # Added PALM logo 29 # 30 # 2068 2016-11-11 21:59:39Z maronga 27 31 # 28 32 # 2067 2016-11-11 21:55:49Z maronga … … 68 72 palm_dir = out.split("palm")[0] + "palm/" + out.split("palm")[1].split("/")[1] 69 73 out = None 70 71 # remove this line on release 72 # palm_dir = '/home/maronga/PUB/thinktank/maronga/job_manager' 73 74 74 75 job_dir = palm_dir + '/JOBS' 75 76 user_dir = palm_dir + '/USER_CODE' … … 95 96 # Load predefined mainwindow 96 97 uic.loadUi(palm_bin + '/palm_jm_files/palm_jm.ui', self) 98 99 self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png")) 100 101 97 102 98 103 # Display MainWindow … … 100 105 QtGui.QApplication.processEvents() 101 106 102 self.load_jobs()107 #self.load_jobs() 103 108 104 109 … … 149 154 self.list_input.addItem(str(list_of_files[i])) 150 155 151 job_to_show = user_dir + "/" + self.list_jobs.currentItem().text()156 job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/USER_CODE" 152 157 153 158 if ( os.path.isdir(job_to_show) ): … … 199 204 shutil.copy(tmp_file, new_file) 200 205 201 # copy and rename user code (if present) 202 user_code_to_copy = user_dir + "/" + old_job_name 203 new_user_code_dir = user_dir + "/" + new_job_name 204 205 # check if a job exists with the new job name 206 if ( os.path.isdir(new_user_code_dir) ): 207 notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directory with the new name already exists.") 206 207 208 209 new_user_dir = job_dir + "/" + new_job_name + "/USER_CODE" 210 211 # check if user code exists in the new job directory 212 if ( os.path.isdir(new_user_dir) ): 213 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.") 208 214 self.setEnabled(True) 209 215 return 210 216 else: 211 os.makedirs(new_user_code_dir) 212 213 if ( os.path.isdir(user_code_to_copy) ): 214 215 list_of_files = os.listdir(user_code_to_copy) 217 os.makedirs(new_user_dir) 218 219 220 # copy user code files (if present) 221 user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE" 222 223 if ( os.path.isdir(user_to_copy) ): 224 225 list_of_files = os.listdir(user_to_copy) 216 226 217 227 for i in range(0,len(list_of_files)): 218 228 219 tmp_file = user_ code_to_copy + "/" + list_of_files[i]220 new_file = new_user_ code_dir + "/" + list_of_files[i]229 tmp_file = user_to_copy + "/" + list_of_files[i] 230 new_file = new_user_dir + "/" + list_of_files[i] 221 231 shutil.copy(tmp_file, new_file) 222 232 … … 269 279 shutil.copy(tmp_file, new_file) 270 280 271 # copy and rename user code (if present) 272 user_code_to_copy = user_dir + "/" + old_job_name 273 new_user_code_dir = user_dir + "/" + new_job_name 274 275 # check if a job exists with the new job name 276 if ( os.path.isdir(new_user_code_dir) ): 277 notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directory with the new name already exists.") 278 self.setEnabled(True) 279 return 281 282 new_user_dir = job_dir + "/" + new_job_name + "/USER_CODE" 283 284 # check if user code exists in the new job directory 285 if ( os.path.isdir(new_user_dir) ): 286 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.") 287 self.setEnabled(True) 288 return 280 289 else: 281 os.makedirs(new_user_code_dir) 282 283 if ( os.path.isdir(user_code_to_copy) ): 284 285 list_of_files = os.listdir(user_code_to_copy) 290 os.makedirs(new_user_dir) 291 292 293 # copy user code files (if present) 294 user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE" 295 296 if ( os.path.isdir(user_to_copy) ): 297 298 list_of_files = os.listdir(user_to_copy) 286 299 287 300 for i in range(0,len(list_of_files)): 288 301 289 tmp_file = user_ code_to_copy + "/" + list_of_files[i]290 new_file = new_user_ code_dir + "/" + list_of_files[i]302 tmp_file = user_to_copy + "/" + list_of_files[i] 303 new_file = new_user_dir + "/" + list_of_files[i] 291 304 shutil.copy(tmp_file, new_file) 292 305 … … 345 358 sel_files = self.list_user.selectedItems() 346 359 347 input_dir = user_dir + "/" + sel_job + "/"360 input_dir = job_dir + "/" + sel_job + "/USER_CODE/" 348 361 349 362 open_files = ""
Note: See TracChangeset
for help on using the changeset viewer.