Esempio n. 1
0
 def from_file(path: Path) -> "RedVoxConfig":
     """
     Attempts to load the configuration from a TOML file.
     :return: An instance of RedvoxConfig or raises a RedvoxError.
     """
     with open(path, "r") as toml_in:
         content: str = toml_in.read()
         try:
             return from_toml(RedVoxConfig, content)
         except Exception as e:
             raise errors.RedVoxError(
                 f"Error parsing RedVox configuration file: {e}")
Esempio n. 2
0
def main():
    with open('Pipfile') as f:
        toml = f.read()
    pip = from_toml(Pipfile, toml)
    print(pip)
Esempio n. 3
0
File: file.py Progetto: taskie/ganji
def _load_config(dir: str) -> Config:
    with open(_config_path(dir)) as config_file:
        return from_toml(Config, config_file.read())