Changeset 177:e7e54a896aa3

Show
Ignore:
Timestamp:
11/26/08 03:40:55 (3 years ago)
Author:
cfreeze@…
Branch:
CAP_1.1
Message:

clean up the execution device to actually be usable on the commandline

Location:
StormSiren
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • StormSiren/EmailAlertDevice.py

    r175 r177  
    7878 
    7979        def send(self,alert): 
    80                 subject = EMAIL_SUBJECT_LEADER + " - " + alert.headline + alert.getAreas() 
     80                subject = EMAIL_SUBJECT_LEADER + " - " + alert.headline + " (" + alert.getAreas() + ")" 
    8181                alert_body = "" 
    8282 
  • StormSiren/ExecutionAlertDevice.py

    r122 r177  
    7777        def _execute(self,exe,alert): 
    7878                try: 
    79                         subprocess.Popen([exe,alert.id,WeatherTypes.toString(alert.type),alert.state,alert.county]).wait() 
    80                         self.log.info("Executing: [%s %s %s %s %s]" % (exe,alert.id,WeatherTypes.toString(alert.type),alert.state,alert.county)) 
     79                        subprocess.Popen([exe,alert.id,"\"" + WeatherTypes.toString(alert.type) + "\"",alert.state,"\"" + alert.getAreas() + "\""]).wait() 
     80                        self.log.info("Executing: [%s %s %s %s %s]" % (exe,alert.id,"\"" + WeatherTypes.toString(alert.type) + "\"",alert.state,"\"" + alert.getAreas() + "\"")) 
    8181                except os.error: 
    82                         self.log.error("Problem Executing: [%s %s %s %s %s]" % (exe,alert.id,WeatherTypes.toString(alert.type),alert.state,alert.county)) 
     82                        self.log.error("Problem Executing: [%s %s %s %s %s]" % (exe,alert.id,"\"" + WeatherTypes.toString(alert.type),alert.state,"\"" + alert.getAreas() + "\"")) 
    8383 
    8484class ExecutionAlertDeviceInfo(object): 
  • StormSiren/WeatherAlert.py

    r175 r177  
    6363 
    6464        def getText(self): 
    65                 str = self.headline + "\n\n" 
     65                str = self.headline + " (" + self.getAreas() + ")\n\n" 
    6666                str     += " Issued: " + self.issued + "\n" 
    6767                str += "Expires: " + self.expires + "\n" 
     
    8080 
    8181        def getAreas(self): 
    82                 str = "(" 
    83                 str += string.join(self.areas,',') 
    84                 str += ")" 
     82                str = string.join(self.areas,',') 
    8583                return str 
    8684 
  • StormSiren/WeatherTypes.py

    r122 r177  
    4242""" 
    4343 
     44import string 
     45 
    4446UNKNOWN   = 0 
    4547WARNING   = 1 
     
    7678                        wtypes.append("Alert") 
    7779 
    78                 return "(" + "|".join(wtypes) + ")" 
     80                return string.join(wtypes,"|") 
    7981        toString = staticmethod(toString) 
    8082