def __init__(self, config_path, config_dict, tmpdir=None, bin_root=None, dry_run=False, logger=None): """ Initializer for ExtensionEngine. Args: config_path (str): Path to the configuration file. For example, something like /home/weewx/weewx.conf) config_dict (str): The configuration dictionary, i.e., the contents of the file at config_path. tmpdir (str): A temporary directory to be used for extracting tarballs and the like [Optional] bin_root (str): Path to the location of the weewx binary files. For example, something like /home/weewx/bin. Optional. If not specified, it will be guessed based on the location of this file. dry_run (bool): If Truthy, all the steps will be printed out, but nothing will actually be done. logger (weecfg.Logger): An instance of weecfg.Logger. This will be used to print things to the console. """ self.config_path = config_path self.config_dict = config_dict self.logger = logger or Logger() self.tmpdir = tmpdir or '/var/tmp' self.dry_run = dry_run self.root_dict = weecfg.extract_roots(self.config_path, self.config_dict, bin_root) self.logger.log("root dictionary: %s" % self.root_dict, 4)
def __init__(self, config_path, config_dict, tmpdir=None, bin_root=None, dry_run=False, logger=None): """Initializer for ExtensionEngine. config_path: Path to the configuration file. For example, something like /home/weewx/weewx.conf) config_dict: The configuration dictionary, i.e., the contents of the file at config_path. tmpdir: A temporary directory to be used for extracting tarballs and the like [Optional] bin_root: Path to the location of the weewx binary files. For example, something like /home/weewx/bin. Optional. If not specified, it will be guessed based on the location of this file. dry_run: If True, all the steps will be printed out, but nothing will actually be done. logger: An instance of weecfg.Logger. This will be used to print things to the console. """ self.config_path = config_path self.config_dict = config_dict self.logger = logger or Logger() self.tmpdir = tmpdir or '/var/tmp' self.dry_run = dry_run self.root_dict = weecfg.extract_roots(self.config_path, self.config_dict, bin_root) self.logger.log("root dictionary: %s" % self.root_dict, 4)
def __init__(self, config_path, config_dict, tmpdir=None, bin_root=None, dry_run=False, logger=None): """Initializer for ExtensionEngine. config_path: Path to the configuration file. (Something like /home/weewx/weewx.conf) config_dict: The configuration dictionary (the contents of the file at config_path). tmpdir: A temporary directory to be used for extracting tarballs and the like [Optional] bin_root: A path to the root of the weewx binary files (Something like /home/weewx/bin). Optional. If not given, it will be determined from the location of this file. dry_run: If True, all the steps will be printed out, but nothing will actually be done. logger: An instance of weecfg.Logger. This will be used to print things to the console. """ self.config_path = config_path self.config_dict = config_dict self.logger = logger or Logger() self.tmpdir = tmpdir or '/var/tmp' # BIN_ROOT does not normally appear in the configuration dictionary. Set a # default (which could be 'None') self.config_dict.setdefault('BIN_ROOT', bin_root) self.dry_run = dry_run self.root_dict = weecfg.extract_roots(self.config_path, self.config_dict) self.logger.log("root dictionary: %s" % self.root_dict, 4)