Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.1.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
rev: v1.5.6
hooks:
- id: remove-tabs
types: [file]
Expand Down
6 changes: 2 additions & 4 deletions apps/finder/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def file_manager_current_path():
return title

def file_manager_terminal_here():
applescript.run(
r"""
applescript.run(r"""
tell application "Finder"
set myWin to window 1
set thePath to (quoted form of POSIX path of (target of myWin as alias))
Expand All @@ -42,8 +41,7 @@ def file_manager_terminal_here():
do script "cd " & thePath
end tell
end tell
end tell"""
)
end tell""")

def file_manager_show_properties():
"""Shows the properties for the file"""
Expand Down
6 changes: 2 additions & 4 deletions apps/safari/safari.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ def address() -> str:
)
address = address_field.AXValue
except (ui.UIErr, AttributeError):
address = applescript.run(
f"""
address = applescript.run(f"""
tell application id "{actions.app.bundle()}"
with timeout of 0.1 seconds
if not (exists (window 1)) then return ""
return window 1's current tab's URL
end timeout
end tell
"""
)
""")
return address

def bookmark_tabs():
Expand Down
8 changes: 4 additions & 4 deletions apps/wsl/wsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _parse_win_title():
_update_wsl_distros()
distro = None
try:
(distro, path) = re.match(wsl_title_regex, path).groups()
distro, path = re.match(wsl_title_regex, path).groups()
if distro not in wsl_distros:
raise Exception(f"Unknown wsl distro: {distro}")
# log_exception(f'[_update_wsl_distros()] {sys.exc_info()[1]}')
Expand Down Expand Up @@ -259,7 +259,7 @@ def run_wslpath(args, in_path, in_distro=None):

while loop_num < MAX_ATTEMPTS:
# print(f"_run_wslpath(): {path_detection_disabled=}.")
(distro, path, error) = run_wsl(["wslpath", *args, in_path], in_distro)
distro, path, error = run_wsl(["wslpath", *args, in_path], in_distro)
if error:
if in_path == distro and error.endswith("No such file or directory"):
# for testing
Expand Down Expand Up @@ -423,7 +423,7 @@ def file_manager_current_path():
)
return ""

(distro, path) = _parse_win_title()
distro, path = _parse_win_title()

if "~" in path:
# the only way I could find to correctly support the user folder:
Expand Down Expand Up @@ -521,7 +521,7 @@ def wsl_speak():
results = []
_update_wsl_distros()
for in_distro in wsl_distros:
(distro, result, error) = run_wsl(
distro, result, error = run_wsl(
["echo", 'Hello, my name is "${WSL_DISTRO_NAME}".'], in_distro
)
if error:
Expand Down
2 changes: 1 addition & 1 deletion core/numbers/ordinals.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if n in ordinal_words:
word = ordinal_words[n]
else:
(tens, units) = divmod(n, 10)
tens, units = divmod(n, 10)
assert 1 < tens < 10, "we have already handled all ordinals < 20"
assert 0 < units, "we have already handled all ordinals divisible by ten"
word = f"{tens_words[tens]} {ordinal_words[units]}"
Expand Down
2 changes: 1 addition & 1 deletion plugin/gamepad/gamepad_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def render_buttons(
c.paint.style = c.paint.Style.STROKE
c.draw_circle(x, y, CIRCLE_RADIUS)
for i, button_id in enumerate(buttons_ids):
(offset_x, offset_y) = BUTTON_OFFSETS[i]
offset_x, offset_y = BUTTON_OFFSETS[i]
button_x = x + offset_x * BUTTON_OFFSET
button_y = y + offset_y * BUTTON_OFFSET
is_pressed = buttons[button_id]
Expand Down
2 changes: 1 addition & 1 deletion plugin/mode_indicator/mode_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_alpha_color() -> str:
def get_gradient_color(color: str) -> str:
factor = settings.get("user.mode_indicator_color_gradient")
# hex -> rgb
(r, g, b) = tuple(int(color[i : i + 2], 16) for i in (0, 2, 4))
r, g, b = tuple(int(color[i : i + 2], 16) for i in (0, 2, 4))
# Darken rgb
r, g, b = int(r * factor), int(g * factor), int(b * factor)
# rgb -> hex
Expand Down