Skip to content

Commit

Permalink
Switch from naturalsort to natsort (pyocd#1318)
Browse files Browse the repository at this point in the history
pyocd/commands/commands.py:
Use natsort's `natsorted()` instead of naturalsort's `natsort()`.

setup.cfg:
Replace naturalsort with natsort.

Fixes pyocd#1317
  • Loading branch information
dvzrv authored and flit committed Jan 22, 2022
1 parent 91ba2df commit f34e2de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pyocd/commands/commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pyOCD debugger
# Copyright (c) 2015-2020 Arm Limited
# Copyright (c) 2021 Chris Reed
# Copyright (c) 2022 David Runge
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,7 +18,7 @@

import logging
import os
from natsort import natsort
from natsort import natsorted
import textwrap
from time import sleep
from shutil import get_terminal_size
Expand Down Expand Up @@ -116,7 +117,7 @@ def execute(self):

class RegisterCommandBase(CommandBase):
def dump_register_group(self, group_name):
regs = natsort(self.context.selected_core.core_registers.iter_matching(
regs = natsorted(self.context.selected_core.core_registers.iter_matching(
lambda r: r.group == group_name), key=lambda r: r.name)
reg_values = self.context.selected_core.read_core_registers_raw(r.name for r in regs)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ install_requires =
intelhex>=2.0,<3.0
intervaltree>=3.0.2,<4.0
libusb-package>=1.0,<2.0
naturalsort>=1.5,<2.0
natsort>=8.0.0,<9.0
prettytable>=2.0,<3.0
pyelftools<1.0
pylink-square>=0.11.1,<1.0
Expand Down

0 comments on commit f34e2de

Please sign in to comment.