Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import pathlib
- class Paths:
- _data = dict()
- def __init__(self):
- self.root = pathlib.Path(os.path.realpath(__file__)).parent.parent
- self.home = os.path.dirname(
- os.path.dirname(os.path.realpath(__file__)))
- for file in self.root.rglob('*'):
- if file.is_dir() and file.name != "__pycache__":
- setattr(self, file.name, str(file))
- self._data[file.name] = str(file)
- self.add_hidden()
- def add_hidden(self):
- data_dir = str(self.root.parent / ".data")
- config_files_dir = str(self.root.parent / ".data/.config_files")
- self.data = data_dir
- self._data['data'] = data_dir
- self.config_files = config_files_dir
- self._data['config_files'] = config_files_dir
- def __getitem__(self, item):
- return self._data[item]
- PATHS = Paths()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement