File: util.py

package info (click to toggle)
kalamine 0.38-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 840 kB
  • sloc: python: 2,557; javascript: 1,012; cpp: 506; makefile: 37; sh: 7
file content (17 lines) | stat: -rw-r--r-- 403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Some util functions for tests."""

from pathlib import Path
from typing import Dict

try:
    import tomllib
except ImportError:
    import tomli as tomllib


def get_layout_dict(filename: str) -> Dict:
    """Return the layout directory path."""

    file_path = Path(__file__).parent.parent / f"layouts/{filename}.toml"
    with file_path.open(mode="rb") as file:
        return tomllib.load(file)