def get_directory_locations(self): home_path = str(Path.home()) self.directory = Path( os.path.join(home_path, str(GeoUtil.get_directory_name()))) self.ini_handler = IniHandler.IniHandler(base_path=home_path, ini_name='geofinder.ini') self.directory = self.ini_handler.get_directory_from_ini( "GeoFinder", GeoUtil.get_directory_name()) self.cache_dir = GeoUtil.get_cache_directory(self.directory) self.logger.info(f'Cache directory {self.cache_dir}')
def __init__(self): self.logger = logging.getLogger(__name__) fmt = "%(levelname)s %(asctime)s %(name)s.%(funcName)s %(lineno)d: %(message)s" logging.basicConfig(level=logging.DEBUG, format=fmt) self.logger.info('Configuration') self.directory: str = os.path.join(str(Path.home()), GeoUtil.get_directory_name()) self.cache_dir = GeoUtil.get_cache_directory(self.directory) # Get configuration settings stored in config pickle file self.cfg: CachedDictionary.CachedDictionary = CachedDictionary.CachedDictionary( self.cache_dir, "config.pkl") if not os.path.exists(self.directory): self.logger.info(f'Creating main folder {self.directory}') os.makedirs(self.directory) if not os.path.exists(self.cache_dir): self.logger.info(f'Creating cache folder {self.cache_dir}') os.makedirs(self.cache_dir) self.cfg.read() # Verify config - test to see if gedcom file accessible self.get_config() # Create App window self.root = Tk() self.root["padx"] = 30 self.root["pady"] = 30 self.root.title('GeoUtil') UtilLayout.UtilLayout(root=self.root, directory=self.directory, cache_dir=self.cache_dir)