Commit 951a1524 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

HTTPDDU. Rename class and function name to match default pattern.

parent fdc94e09
Pipeline #57843 passed with stages
in 2 minutes and 45 seconds
......@@ -7,13 +7,13 @@ import wimcollect.common.utils as utils
import wimcollect.common.logger as logger
class Collector(utils.LogConfig):
class PicarroCollector(utils.LogConfig):
def __init__(self, config_parser: configobj.ConfigObj = None, log: logger = None):
utils.LogConfig.__init__(self, "HTTPDDU", config_parser, log)
self.base_url = self.config[self.object_id]["base_url"]
def download_picarro(self, picarro_id: str, day: datetime.date) -> bool:
def download(self, picarro_id: str, day: datetime.date) -> bool:
"""Download Picarro data file from IPEV's HTTP server.
Parameters
......
......@@ -34,11 +34,11 @@ def main():
ftpaeris_col = ftpaeris.MaidoMf1hCollector()
ftpaeris_col.download("201913")
httpddu_col = httpddu.Collector()
httpddu_col.download_picarro(yesterday)
httpddu_col = httpddu.PicarroCollector()
httpddu_col.download(yesterday)
sftpdmc_col = sftpdmc.Collector()
sftpdmc_col.download_picarro(yesterday)
sftpdmc_col.download(yesterday)
vizual = quickviz.Visualizator()
vizual.create_data_source_file("DDU", "HIDS2189", yesterday)
......@@ -111,15 +111,15 @@ def quickviz_antarctica():
help="Day (in ISO format YYYY-MM-DD) which should be processed.")
args = parser.parse_args()
httpddu_col = httpddu.Collector(config_parser, log)
httpddu_col = httpddu.PicarroCollector(config_parser, log)
try:
httpddu_col.download_picarro(args.day)
httpddu_col.download(args.day)
except:
pass
sftpdmc_col = sftpdmc.Collector(config_parser, log)
try:
sftpdmc_col.download_picarro(args.day)
sftpdmc_col.download(args.day)
except:
pass
......
......@@ -7,5 +7,5 @@ import wimcollect.httpddu as httpddu
class TestCollector(TestCase):
def test_download_picarro(self):
collector = httpddu.Collector()
self.assertTrue(collector.download_picarro("HIDS2189", datetime.date(2020, 1, 20)))
collector = httpddu.PicarroCollector()
self.assertTrue(collector.download("HIDS2189", datetime.date(2020, 1, 20)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment