Show
Ignore:
Timestamp:
11/16/08 22:36:24 (3 years ago)
Author:
chris
Branch:
unix
Message:

reworked area filtering to work on the new areaDesc that has replaced a single county in the original CAP feed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • StormSiren/AlertDevice.py

    r122 r160  
    135135                return False 
    136136 
    137         def isCountyWanted(self,state,county): 
     137        def isAreaWanted(self,state,alert_areas): 
    138138                if(self.__areas.has_key(state)): 
    139                         if(county.lower() in self.__areas[state]): 
    140                                 return True 
     139                        for area in alert_areas: 
     140                                if(area.lower() in self.__areas[state]): 
     141                                        return True 
    141142                return False 
    142143 
     
    145146                if(self.isTypeWanted(cap_alert.type) and self.isStateWanted(cap_alert.state)): 
    146147                        self.log.debug("Testing[%s]: type and state match(%s/%i)" % (cap_alert.id, cap_alert.state, cap_alert.type)) 
    147                         if(self.isCountyWanted(cap_alert.state, cap_alert.county)): 
    148                                 self.log.info("Alert hit on county[%s/%s]: %s" % (cap_alert.county, cap_alert.state, cap_alert.id)) 
     148                        if(self.isAreaWanted(cap_alert.state, cap_alert.areas)): 
     149                                self.log.debug("Alert hit on area[%s/%s]: %s" % (cap_alert.state, cap_alert.id, cap_alert.areas)) 
    149150                                return True 
    150                         else: 
    151                                 for loc in self.__areas[cap_alert.state]: 
    152                                         if(cap_alert.isLocationInDesc(loc)): 
    153                                                 self.log.info("Alert hit on location[%s/%s]: %s" % (loc, cap_alert.state, cap_alert.id)) 
    154                                                 return True 
    155151                return False 
    156152#CODE END