Changeset 155:4b4c6d29886e

Show
Ignore:
Timestamp:
11/15/08 21:08:33 (3 years ago)
Author:
chris
Branch:
unix
Message:

fix fetch simulation so that I can continue to work offline or without hammering the weather.gov site

Files:
3 modified
8 moved

Legend:

Unmodified
Added
Removed
  • StormSiren/XmlFetcher.py

    r154 r155  
    4343 
    4444import urllib2 
     45import urlparse 
    4546import logging 
    4647import sys 
     
    6162                try: 
    6263                        if(self.__simfetch): 
    63                                 self.log.info("Simulating fetch using examples directory") 
    64                                 dom = minidom.parse("examples/" + self.__url) 
     64                                urltuple = urlparse.urlparse(self.__url) 
     65                                file = "examples" + urltuple.path + "_" + urltuple.query 
     66                                self.log.info("Simulating fetch using examples directory: %s" % file) 
     67                                dom = minidom.parse(file) 
    6568                        else: 
    6669                                if(self.__proxy): 
  • StormSiren/XmlWeather.py

    r154 r155  
    4646from WeatherTypes import * 
    4747from XmlFetcher import * 
    48 from CAP import CAP 
     48from CapAtom import CapAtom 
    4949 
    5050class XmlWeather(object): 
     
    5555                self.__dom        = [] 
    5656                self.__baseurl    = 'http://www.weather.gov/wwarss-tst/' 
    57                 #self.__url        = self.__baseurl + self.__state.lower() + ".php?x=0"  
    58                 self.__url        = "http://www.weather.gov/alerts/" + self.__state.lower() + ".cap"  
    59                 #self.__tag_item   = 'cap:info' 
     57                #self.__url        = "http://www.weather.gov/alerts/" + self.__state.lower() + ".cap"  
     58                self.__url        = self.__baseurl + self.__state.lower() + ".php?x=0"  
    6059                self.__tag_item   = 'entry' 
    6160                self.__history    = history 
     
    8685        def __parse(self): 
    8786                for capXmlText in self.__dom.getElementsByTagName(self.__tag_item): 
    88                         cap_item = CAP(capXmlText, self.__state) 
    89                         #cap_item.display() 
     87                        cap_item = CapAtom(capXmlText, self.__state) 
     88                        cap_item.display() 
     89                        sys.exit(0) 
    9090                        if(not self.__history.exists(cap_item.id)): 
    9191                                alerted = self.handleAlert(cap_item) 
  • siren

    r142 r155  
    5151from StormSiren.History import History, DEFAULT_MAX_HISTORICAL_EVENTS 
    5252 
    53 __RELEASE_VERSION = "2.0 RC3" 
     53__RELEASE_VERSION = "2.0 RC4" 
    5454__RELEASE_MONTH   = "12" 
    5555__RELEASE_DAY     = "08"