def check_make(): """Checks make.""" if which('make') is None: error("Cannot find 'make'.") # Test make from the shell try: subprocess.check_output(['make', '--version']) except (FileNotFoundError, subprocess.CalledProcessError) as e: msg = """ Call to 'make' failed. Please submit an Issue to https://github.com/tomduck/bassclef.""" error(msg, e)
def check_pandoc(): """Checks pandoc.""" if which('pandoc') is None: errormsg = """ Cannot find 'pandoc'. To download pandoc, see: https://github.com/jgm/pandoc/releases/latest""" error(textwrap.dedent(errormsg)) try: subprocess.check_output(['pandoc', '--version']) except (FileNotFoundError, subprocess.CalledProcessError) as e: msg = """ Call to 'pandoc' failed. Please submit an Issue to https://github.com/tomduck/bassclef.""" error(msg, e)
def check_convert(): """Checks ImageMagick convert.""" errormsg = """ Cannot find ImageMagick 'convert'. To download ImageMagick, see: https://www.imagemagick.org/script/binary-releases.php""" if which('convert') is None: error(errormsg) try: output = subprocess.check_output(['convert', '--version']) output = output.decode(encoding='UTF-8') except (FileNotFoundError, subprocess.CalledProcessError) as e: msg = """ Call to 'convert' failed. Please submit an Issue to https://github.com/tomduck/bassclef.""" error(msg, e) if not 'ImageMagick' in output: # It must be a different 'convert' error(errormsg)