Exemple #1
0
def fetch_xml_data(data):
    """
        this pulls the data from twisted once it has fetched the XML data
    """

    xml_root = et.fromstring(data)

    try:
        #Attempt to parse the xml data into English instead of short tags.
        wp = WeatherParser.weather_parser(xml_root)
        #For some reasons that I have yet to learn. Twisted likes to get stuck in a loop if there's an error in the code
        # unless exceptions are caught outside. Hence the current broad catch.
    except:
        traceback.print_exc()

    #done! Close down twisted event loop
    shutdownwebapp()