X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/e83dc3feca9943d316083ca80ea0920056d0e759..7aaa06f870e4fb4954ec65091cc12f9f0bf58b04:/filter_meteo.py?ds=sidebyside diff --git a/filter_meteo.py b/filter_meteo.py index d4f0e7d..fc497db 100755 --- a/filter_meteo.py +++ b/filter_meteo.py @@ -35,6 +35,10 @@ def Yesterday(): dt = Today() return dt - datetime.timedelta(days=1) +def Prehistoric(): + dt = datetime.date(2000,01,01) + return dt + def GetData(sid,pid,fromDate=Yesterday(),toDate=Today()): if database: c = database.cursor() @@ -55,7 +59,9 @@ def FixRecord(id,value): def ProcessTable(sid,pid): - if not current: + if process_all: + data=GetData(sid,pid,Prehistoric(),Today()) + elif not current: data=GetData(sid,pid) else: data=GetData(sid,pid,Today(),Tomorrow()) @@ -90,6 +96,10 @@ if len(sys.argv)==2 and sys.argv[1]=='current': else: current=False +if len(sys.argv)==2 and sys.argv[1]=='all': + process_all=True +else: + process_all=False try: