From bbffe94a9d425128aa4f403d285a1a848e00b4a5 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 9 Jan 2013 20:42:14 +0000 Subject: Ensure the VSIX Python script aborts if the ASF project generator is missing. --- LUFA/StudioIntegration/generate_caches.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'LUFA/StudioIntegration/generate_caches.py') diff --git a/LUFA/StudioIntegration/generate_caches.py b/LUFA/StudioIntegration/generate_caches.py index 033ae28dda..1e49320aef 100644 --- a/LUFA/StudioIntegration/generate_caches.py +++ b/LUFA/StudioIntegration/generate_caches.py @@ -10,11 +10,26 @@ import sys import os sys.path.append("ProjectGenerator") -try: - from asf_avrstudio5_interface import PythonFacade -except ImportError: - print "The ASF project generator is missing." - -p = PythonFacade(os.path.abspath(__file__)) -p.check_extension_database_sanity(sys.argv[1]) -p.generate_extension_cache_files(sys.argv[1]) + +def main(): + try: + from asf_avrstudio5_interface import PythonFacade + except ImportError: + print "The ASF project generator is missing." + sys.exit() + + p = PythonFacade(os.path.abspath(__file__)) + + print "[Project Generator] Checking database sanity..." + sys.stdout.flush() + p.check_extension_database_sanity(sys.argv[1]) + + print "[Project Generator] Building cache files..." + sys.stdout.flush() + p.generate_extension_cache_files(sys.argv[1]) + + print "[Project Generator] Cache files created." + + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file -- cgit v1.2.3