5050LOCATIONS = ['hhs%d' % i for i in range (1 ,11 )]
5151DATAPATH = '/home/automation/quidel_data'
5252
53- def update (locations , first = None , last = None , force_update = False ):
53+ def update (locations , first = None , last = None , force_update = False , load_email = True ):
5454 # download and prepare data first
55- qd = quidel .QuidelData (DATAPATH )
55+ qd = quidel .QuidelData (DATAPATH , load_email )
5656 if not qd .need_update and not force_update :
5757 print ('Data not updated, nothing needs change.' )
5858 return
@@ -126,10 +126,12 @@ def main():
126126 parser .add_argument ('--first' , '-f' , default = None , type = int , help = 'first epiweek override' )
127127 parser .add_argument ('--last' , '-l' , default = None , type = int , help = 'last epiweek override' )
128128 parser .add_argument ('--force_update' , '-u' , action = 'store_true' , help = 'force update db values' )
129+ parser .add_argument ('--skip_email' , '-s' , action = 'store_true' , help = 'skip email downloading step' )
129130 args = parser .parse_args ()
130131
131132 # sanity check
132- first , last , force_update = args .first , args .last , args .force_update
133+ first , last , force_update , skip_email = args .first , args .last , args .force_update , args .skip_email
134+ load_email = not skip_email
133135 if first is not None :
134136 flu .check_epiweek (first )
135137 if last is not None :
@@ -144,7 +146,7 @@ def main():
144146 locations = args .location .lower ().split (',' )
145147
146148 # run the update
147- update (locations , first , last , force_update )
149+ update (locations , first , last , force_update , load_email )
148150
149151
150152if __name__ == '__main__' :
0 commit comments