#scriptName = "Passing Input Args to Script.bat" #dssFileName = "columbia5_6hr.dss" #5 day, 6 hr dssFileName = "columbia10_6hr.dss" #10 day, 6 hr ### Functions ######################### def output(msg="") : ''' Output to console log ''' Browser.getBrowserFrame().addMessage("%s" % msg) ### Loading Config File --------------------------------------------------------------- output("\n\n--- Begin ESP DSS Download -------------------") output(str(time.ctime())) # #Getting shared directory frame = Browser.getBrowser().getBrowserFrame() proj = frame.getCurrentProject() #shdir = proj.getProjectDirectory() + "/shared" scriptsdir = proj.getProjectDirectory() + "/scripts/esp_download/" os.chdir(scriptsdir) scriptPath = proj.getProjectDirectory() + "/scripts/esp_download/Download_ESP.bat" #scriptPath = scriptPath.replace("\\","/") #args = shdir+"/"+dssFileName #Passing the location to save the DSS file #output("R Executable:\t%s\nESP Download Script:\t%s\nDSS Output Location:\t%s" % (rExecutablePath,scriptPath,args) ) #evalString = '"' + rExecutablePath + '" --vanilla "' + scriptPath + '" "' + args + '"' #output("String to evaluate:\n%s" % evalString) #os.system(evalString) #subprocess.call(evalString) evalString = '"'+scriptPath+'"' evalString=evalString.replace("\\","/") output("Calling Download Script:\t%s" % evalString)
def output(msg="") : ''' Output to console log ''' Browser.getBrowserFrame().addMessage("%s" % msg)
def warning(msg=""): ''' Output to console log ''' Browser.getBrowserFrame().addMessage(Message(" %s" % msg), "red")