|
|
@ -292,6 +292,7 @@ def make_wttr_in_png(png_name, options=None):
|
|
|
|
if key not in parsed:
|
|
|
|
if key not in parsed:
|
|
|
|
parsed[key] = val
|
|
|
|
parsed[key] = val
|
|
|
|
url = make_wttrin_query(parsed)
|
|
|
|
url = make_wttrin_query(parsed)
|
|
|
|
|
|
|
|
print "URL = ", url
|
|
|
|
|
|
|
|
|
|
|
|
timestamp = time.strftime("%Y%m%d%H", time.localtime())
|
|
|
|
timestamp = time.strftime("%Y%m%d%H", time.localtime())
|
|
|
|
cached_basename = url[14:].replace('/','_')
|
|
|
|
cached_basename = url[14:].replace('/','_')
|
|
|
@ -302,9 +303,11 @@ def make_wttr_in_png(png_name, options=None):
|
|
|
|
if not os.path.exists(dirname):
|
|
|
|
if not os.path.exists(dirname):
|
|
|
|
os.makedirs(dirname)
|
|
|
|
os.makedirs(dirname)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "Cached file: %s" % cached_png_file
|
|
|
|
if os.path.exists(cached_png_file):
|
|
|
|
if os.path.exists(cached_png_file):
|
|
|
|
return cached_png_file
|
|
|
|
return cached_png_file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "Requesting URL: %s" % url
|
|
|
|
text = requests.get(url).text.replace('\n', '\r\n')
|
|
|
|
text = requests.get(url).text.replace('\n', '\r\n')
|
|
|
|
curl_output = text.encode('utf-8')
|
|
|
|
curl_output = text.encode('utf-8')
|
|
|
|
|
|
|
|
|
|
|
|