(file: Union[str, Path, TextIOWrapper])
| 99 | |
| 100 | @staticmethod |
| 101 | def parse_file(file: Union[str, Path, TextIOWrapper]) -> Database: |
| 102 | if isinstance(file, TextIOWrapper): |
| 103 | source = file.read() |
| 104 | else: |
| 105 | with open(file, encoding="utf8") as f: |
| 106 | source = f.read() |
| 107 | source = remove_bom(source) |
| 108 | parser = PyDBMLParser(source) |
| 109 | return parser.parse() |
| 110 | |
| 111 | |
| 112 | class PyDBMLParser: |