Esempio n. 1
0
    def __init__(self, config_name, config_loc='default', in_change_loc=False):
        super().__init__(config_name, config_loc)
        self.change_loc = in_change_loc

        if self.change_loc is True:
            self.target_dir = gif.path_part_remove(self.config_location)
            with gif.work_in(self.target_dir):
                self.sections_as_attributes()
        else:
            self.sections_as_attributes()
Esempio n. 2
0
 def __init__(self, in_config_loc='default', in_change_loc=False):
     super().__init__(config_name='solid_config.ini',
                      config_loc=in_config_loc)
     self.change_loc = in_change_loc
     if self.change_loc is True:
         self.target_dir = gif.path_part_remove(self.config_location)
         print(self.target_dir)
         with gif.work_in(self.target_dir):
             print(os.getcwd())
             self.sections_as_attributes()
     else:
         self.sections_as_attributes()
def find_path(path_fragment):
    """
    finds absolute path, to folder or file.


    Args:
        path_fragment (str): the fragment to find

    Returns:
        str: absolute path to the fragment
    """
    _main_dir = os.getenv('MAIN_DIR')
    with work_in(_main_dir):
        return pathmaker(os.path.abspath(list(iglob(f"**/{path_fragment}", recursive=bool))[0]))
Esempio n. 4
0
 def __init__(self,
              in_config_loc='default',
              in_pragma=None,
              in_change_loc=False):
     GidConfigMaster.__init__(self,
                              config_name='db_config.ini',
                              config_loc=in_config_loc)
     self.change_loc = in_change_loc
     if self.change_loc is True:
         self.target_dir = gif.path_part_remove(self.config_location)
         with gif.work_in(self.target_dir):
             self.sections_as_attributes()
     else:
         self.sections_as_attributes()
     log.debug(f"cwd is [{self.default_keys['main_dir']}]")
     log.debug(f"database location is [{self.db_parameter['db_loc']}]")
     log.debug(f"database name  is [{self.db_parameter['db_name']}]")
     GiDataBaseMaster.__init__(self,
                               self.default_keys['main_dir'],
                               self.db_parameter['db_name'],
                               self.db_parameter['db_loc'],
                               gif.pathmaker(
                                   self.db_parameter['sql_script_folder']),
                               in_pragma=in_pragma)