o
    UkhJ                     @   s   d dl mZmZmZ d dlmZ d dlmZ d dlZd dlZd dl	Z	ee
Ze
dkr0ejdd edd	d
 Zeddd Zeddd ZdS )    )Flaskrender_template	send_file)generate_map)datetimeN__main__T)debugz/download-allc                  C   s   t  } t| d&}tdD ]}|dr(|dr(|jtj	
d||d qW d    n1 s3w   Y  | d t d}d| d	}t| d
d|dS )Nwstaticz.pngout)arcnamer   z%Y-%m-%d_%H-%MZweather_maps_z.zipzapplication/zipT)mimetypeas_attachmentdownload_name)ioBytesIOzipfileZipFileoslistdirendswith
startswithwritepathjoinseekr   nowstrftimer   )bufferzfilename	timestampzip_name r#   -\\STUART-PC\L-Server\var\www\html\wgfx\app.pydownload_all_images   s"   
r%   /c                  C   s$  ddt ddddddddt dd	dd
ddddt ddddddddt ddddddddt ddddddddt ddddddddt dddddddddt dddddddd dt dd!ddd"ddd#dt dd$ddd%ddd&dt dd'ddd(ddd)dt dd*ddd+ddg} td,| d-S ).NZqStatetodayzIDQ11295.xmlzstatic/baseQ_stateToday.pngzstatic/outQ_stateToday.png)output_path)iddayimageZ	qFarNorthzstatic/baseQ_farNorthToday.pngzstatic/outQ_farNorthToday.pngZqNorthzstatic/baseQ_northToday.pngzstatic/outQ_northToday.pngZqCentralzstatic/baseQ_centralToday.pngzstatic/outQ_centralToday.pngZqWideBayzstatic/baseQ_wideBayToday.pngzstatic/outQ_wideBayToday.pngZ	qSunshinezstatic/baseQ_sunshineToday.pngzstatic/outQ_sunshineToday.pngZqStateTTZtomorrowzstatic/baseQ_stateTomorrow.png1zstatic/outQ_stateTomorrow.png)Zforecast_indexr(   ZqFarNorthTTz!static/baseQ_farNorthTomorrow.pngz static/outQ_farNorthTomorrow.pngZqNorthTTzstatic/baseQ_northTomorrow.pngzstatic/outQ_northTomorrow.pngZ
qCentralTTz static/baseQ_centralTomorrow.pngzstatic/outQ_centralTomorrow.pngZ
qWideBayTTz static/baseQ_wideBayTomorrow.pngzstatic/outQ_wideBayTomorrow.pngZqSunshineTTz!static/baseQ_sunshineTomorrow.pngz static/outQ_sunshineTomorrow.pngz
index.htmlmaps)r   r   r-   r#   r#   r$   index!   s   5r/   z/mapc                   C   s   t dddS )Nzstatic/outImg.pngz	image/png)r   )r   r#   r#   r#   r$   mapZ   s   r0   )flaskr   r   r   genr   r   r   r   r   __name__apprunrouter%   r/   r0   r#   r#   r#   r$   <module>   s    

8