Skip to content

Commit

Permalink
run ruff check . --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Mar 13, 2024
1 parent ddad7fd commit 17a460d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def compare(self, other: LIP, log_func=print) -> bool:

return ret

# mapping in LipSyncEditor is not very accurate. for example, shape 0 is neutral, not EE,
# mapping in LipSyncEditor is not very accurate. for example, shape 0 is neutral, not EE,
# meaning pauses are not properly represented when using LipSyncEditor. shape 15 is too open to be KG and etc.
# https://imgur.com/a/LIRZ8B1
class LIPShape(IntEnum):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import os

from typing import TYPE_CHECKING
Expand Down
2 changes: 1 addition & 1 deletion Libraries/PyKotor/src/pykotor/tools/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def create_registry_path(hive, path): # sourcery skip: raise-from-previous-erro
try:
winreg.CreateKey(hive, current_path)
except PermissionError:
raise PermissionError(f"Permission denied. Administrator privileges required.") from e # noqa: B904, TRY003, EM101
raise PermissionError("Permission denied. Administrator privileges required.") from e # noqa: B904, TRY003, EM101
except Exception as e: # pylint: disable=W0718 # noqa: BLE001
# sourcery skip: raise-specific-error
raise Exception(f"Failed to create registry key: {current_path}. Error: {e}") # noqa: TRY002, TRY003, EM102, B904
Expand Down
2 changes: 1 addition & 1 deletion Libraries/PyKotorGL/src/pykotor/gl/models/mdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def draw(self, shader: Shader, transform: mat4, override_texture: str | None = N
if self.mesh and self.render:
self.mesh.draw(shader, transform, override_texture)

for child in self.children:
for child in self.children:
child.draw(shader, transform, override_texture=override_texture)


Expand Down
18 changes: 9 additions & 9 deletions Libraries/Utility/src/utility/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
from typing_extensions import LiteralString, Self, SupportsIndex

def insert_newlines(text: str, length: int = 100) -> str:
words = text.split(' ')
new_string = ''
current_line = ''
words = text.split(" ")
new_string = ""
current_line = ""

for word in words:
if len(current_line) + len(word) + 1 <= length:
current_line += word + ' '
current_line += word + " "
else:
new_string += current_line.rstrip() + '\n'
current_line = word + ' '
new_string += current_line.rstrip() + "\n"
current_line = word + " "

# Add the last line if there's any content left.
if current_line:
new_string += current_line.rstrip()

return new_string

def ireplace(original: str, target: str, replacement: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion Tools/HoloPatcher/src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def parse_args() -> Namespace:
return kwargs


class App():
class App:
def __init__(self):
self.root = tk.Tk()
self.root.title(f"HoloPatcher {VERSION_LABEL}")
Expand Down
2 changes: 1 addition & 1 deletion Tools/HolocronToolset/src/toolset/gui/windows/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def refreshOverrideList(self, *, reload=True):
"""Refreshes the list of override directories in the overrideFolderCombo combobox."""
if self.active is None:
print("no installation is currently loaded, cannot refresh override list")
return None
return
if reload:
self.active.load_override()

Expand Down

0 comments on commit 17a460d

Please sign in to comment.