Commit ab00eab8 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

QuickViz. Use LogConfig as parent class.

parent 3292a4c6
Pipeline #57243 passed with stages
in 1 minute and 32 seconds
......@@ -7,10 +7,10 @@ import wimcollect.logger as logger
import wimcollect.utils as utils
class FtpCollector(utils.Collector):
class FtpCollector(utils.LogConfig):
def __init__(self, object_id: str, config_parser: configobj.ConfigObj = None, log: logger = None):
utils.Collector.__init__(self, object_id, config_parser, log)
utils.LogConfig.__init__(self, object_id, config_parser, log)
self.base_dir = self.config[self.object_id]["root_dir"]
def _ftp_connect_(self) -> ftplib.FTP:
......
......@@ -21,8 +21,8 @@ class Collector(ftp.FtpCollector):
Parameters
----------
site_id: str
Site's trigram
day: datetime.date
Date of the data which should be downloaded.
"""
self.logger.write(self.object_id, "Download Maido's FTIR meteo data.")
......
......@@ -7,10 +7,10 @@ import wimcollect.utils as utils
import wimcollect.logger as logger
class Collector(utils.Collector):
class Collector(utils.LogConfig):
def __init__(self, config_parser: configobj.ConfigObj = None, log: logger = None):
utils.Collector.__init__(self, "HTTPDDU", config_parser, log)
utils.LogConfig.__init__(self, "HTTPDDU", config_parser, log)
self.base_url = self.config[self.object_id]["base_url"]
def download_picarro(self, day: datetime.date):
......
......@@ -9,15 +9,10 @@ import wimcollect.logger as logger
import wimcollect.utils as utils
class Visualizator:
class Visualizator(utils.LogConfig):
def __init__(self, config_parser: configobj.ConfigObj, log: logger):
# Logger
self.logger = log
self.object_id = "VIZU"
# Config
self.config = config_parser
utils.LogConfig.__init__(self, "VIZU", config_parser, log)
self.base_dir = self.config[self.object_id]["root_dir"]
def create_data_source_file(self, site_id: str, picarro_id: str, day: datetime.date):
......
......@@ -8,10 +8,10 @@ import wimcollect.utils as utils
import wimcollect.logger as logger
class Collector(utils.Collector):
class Collector(utils.LogConfig):
def __init__(self, config_parser: configobj.ConfigObj = None, log: logger = None):
utils.Collector.__init__(self, "SSHDMC", config_parser, log)
utils.LogConfig.__init__(self, "SSHDMC", config_parser, log)
self.base_dir = self.config[self.object_id]["root_dir"]
def download_picarro(self, day: datetime.date):
......
......@@ -8,7 +8,7 @@ import tempfile
import wimcollect.logger as logger
class Collector:
class LogConfig:
def __init__(self, object_id: str, config_parser: configobj.ConfigObj = None, log: logger = None):
# Config
if config_parser is None:
......
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