Bump requirements.
This commit is contained in:
parent
67856d8bcb
commit
6b95217da8
28
pogrep.py
28
pogrep.py
|
@ -18,8 +18,7 @@ from tabulate import tabulate
|
|||
|
||||
|
||||
def get_colors():
|
||||
"""Just returns the CSI codes for red, green, magenta, and reset color.
|
||||
"""
|
||||
"""Just returns the CSI codes for red, green, magenta, and reset color."""
|
||||
try:
|
||||
curses.setupterm()
|
||||
fg_color = curses.tigetstr("setaf") or curses.tigetstr("setf") or ""
|
||||
|
@ -60,8 +59,7 @@ def colorize(text, pattern, prefixes=()):
|
|||
|
||||
|
||||
class Match(NamedTuple):
|
||||
"""Represents a string found in a po file.
|
||||
"""
|
||||
"""Represents a string found in a po file."""
|
||||
|
||||
file: str
|
||||
line: int
|
||||
|
@ -75,8 +73,7 @@ def find_in_po(
|
|||
not_in_source: bool = False,
|
||||
in_translation: bool = False,
|
||||
) -> Tuple[List[str], List[Match]]:
|
||||
"""Find the given pattern in the given list of paths or files.
|
||||
"""
|
||||
"""Find the given pattern in the given list of paths or files."""
|
||||
results = []
|
||||
errors = []
|
||||
for filename in path:
|
||||
|
@ -97,10 +94,12 @@ def find_in_po(
|
|||
|
||||
|
||||
def display_results(
|
||||
matches: Sequence[Match], pattern: str, line_number: bool, files_with_matches: bool,
|
||||
matches: Sequence[Match],
|
||||
pattern: str,
|
||||
line_number: bool,
|
||||
files_with_matches: bool,
|
||||
):
|
||||
"""Display matches as a colorfull table.
|
||||
"""
|
||||
"""Display matches as a colorfull table."""
|
||||
files = {match.file for match in matches}
|
||||
if files_with_matches: # Just print filenames
|
||||
for file in files:
|
||||
|
@ -160,8 +159,7 @@ def process_path(path: Sequence[str], recursive: bool) -> List[str]:
|
|||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
"""Parse command line arguments.
|
||||
"""
|
||||
"""Parse command line arguments."""
|
||||
parser = argparse.ArgumentParser(description="Find translated words.")
|
||||
parser.add_argument(
|
||||
"-F",
|
||||
|
@ -237,8 +235,7 @@ def parse_args() -> argparse.Namespace:
|
|||
|
||||
|
||||
def main():
|
||||
"""Command line entry point.
|
||||
"""
|
||||
"""Command line entry point."""
|
||||
args = parse_args()
|
||||
if args.fixed_strings:
|
||||
args.pattern = regex.escape(args.pattern)
|
||||
|
@ -254,7 +251,10 @@ def main():
|
|||
for error in errors:
|
||||
print(error, file=sys.stderr)
|
||||
display_results(
|
||||
results, args.pattern, args.line_number, args.files_with_matches,
|
||||
results,
|
||||
args.pattern,
|
||||
args.line_number,
|
||||
args.files_with_matches,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
-r requirements.txt
|
||||
black
|
||||
flake8
|
||||
isort
|
||||
|
|
|
@ -4,41 +4,109 @@
|
|||
#
|
||||
# pip-compile requirements-dev.in
|
||||
#
|
||||
appdirs==1.4.4 # via black, virtualenv
|
||||
astroid==2.4.2 # via pylint
|
||||
attrs==19.3.0 # via black, pytest
|
||||
black==19.10b0 # via -r requirements-dev.in
|
||||
click==7.1.2 # via black, pip-tools
|
||||
distlib==0.3.0 # via virtualenv
|
||||
filelock==3.0.12 # via tox, virtualenv
|
||||
flake8==3.8.3 # via -r requirements-dev.in
|
||||
isort==4.3.21 # via -r requirements-dev.in, pylint
|
||||
lazy-object-proxy==1.4.3 # via astroid
|
||||
mccabe==0.6.1 # via flake8, pylint
|
||||
more-itertools==8.4.0 # via pytest
|
||||
mypy-extensions==0.4.3 # via mypy
|
||||
mypy==0.782 # via -r requirements-dev.in
|
||||
packaging==20.4 # via pytest, tox
|
||||
pathspec==0.8.0 # via black
|
||||
pip-tools==5.2.1 # via -r requirements-dev.in
|
||||
pluggy==0.13.1 # via pytest, tox
|
||||
polib==1.1.0 # via -r requirements-dev.in
|
||||
py==1.8.1 # via pytest, tox
|
||||
pycodestyle==2.6.0 # via flake8
|
||||
pyflakes==2.2.0 # via flake8
|
||||
pylint==2.5.3 # via -r requirements-dev.in
|
||||
pyparsing==2.4.7 # via packaging
|
||||
pytest==5.4.3 # via -r requirements-dev.in
|
||||
regex==2020.6.8 # via -r requirements-dev.in, black
|
||||
six==1.15.0 # via astroid, packaging, pip-tools, tox, virtualenv
|
||||
tabulate==0.8.7 # via -r requirements-dev.in
|
||||
toml==0.10.1 # via black, pylint, tox
|
||||
tox==3.15.2 # via -r requirements-dev.in
|
||||
typed-ast==1.4.1 # via black, mypy
|
||||
typing-extensions==3.7.4.2 # via mypy
|
||||
virtualenv==20.0.23 # via tox
|
||||
wcwidth==0.2.4 # via pytest
|
||||
wrapt==1.12.1 # via astroid
|
||||
appdirs==1.4.4
|
||||
# via
|
||||
# black
|
||||
# virtualenv
|
||||
astroid==2.5.1
|
||||
# via pylint
|
||||
attrs==20.3.0
|
||||
# via pytest
|
||||
black==20.8b1
|
||||
# via -r requirements-dev.in
|
||||
click==7.1.2
|
||||
# via
|
||||
# black
|
||||
# pip-tools
|
||||
distlib==0.3.1
|
||||
# via virtualenv
|
||||
filelock==3.0.12
|
||||
# via
|
||||
# tox
|
||||
# virtualenv
|
||||
flake8==3.8.4
|
||||
# via -r requirements-dev.in
|
||||
iniconfig==1.1.1
|
||||
# via pytest
|
||||
isort==5.7.0
|
||||
# via
|
||||
# -r requirements-dev.in
|
||||
# pylint
|
||||
lazy-object-proxy==1.5.2
|
||||
# via astroid
|
||||
mccabe==0.6.1
|
||||
# via
|
||||
# flake8
|
||||
# pylint
|
||||
mypy-extensions==0.4.3
|
||||
# via
|
||||
# black
|
||||
# mypy
|
||||
mypy==0.812
|
||||
# via -r requirements-dev.in
|
||||
packaging==20.9
|
||||
# via
|
||||
# pytest
|
||||
# tox
|
||||
pathspec==0.8.1
|
||||
# via black
|
||||
pip-tools==5.5.0
|
||||
# via -r requirements-dev.in
|
||||
pluggy==0.13.1
|
||||
# via
|
||||
# pytest
|
||||
# tox
|
||||
polib==1.1.0
|
||||
# via
|
||||
# -r requirements-dev.in
|
||||
# -r requirements.txt
|
||||
py==1.10.0
|
||||
# via
|
||||
# pytest
|
||||
# tox
|
||||
pycodestyle==2.6.0
|
||||
# via flake8
|
||||
pyflakes==2.2.0
|
||||
# via flake8
|
||||
pylint==2.7.2
|
||||
# via -r requirements-dev.in
|
||||
pyparsing==2.4.7
|
||||
# via packaging
|
||||
pytest==6.2.2
|
||||
# via -r requirements-dev.in
|
||||
regex==2020.11.13
|
||||
# via
|
||||
# -r requirements-dev.in
|
||||
# -r requirements.txt
|
||||
# black
|
||||
six==1.15.0
|
||||
# via
|
||||
# tox
|
||||
# virtualenv
|
||||
tabulate==0.8.9
|
||||
# via
|
||||
# -r requirements-dev.in
|
||||
# -r requirements.txt
|
||||
toml==0.10.2
|
||||
# via
|
||||
# black
|
||||
# pylint
|
||||
# pytest
|
||||
# tox
|
||||
tox==3.22.0
|
||||
# via -r requirements-dev.in
|
||||
typed-ast==1.4.2
|
||||
# via
|
||||
# black
|
||||
# mypy
|
||||
typing-extensions==3.7.4.3
|
||||
# via
|
||||
# black
|
||||
# mypy
|
||||
virtualenv==20.4.2
|
||||
# via tox
|
||||
wrapt==1.12.1
|
||||
# via astroid
|
||||
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
# pip
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# This file is autogenerated by pip-compile
|
||||
# To update, run:
|
||||
#
|
||||
# pip-compile setup.py
|
||||
#
|
||||
polib==1.1.0
|
||||
# via pogrep (setup.py)
|
||||
regex==2020.11.13
|
||||
# via pogrep (setup.py)
|
||||
tabulate==0.8.9
|
||||
# via pogrep (setup.py)
|
|
@ -49,7 +49,10 @@ def test_not_in_source(about_po):
|
|||
|
||||
def test_in_translation(about_po):
|
||||
errors, results = find_in_po(
|
||||
"propos", ("about.po",), in_translation=True, not_in_source=True,
|
||||
"propos",
|
||||
("about.po",),
|
||||
in_translation=True,
|
||||
not_in_source=True,
|
||||
)
|
||||
assert not errors
|
||||
assert "about.po" in {result.file for result in results}
|
||||
|
@ -57,7 +60,10 @@ def test_in_translation(about_po):
|
|||
|
||||
def test_not_in_translation(about_po):
|
||||
errors, results = find_in_po(
|
||||
"About", ("about.po",), in_translation=True, not_in_source=True,
|
||||
"About",
|
||||
("about.po",),
|
||||
in_translation=True,
|
||||
not_in_source=True,
|
||||
)
|
||||
assert not errors
|
||||
assert not results
|
||||
|
|
Loading…
Reference in New Issue