diff --git a/build.py b/build.py index df65316..09cba33 100755 --- a/build.py +++ b/build.py @@ -15,7 +15,7 @@ CONTEXT_FILE = CWD / 'context.yaml' WORDCOUNT_TEMPLATE = BASE_DIR / 'wordcount.yaml' -def build(input_file: pathlib.Path, additional_args=None): +def build(input_file, additional_args=None): build_args = ['pandoc', str(input_file)] if CONTEXT_FILE.exists(): @@ -33,14 +33,14 @@ def build(input_file: pathlib.Path, additional_args=None): return subprocess.run(build_args, cwd=str(BASE_DIR), check=True) -def get_word_count() -> int: +def get_word_count(): words = subprocess.check_output([ 'pdftotext', str(OUTPUT_FILE), '-' ], cwd=str(BASE_DIR)) return len(re.findall(r'\w+', words.decode())) -def write_wordcount() -> pathlib.Path: +def write_wordcount(): _, out_file_path = tempfile.mkstemp(suffix='.yaml') wordcount = get_word_count() with open(out_file_path, 'w') as out_file: