Skip to content

Commit

Permalink
Update parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero committed Mar 28, 2024
1 parent 6113bbd commit 0dc97ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions foamlib/_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def _cmd(self, args: Sequence[str], *, key: Optional[str] = None) -> str:
) from None

def __getitem__(self, key: str) -> Union["FoamFile.Value", "_FoamDictionary"]:
contents = self._file.path.read_text()
value = _DICTIONARY.parse_string(contents, parse_all=True).as_dict()
value = _DICTIONARY.parse_file(self._file.path, parse_all=True).as_dict()

for key in [*self._keywords, key]:
value = value[key]
Expand Down

0 comments on commit 0dc97ff

Please sign in to comment.