Show
Ignore:
Timestamp:
11/28/08 18:18:12 (3 years ago)
Author:
chris@…
Branch:
default
Parents:
186:fdaf10ceded4 (diff), 183:1e15754ebd2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

moving the CAP 1.1 work in the default branch

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • StormSiren/AlertDevice.py

    r170 r187  
    5959                self.log = logging.getLogger('AlertDevice') 
    6060 
     61                self.log.setLevel(logging.INFO) 
    6162                self.__parse_weather_types(alerts) 
    6263                self.__parse_areas(areas) 
  • StormSiren/AlertDevice.py

    r184 r187  
    136136                return False 
    137137 
    138         def isCountyWanted(self,state,county): 
     138        def isAreaWanted(self,state,alert_areas): 
    139139                if(self.__areas.has_key(state)): 
    140                         if(county.lower() in self.__areas[state]): 
    141                                 return True 
     140                        for area in alert_areas: 
     141                                self.log.debug("checking if %s is in (%s)" % (area.lower(),self.__areas[state])) 
     142                                if(area.lower() in self.__areas[state]): 
     143                                        self.log.debug("%s IS IN (%s)" % (area.lower(),self.__areas[state])) 
     144                                        return True 
    142145                return False 
    143146 
     
    146149                if(self.isTypeWanted(cap_alert.type) and self.isStateWanted(cap_alert.state)): 
    147150                        self.log.debug("Testing[%s]: type and state match(%s/%i)" % (cap_alert.id, cap_alert.state, cap_alert.type)) 
    148                         if(self.isCountyWanted(cap_alert.state, cap_alert.county)): 
    149                                 self.log.info("Alert hit on county[%s/%s]: %s" % (cap_alert.county, cap_alert.state, cap_alert.id)) 
     151                        if(self.isAreaWanted(cap_alert.state, cap_alert.areas)): 
     152                                self.log.debug("Alert hit on area[%s/%s]: %s" % (cap_alert.state, cap_alert.id, cap_alert.areas)) 
    150153                                return True 
    151154                        else: 
    152                                 for loc in self.__areas[cap_alert.state]: 
    153                                         if(cap_alert.isLocationInDesc(loc)): 
    154                                                 self.log.info("Alert hit on location[%s/%s]: %s" % (loc, cap_alert.state, cap_alert.id)) 
    155                                                 return True 
     155                                self.log.debug("Testing[%s]: alert not in watched area(%s/%s)" % (cap_alert.id, cap_alert.state, cap_alert.areas)) 
     156                else: 
     157                        self.log.debug("Testing[%s]: Either wrong type or state (%s/%i)" % (cap_alert.id, cap_alert.state, cap_alert.type)) 
    156158                return False 
    157159#CODE END