mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Apply formatting
This commit is contained in:
parent
34d19e5714
commit
47c38e8d91
7 changed files with 61 additions and 43 deletions
|
@ -30,6 +30,7 @@ from typing import Optional, Sequence
|
|||
import argparse
|
||||
import re
|
||||
|
||||
|
||||
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='*', help='Filenames to check')
|
||||
|
@ -47,12 +48,12 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
|||
for line in file:
|
||||
if (match := regex.match(line)) is not None:
|
||||
error_buffer += str(f"Defect file: \"{filename}\"\n"
|
||||
f"Line: {line_counter}\n"
|
||||
f"Column span: {match.span()}\n"
|
||||
f"Part: \"{match.group()}\"\n\n")
|
||||
f"Line: {line_counter}\n"
|
||||
f"Column span: {match.span()}\n"
|
||||
f"Part: \"{match.group()}\"\n\n")
|
||||
line_counter += 1
|
||||
|
||||
except UnicodeDecodeError as error:
|
||||
except UnicodeDecodeError:
|
||||
# not a text file, skip
|
||||
continue
|
||||
|
||||
|
@ -64,5 +65,6 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
|||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
exit(main())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue