Changeset 1618 for palm/trunk/SCRIPTS/palm_wd
- Timestamp:
- Jul 13, 2015 6:52:15 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_wd
r1614 r1618 20 20 # Current revisions: 21 21 # ----------------- 22 # 22 # Added steering via configuration file .wd.config, to be place in the local 23 # palm directory. Watchdog save files are automatically created upon first start. 23 24 # 24 25 # Former revisions: … … 55 56 #------------------------------------------------------------------------------! 56 57 57 import sys 58 import subprocess as sub 58 import ConfigParser 59 import datetime 60 import os 59 61 from PyQt4 import QtGui, QtCore, uic 60 62 from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT 63 import shutil 64 import subprocess as sub 65 import sys 61 66 import time 62 import datetime63 import shutil64 import os65 66 # START OF HEADER67 # Each list must contain the login host, the username and a description68 hostname = ["hlogin.hlrn.de", "blogin.hlrn.de"]69 username = ["nikmaron" , "nikmaron" ]70 description = ["Hannover" , "Berlin" ]71 72 update_frequency = 600*100073 74 # END OF HEADER75 67 76 68 # Determine PALM directories … … 85 77 raise SystemExit 86 78 79 80 # Read configuration file 81 # First check if the configuration file exists 82 if ( os.path.exists(palm_dir + '/.wd.config') == False ): 83 print "Error. No configuration file .wd.config found in " + palm_dir 84 raise SystemExit 85 86 config = ConfigParser.RawConfigParser() 87 config.read(palm_dir + '/.wd.config') 88 89 description = [] 90 hostname = [] 91 username = [] 92 93 for i in range(0,len(config.sections())): 94 95 description_tmp = config.sections()[i] 96 97 if ( description_tmp != 'Settings' ): 98 description.append(description_tmp) 99 hostname.append(config.get(description_tmp, 'hostname')) 100 username.append(config.get(description_tmp, 'username')) 101 else: 102 update_frequency = int(config.get(description_tmp, 'update_frequency'))*60000 103 104 # Check if .wd.olddata and .wd.newdata exist. Otherwise create the files 105 if ( os.path.exists(palm_dir + '/.wd.olddata') == False ): 106 print "No .wd.olddata found. Creating..." 107 file1 = open(palm_dir + '/.wd.olddata', 'a') 108 file1.close() 109 110 111 if ( os.path.exists(palm_dir + '/.wd.newdata') == False ): 112 print "No .wd.newdata found. Creating..." 113 file1 = open(palm_dir + '/.wd.newdata', 'a') 114 file1.close() 87 115 88 116 # Dummy variables for the jobname and the progressbars
Note: See TracChangeset
for help on using the changeset viewer.