Example #1
0
				print("{YELLOW}    {name}:{NOCOLOR} {cause}".format(name=cause.__class__.__name__, cause= str(cause), **Init.Foreground))
		elif isinstance(cause, ToolChainException):
			print("{YELLOW}  {name}:{NOCOLOR} {cause}".format(name=cause.__class__.__name__, cause=str(cause), **Init.Foreground))
			cause = cause.__cause__
			if (cause is not None):
				if isinstance(cause, OSError):
					print("{YELLOW}    {name}:{NOCOLOR} {cause}".format(name=cause.__class__.__name__, cause=str(cause), **Init.Foreground))
			else:
				print("  Possible causes:")
				print("   - The compile order is broken.")
				print("   - A source file was not compiled and an old file got used.")

		if (not (verbose or debug)):
			print()
			print("{CYAN}  Use '-v' for verbose or '-d' for debug to print out extended messages.{NOCOLOR}".format(**Init.Foreground))
		Exit.exit(1)

	except EnvironmentException as ex:          Exit.printEnvironmentException(ex)
	except NotConfiguredException as ex:        Exit.printNotConfiguredException(ex)
	except PlatformNotSupportedException as ex:  Exit.printPlatformNotSupportedException(ex)
	except ExceptionBase as ex:                  Exit.printExceptionbase(ex)
	except NotImplementedError as ex:            Exit.printNotImplementedError(ex)
	# except Exception as ex:                      Exit.printException(ex)

# entry point
if __name__ == "__main__":
	Exit.versionCheck((3,5,0))
	main()
else:
	Exit.printThisIsNoLibraryFile(PoC.HeadLine)
Example #2
0
        from configparser import Error

        print(Fore.RED + "ERROR:" + Fore.RESET + " %s" % ex.message)
        if isinstance(ex.__cause__, FileNotFoundError):
            print(Fore.YELLOW + "  FileNotFound:" + Fore.RESET + " '%s'" % str(ex.__cause__))
        elif isinstance(ex.__cause__, Error):
            print(Fore.YELLOW + "  configparser.Error:" + Fore.RESET + " %s" % str(ex.__cause__))
        print(Fore.RESET + Back.RESET + Style.RESET_ALL)
        exit(1)

    except EnvironmentException as ex:
        Exit.printEnvironmentException(ex)
    except NotConfiguredException as ex:
        Exit.printNotConfiguredException(ex)
    except PlatformNotSupportedException as ex:
        Exit.printPlatformNotSupportedException(ex)
    except BaseException as ex:
        Exit.printBaseException(ex)
    except NotImplementedException as ex:
        Exit.printNotImplementedException(ex)
    except Exception as ex:
        Exit.printException(ex)


# entry point
if __name__ == "__main__":
    Exit.versionCheck((3, 4, 0))
    main()
else:
    Exit.printThisIsNoLibraryFile(Testbench.headLine)
Example #3
0
		elif (args.xst is not None):
			netList.xstCompilation(args.xst, args.showLog, args.showReport, deviceString=args.device, boardString=args.board)
		else:
			argParser.print_help()
		
	except CompilerException as ex:
		from colorama import Fore, Back, Style
		from configparser import Error
		
		print(Fore.RED + "ERROR:" + Fore.RESET + " %s" % ex.message)
		if isinstance(ex.__cause__, FileNotFoundError):
			print(Fore.YELLOW + "  FileNotFound:" + Fore.RESET + " '%s'" % str(ex.__cause__))
		elif isinstance(ex.__cause__, Error):
			print(Fore.YELLOW + "  configparser.Error:" + Fore.RESET + " %s" % str(ex.__cause__))
		print(Fore.RESET + Back.RESET + Style.RESET_ALL)
		exit(1)
		
	except EnvironmentException as ex:					Exit.printEnvironmentException(ex)
	except NotConfiguredException as ex:				Exit.printNotConfiguredException(ex)
	except PlatformNotSupportedException as ex:	Exit.printPlatformNotSupportedException(ex)
	except BaseException as ex:									Exit.printBaseException(ex)
	except NotImplementedException as ex:				Exit.printNotImplementedException(ex)
	except Exception as ex:											Exit.printException(ex)
			
# entry point
if __name__ == "__main__":
	Exit.versionCheck((3,4,0))
	main()
else:
	Exit.printThisIsNoLibraryFile(Netlist.headLine)
Example #4
0
			exit(0)
		else:
			print(Fore.MAGENTA + "=" * 80)
			print("{: ^80s}".format(Configuration.headLine))
			print("=" * 80)
			print(Fore.RESET + Back.RESET + Style.RESET_ALL)
		
			argParser.print_help()
			exit(0)
	
#	except ConfiguratorException as ex:
#		from colorama import Fore, Back, Style
#		print(Fore.RED + "ERROR:" + Fore.RESET + " %s" % ex.message)
#		if isinstance(ex.__cause__, FileNotFoundError):
#			print(Fore.YELLOW + "  FileNotFound:" + Fore.RESET + " '%s'" % str(ex.__cause__))
#		print(Fore.RESET + Back.RESET + Style.RESET_ALL)
#		exit(1)
		
	except NotConfiguredException as ex:				Exit.printNotConfiguredException(ex)
	except PlatformNotSupportedException as ex:	Exit.printPlatformNotSupportedException(ex)
	except BaseException as ex:									Exit.printBaseException(ex)
	except NotImplementedException as ex:				Exit.printNotImplementedException(ex)
	except Exception as ex:											Exit.printException(ex)
			
# entry point
if __name__ == "__main__":
	Exit.versionCheck((3,4,0))
	main()
else:
	Exit.printThisIsNoLibraryFile(Configuration.headLine)