#!/usr/bin/env python # Microchip MPLAB MP2HEX Wrapper # Copyright (C) John Dong, Adams Robotics Team # Licensed under the terms of the General Public License import os import sys import subprocess DEBUG=False VERSION="0.1" def do_headers(): print "\tMicrochip MPLINK Linker" print "\tVersion "+VERSION def dbgprint(msg): if DEBUG: sys.stderr.write("DEBUG:"+msg) def list2list(list): tmp="" for t in list: tmp+=t+" " return tmp ## Simple wrapper for the MCC18 executable do_headers() compile_success=True WINE_EXEC_PATH="wine" MCC18_EXEC_COMMAND=WINE_EXEC_PATH+" mp2hex" dbgprint("Using "+MCC18_EXEC_COMMAND+" "+list2list(sys.argv)+" to launch mp2hex\n") pipes=subprocess.Popen([MCC18_EXEC_COMMAND+" "+list2list(sys.argv[1:])], shell=True, stdout=subprocess.PIPE, close_fds=True) while True: t=pipes.stdout.readline() print t if t=="": break