Skip to content

Commit

Permalink
modules: fix SyntaxWarning for python 3.12+ thx to @sdelafond
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrabug committed Dec 3, 2024
1 parent 2422a43 commit c14f967
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion py3status/modules/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Py3status:
format = "{format_adapter}"
format_adapter = "{format_device}"
format_adapter_separator = " "
format_device = "\?if=connected&color=connected {alias}"
format_device = r"\?if=connected&color=connected {alias}"
format_device_separator = " "
thresholds = [(False, "bad"), (True, "good")]

Expand Down
2 changes: 1 addition & 1 deletion py3status/modules/sway_idle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
Display sway inhibit idle status.
This Module shows an indicator, if an idle is inhibited by an inhibitor.
Expand Down
6 changes: 3 additions & 3 deletions py3status/modules/weather_owm.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,8 @@ def weather_owm(self):

def colorize(names, color="lightgreen", separator=None):
if separator is None:
separator = "[\?color={c}&show / ]".format(c=color)
body = "[\?color={c}&show {n}] [\?color={n} {{{n}}}]"
separator = r"[\?color={c}&show / ]".format(c=color)
body = r"[\?color={c}&show {n}] [\?color={n} {{{n}}}]"
return separator.join([body.format(c=color, n=name) for name in names])

# fmt: off
Expand All @@ -911,7 +911,7 @@ def colorize(names, color="lightgreen", separator=None):
# Miscellaneous
"api_key": getenv("OWM_API_KEY"),
"icons": {"200": "☔", "230_232": "🌧"},
"format_forecast_separator": "\?color=tomato separator ",
"format_forecast_separator": r"\?color=tomato separator ",
"forecast_days": 1,
# Format
"format": colorize(format_placeholders, "lightblue"),
Expand Down
4 changes: 2 additions & 2 deletions py3status/modules/zypper_updates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
Display number of pending updates for OpenSUSE Linux.
Configuration parameters:
Expand Down Expand Up @@ -31,7 +31,7 @@ class Py3status:

# available configuration parameters
cache_timeout = 600
format = "zypper: [\?color=update {update}]"
format = r"zypper: [\?color=update {update}]"
thresholds = [(0, "good"), (50, "degraded"), (100, "bad")]

def post_config_hook(self):
Expand Down

0 comments on commit c14f967

Please sign in to comment.