Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Nov 19, 2024
1 parent 0ae868d commit 0f8d618
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/hammeraddons/compare_datadesc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def msg(*args: object) -> None:
print(*args, file=msgfile)
bad_ents.add(classname)

with open(Path(repo_root, 'db', 'datamaps', filename + 'datamap.txt')) as f, open(Path(repo_root, 'db', 'reports', filename + '.txt'), 'w') as msgfile:
filename_datamap = Path(repo_root, 'db', 'datamaps', filename + 'datamap.txt')
filename_report = Path(repo_root, 'db', 'reports', filename + '.txt')
with open(filename_datamap, encoding='ascii') as f, open(filename_report, 'w', encoding='utf8') as msgfile:
cur_ent: Optional[EntityDef] # Deliberately uninitialised.
for line in f:
if line.startswith('//') or not line.strip():
Expand Down
2 changes: 1 addition & 1 deletion src/hammeraddons/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Logic for loading all the code in arbitary locations for plugin purposes."""
from typing import (
Callable, Dict, Iterable, Iterator, Optional, Sequence, Set, Tuple, Union, Final, Self, final,
Callable, Dict, Iterable, Iterator, Optional, Sequence, Set, Tuple, Union, Final, Self,
)
from collections import deque
from importlib.abc import MetaPathFinder
Expand Down
2 changes: 1 addition & 1 deletion src/hammeraddons/props_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(
class Options:
"""Allows parsing a set of Keyvalues option blocks."""
defaults: List[Opt]
settings: Dict[str, Union[None, str, int, float, bool, Vec, Keyvalues]]
settings: Dict[str, Union[str, int, float, bool, Vec, Keyvalues, None]]
path: Optional[Path]

def __init__(self, defaults: Union[Iterable[Opt], dict]) -> None:
Expand Down
3 changes: 2 additions & 1 deletion src/hammeraddons/unify_fgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ def action_export(
todo = ent.bases.copy()
done = set(todo)
ent.bases.clear()
for base in todo:
while todo:
base = todo.pop()
assert isinstance(base, EntityDef), base
if base.type is not EntityTypes.BASE or base in used_bases:
ent.bases.append(base)
Expand Down

0 comments on commit 0f8d618

Please sign in to comment.