diff --git a/auto_cache.py b/auto_cache.py index 4c6e228..ebeab5b 100644 --- a/auto_cache.py +++ b/auto_cache.py @@ -25,13 +25,18 @@ def queryallrecordsbydateproperty(date: str): print(f'queryallrecordsbydateproperty: {date}') try: - response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydateproperty/?querydate={date}&querytype=node&property=head') - html = response.read().decode('utf-8') - #print(html) - response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydateproperty/?querydate={date}&querytype=link&property=flow') - html = response.read().decode('utf-8') - #print(html) + node_properties = ['head', 'pressure', 'actualdemand', 'quality'] + for property in node_properties: + response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydateproperty/?querydate={date}&querytype=node&property={property}') + html = response.read().decode('utf-8') + #print(html) + + link_properties = ['flow', 'velocity', 'headloss', 'quality'] + for property in link_properties: + response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydateproperty/?querydate={date}&querytype=link&property={property}') + html = response.read().decode('utf-8') + #print(html) except urllib.error.URLError as e: print("Error")