enabled ruff check fixes and ruff formatting · commit-0/python-progressbar@2cc3e19 · GitHub
Skip to content

Commit 2cc3e19

Browse files
committed
enabled ruff check fixes and ruff formatting
1 parent 51091f9 commit 2cc3e19

40 files changed

Lines changed: 479 additions & 406 deletions

examples.py

Lines changed: 18 additions & 15 deletions

progressbar/__about__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''Text progress bar library for Python.
1+
"""Text progress bar library for Python.
22
33
A text progress bar is typically used to display the progress of a long
44
running operation, providing a visual cue that processing is underway.
@@ -9,16 +9,16 @@
99
1010
The progressbar module is very easy to use, yet very powerful. It will also
1111
automatically enable features like auto-resizing when the system supports it.
12-
'''
12+
"""
1313

1414
__title__ = 'Python Progressbar'
1515
__package_name__ = 'progressbar2'
1616
__author__ = 'Rick van Hattem (Wolph)'
1717
__description__ = ' '.join(
18-
'''
18+
"""
1919
A Python Progressbar library to provide visual (yet text based) progress to
2020
long running operations.
21-
'''.strip().split(),
21+
""".strip().split(),
2222
)
2323
__email__ = 'wolph@wol.ph'
2424
__version__ = '4.4.3'

progressbar/__main__.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def size_to_bytes(size_str: str) -> int:
15-
'''
15+
"""
1616
Convert a size string with suffixes 'k', 'm', etc., to bytes.
1717
1818
Note: This function also supports '@' as a prefix to a file path to get the
@@ -28,7 +28,7 @@ def size_to_bytes(size_str: str) -> int:
2828
1024
2929
>>> size_to_bytes('1024p')
3030
1125899906842624
31-
'''
31+
"""
3232

3333
# Define conversion rates
3434
suffix_exponent = {
@@ -58,17 +58,17 @@ def size_to_bytes(size_str: str) -> int:
5858

5959

6060
def create_argument_parser() -> argparse.ArgumentParser:
61-
'''
61+
"""
6262
Create the argument parser for the `progressbar` command.
63-
'''
63+
"""
6464

6565
parser = argparse.ArgumentParser(
66-
description='''
66+
description="""
6767
Monitor the progress of data through a pipe.
6868
6969
Note that this is a Python implementation of the original `pv` command
7070
that is functional but not yet feature complete.
71-
'''
71+
"""
7272
)
7373

7474
# Display switches
@@ -132,9 +132,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
132132
parser.add_argument(
133133
'-n', '--numeric', action='store_true', help='Numeric output.'
134134
)
135-
parser.add_argument(
136-
'-q', '--quiet', action='store_true', help='No output.'
137-
)
135+
parser.add_argument('-q', '--quiet', action='store_true', help='No output.')
138136

139137
# Output modifiers
140138
parser.add_argument(
@@ -270,15 +268,15 @@ def create_argument_parser() -> argparse.ArgumentParser:
270268

271269

272270
def main(argv: list[str] | None = None): # noqa: C901
273-
'''
271+
"""
274272
Main function for the `progressbar` command.
275273
276274
Args:
277275
argv (list[str] | None): Command-line arguments passed to the script.
278276
279277
Returns:
280278
None
281-
'''
279+
"""
282280
parser: argparse.ArgumentParser = create_argument_parser()
283281
args: argparse.Namespace = parser.parse_args(argv)
284282

progressbar/algorithms.py

Lines changed: 6 additions & 6 deletions

0 commit comments

Comments
 (0)