Skip to content

Commit

Permalink
Merge 1d8bf43 into b6374aa
Browse files Browse the repository at this point in the history
  • Loading branch information
timgates42 committed Feb 26, 2020
2 parents b6374aa + 1d8bf43 commit 1c02ec2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Expand Up @@ -5,3 +5,5 @@
- faster submissions framework
- auto show readme/other file submission data
- ignore apostrophe in words
- fuzzywuzzy for spelling suggestions from local dictionary
- input does not accept highlights
25 changes: 23 additions & 2 deletions app/meticulous/_process.py
Expand Up @@ -12,7 +12,9 @@
from pathlib import Path
from urllib.parse import quote

import spelling.version
import unanimous.util
import unanimous.version
from colorama import Fore, Style, init
from plumbum import FG, local
from spelling.check import process_results, run_spell_check
Expand Down Expand Up @@ -78,6 +80,7 @@ def run_invocation(target):
sys.exit(1)
init()
prepare()
validate_versions()
try:
if get_confirmation("Run automated process"):
automated_process(target)
Expand All @@ -87,6 +90,25 @@ def run_invocation(target):
print("Quit by user.")


def validate_versions():
"""
Warn if libraries are old
"""
versions = [
("unanimous", unanimous.version.__version__, "0.6.5"),
("spelling", spelling.version.__version__, "0.6.4"),
]
for name, vertxt, minvertxt in versions:
vertup = tuple(int(elem) for elem in vertxt.split("."))
minver = tuple(int(elem) for elem in minvertxt.split("."))
if vertup < minver:
print(
f"{Fore.YELLOW}Warning {name} is version"
f" {vertxt} below minimum of {minvertxt}"
f"{Style.RESET_ALL}"
)


def manual_menu(target):
"""
Present the main menu
Expand Down Expand Up @@ -726,8 +748,7 @@ def task_collect_nonwords(obj, eng): # pylint: disable=unused-argument
except HaltProcessing:
if state.done:
return
msg = "Completed checking all words!"
print("".join([Fore.YELLOW, msg, Style.RESET_ALL]))
print(f"{Fore.YELLOW}Completed checking all words!{Style.RESET_ALL}")


def check_websearch(obj, eng):
Expand Down

0 comments on commit 1c02ec2

Please sign in to comment.