From 5b04d7a8a48c93dac0de3257e831bb9a4e0b236e Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 20 May 2016 21:42:07 +0200 Subject: [PATCH] if pyaml is not available, print a nice error message --- update.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/update.py b/update.py index 080b822..11c24f0 100644 --- a/update.py +++ b/update.py @@ -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)