Skip to content

Commit

Permalink
Make more modules strict
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Nov 4, 2023
1 parent d41c4a8 commit 26931f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ module = [
'app.gameMan',
'app.music_conf',
'app.selector_win',
'app.tooltip',
'app.richTextBox',
'app.CheckDetails',
'app.backup',
Expand All @@ -152,14 +151,12 @@ module = [
'precomp.conditions._scaffold_compat',
'precomp.conditions.addInstance',
'precomp.conditions.antlines',
'precomp.conditions.catwalks',
'precomp.conditions.fizzler',
'precomp.conditions.glass',
'precomp.conditions.globals',
'precomp.conditions.instances',
'precomp.conditions.monitor',
'precomp.conditions.removed',
'precomp.conditions.signage',
'precomp.conditions.trackPlat',
'precomp.antlines',
'precomp.barriers',
Expand Down
6 changes: 3 additions & 3 deletions src/app/tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def _show(widget: tk.Misc, mouse_x: int, mouse_y: int) -> None:

def set_tooltip(
widget: tk.Misc,
text: TransToken=TransToken.BLANK,
image: img.Handle=None,
text: TransToken = TransToken.BLANK,
*,
image: img.Handle | None = None,
delay: int=-1,
) -> None:
"""Change the tooltip for a widget.
Expand All @@ -159,7 +159,7 @@ def add_tooltip(
targ_widget: tk.Misc,
text: TransToken = TransToken.BLANK,
*,
image: img.Handle=None,
image: img.Handle | None = None,
delay: int=500,
show_when_disabled: bool=False,
) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/precomp/conditions/catwalks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Instances(Enum):
SINGLE_WALL = 'single_wall'
MARKER = 'markerInst'

CATWALK_TYPES: Mapping[utils.CONN_TYPES, Instances] = {
CATWALK_TYPES: Mapping[utils.CONN_TYPES, Optional[Instances]] = {
utils.CONN_TYPES.straight: Instances.STRAIGHT_1,
utils.CONN_TYPES.corner: Instances.CORNER,
utils.CONN_TYPES.all: Instances.XJUNCT,
Expand Down Expand Up @@ -120,7 +120,7 @@ def check_support_locs(
def place_catwalk_connections(
catwalks: Dict[Tuple[float, float, float], Link],
vmf: VMF,
instances: Mapping[Instances, str],
instances: Mapping[Optional[Instances], str],
point_a: Vec, point_b: Vec,
) -> None:
"""Place catwalk sections to connect two straight points."""
Expand Down
8 changes: 4 additions & 4 deletions src/precomp/conditions/signage.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ def res_signage(vmf: VMF, inst: Entity, res: Keyvalues) -> None:
force_type=template_brush.TEMP_TYPES.detail,
additional_visgroups=visgroup,
)

for face in template.detail.sides():
if face.normal() == normal:
brush_faces.append(face)
if template.detail is not None:
for face in template.detail.sides():
if face.normal() == normal:
brush_faces.append(face)
else:
# Direct on the surface.
# Find the grid pos first.
Expand Down

0 comments on commit 26931f2

Please sign in to comment.