if pyaml is not available, print a nice error message

This commit is contained in:
Radovan Bast 2016-05-20 21:42:07 +02:00
parent 6cf25bbd2b
commit 5b04d7a8a4

View File

@ -7,6 +7,14 @@ import sys
AUTOCMAKE_GITHUB_URL = 'https://github.com/coderefinery/autocmake/raw/yaml/'
def check_for_yaml():
try:
import yaml
except:
sys.stderr.write("ERROR: you need to install the pyaml module\n")
sys.exit(-1)
def print_progress_bar(text, done, total, width):
"""
Print progress bar.
@ -270,4 +278,5 @@ def fetch_url(src, dst):
if __name__ == '__main__':
check_for_yaml()
main(sys.argv)