Skip to content

Commit

Permalink
logging.warn was dropped in favour of logging.warning in Python 3.13
Browse files Browse the repository at this point in the history
We already using logging.warning in many places.
  • Loading branch information
chewi authored and C0rn3j committed Aug 21, 2024
1 parent d096f91 commit fdb3685
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions scc/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ def button_press(self, mapper):
Called when action is executed by pressing physical gamepad button.
'button_release' will be called later.
"""
log.warn("Action %s can't handle button press event", self.__class__.__name__)
log.warning("Action %s can't handle button press event", self.__class__.__name__)


def button_release(self, mapper):
"""
Called when action executed by pressing physical gamepad button is
expected to stop.
"""
log.warn("Action %s can't handle button release event", self.__class__.__name__)
log.warning("Action %s can't handle button release event", self.__class__.__name__)


def axis(self, mapper, position, what):
Expand All @@ -276,7 +276,7 @@ def axis(self, mapper, position, what):
'what' is one of LEFT, RIGHT or STICK (from scc.constants),
describing what is being updated
"""
log.warn("Action %s can't handle axis event", self.__class__.__name__)
log.warning("Action %s can't handle axis event", self.__class__.__name__)


def pad(self, mapper, position, what):
Expand Down Expand Up @@ -310,7 +310,7 @@ def whole(self, mapper, x, y, what):
'what' is one of LEFT, RIGHT, STICK (from scc.constants), describing what is
being updated
"""
log.warn("Action %s can't handle whole stick event", self.__class__.__name__)
log.warning("Action %s can't handle whole stick event", self.__class__.__name__)


def whole_blocked(self, mapper, x, y, what):
Expand All @@ -337,7 +337,7 @@ def change(self, mapper, dx, dy, what):
'what' can be None.
"""
log.warn("Action %s can't handle incremental changes", self.__class__.__name__)
log.warning("Action %s can't handle incremental changes", self.__class__.__name__)


def cancel(self, mapper):
Expand Down Expand Up @@ -397,7 +397,7 @@ def trigger(self, mapper, position, old_position):
'position' contains current trigger position.
'old_position' contains last known trigger position.
"""
log.warn("Action %s can't handle trigger event", self.__class__.__name__)
log.warning("Action %s can't handle trigger event", self.__class__.__name__)


class RangeOP(object):
Expand Down
2 changes: 1 addition & 1 deletion scc/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def on_profile_selected(self, ps, name, giofile):


def on_unknown_profile(self, ps, name):
log.warn("Daemon reported unknown profile: '%s'; Overriding.", name)
log.warning("Daemon reported unknown profile: '%s'; Overriding.", name)
if self.current_file is not None and ps.get_controller() is not None:
ps.get_controller().set_profile(self.current_file.get_path())

Expand Down
4 changes: 2 additions & 2 deletions scc/sccdaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def init_drivers(self):
if hasattr(mod, "init"):
to_init.append(mod)
else:
log.warn("Skipping disabled driver '%s'", modname)
log.warning("Skipping disabled driver '%s'", modname)

from scc.drivers import MOD_INIT_ORDER as order
index_fn = lambda n: order.index(n) if n in order else 1024
Expand Down Expand Up @@ -500,7 +500,7 @@ def fix_xinput(self, mapper):
d.float()
except OSError as e:
# Most likely 'xinput' executable not found
log.warn("Failed to deatach gamepad from xinput master: %s", e)
log.warning("Failed to deatach gamepad from xinput master: %s", e)


def load_default_profile(self, mapper=None):
Expand Down

0 comments on commit fdb3685

Please sign in to comment.