def gWeather(self): weather = weatherspider() s = '' for w in weather: s += w[0] s += '\b\n' s += w[1] s += '\b\n' return (s)
def gWeather(self): if mc: if mc.get('weather'): return mc.get('weather') import re weather = weatherspider() s = '' date = re.compile('(?P<date>\d+:\d\d)') for w in weather: s += w[0] s += '\b\n' s += w[1] s += '\b\n' s = date.sub(lambda m: m.groups()[0] + '\n\n', s) s = s.replace(' ','') if not mc: return (s) mc.set('weather',s,time=3600) return (mc.get('weather'))