diff --git a/lutin.py b/lutin.py index a1556bb..3b55cc2 100755 --- a/lutin.py +++ b/lutin.py @@ -49,19 +49,19 @@ localArgument = myLutinArg.parse() def usage(): # generic argument displayed : myLutinArg.display() - print " All target can finish with '-clean' '-dump' ..." - print " all" - print " build all (only for the current selected board) (bynary and packages)" - print " clean" - print " clean all (same as previous)" - print " dump" - print " Dump all the module dependency and properties" + print(" All target can finish with '-clean' '-dump' ...") + print(" all") + print(" build all (only for the current selected board) (bynary and packages)") + print(" clean") + print(" clean all (same as previous)") + print(" dump") + print(" Dump all the module dependency and properties") listOfAllModule = lutinModule.list_all_module_with_desc() for mod in listOfAllModule: - print " " + mod[0] + print(" " + mod[0]) if mod[1] != "": - print " " + mod[1] - print " ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all" + print(" " + mod[1]) + print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all") exit(0) # preparse the argument to get the verbose element for debug mode @@ -79,7 +79,7 @@ def parseGenericArg(argument,active): if retValue != "": retValue += " " retValue += moduleName - print retValue + print(retValue) exit(0) return True if argument.get_option_nName() == "list-target": @@ -90,7 +90,7 @@ def parseGenericArg(argument,active): if retValue != "": retValue += " " retValue += targetName - print retValue + print(retValue) exit(0) return True elif argument.get_option_nName()=="jobs": diff --git a/lutinArg.py b/lutinArg.py index 92f3674..2737a9e 100644 --- a/lutinArg.py +++ b/lutinArg.py @@ -249,10 +249,10 @@ class LutinArg: def display(self): - print "usage:" + print("usage:") listOfPropertiesArg = ""; for element in self.m_listProperties : listOfPropertiesArg += element.get_porperties() - print " " + sys.argv[0] + listOfPropertiesArg + " ..." + print(" " + sys.argv[0] + listOfPropertiesArg + " ...") for element in self.m_listProperties : element.display() \ No newline at end of file diff --git a/lutinDebug.py b/lutinDebug.py index 7dd280e..d8048b2 100644 --- a/lutinDebug.py +++ b/lutinDebug.py @@ -8,7 +8,6 @@ ## import os -import thread import lutinMultiprocess import threading import re @@ -110,7 +109,7 @@ def error(input, threadID=-1, force=False, crash=True): if crash==True: lutinMultiprocess.error_occured() if threadID != -1: - thread.interrupt_main() + threading.interrupt_main() exit(-1) #os_exit(-1) #raise "error happend" diff --git a/lutinModule.py b/lutinModule.py index 433c5c5..ea7fae3 100644 --- a/lutinModule.py +++ b/lutinModule.py @@ -725,17 +725,17 @@ class Module: def print_list(self, description, list): if len(list) > 0: - print ' %s' %description + print(' ' + str(description)) for elem in list: - print ' %s' %elem + print(' ' + str(elem)) def display(self, target): - print '-----------------------------------------------' - print ' package : "%s"' %self.name - print '-----------------------------------------------' - print ' type:"%s"' %self.type - print ' file:"%s"' %self.originFile - print ' folder:"%s"' %self.originFolder + print('-----------------------------------------------') + print(' package : "' + self.name + "'") + print('-----------------------------------------------') + print(' type:"' + str(self.type) + "'") + print(' file:"' + str(self.originFile) + "'") + print(' folder:"' + str(self.originFolder) + "'") self.print_list('depends',self.depends) self.print_list('depends_optionnal', self.depends_optionnal) self.print_list('flags_ld',self.flags_ld) diff --git a/lutinMultiprocess.py b/lutinMultiprocess.py index ec17edb..b101e82 100644 --- a/lutinMultiprocess.py +++ b/lutinMultiprocess.py @@ -11,7 +11,11 @@ import sys import lutinDebug as debug import threading import time -import Queue +import sys +if sys.version_info >= (3, 0): + import queue +else: + import Queue as queue import os import subprocess import lutinTools @@ -19,7 +23,7 @@ import lutinEnv import shlex queueLock = threading.Lock() -workQueue = Queue.Queue() +workQueue = queue.Queue() currentThreadWorking = 0 threads = [] # To know the first error arrive in the pool ==> to display all the time the same error file when multiple compilation @@ -63,6 +67,9 @@ def run_command_direct(cmdLine): debug.error("subprocess.CalledProcessError : " + str(args)) # launch the subprocess: output, err = p.communicate() + if sys.version_info >= (3, 0): + output = output.decode("utf-8") + err = err.decode("utf-8") # Check error : if p.returncode == 0: if output == None: @@ -86,6 +93,9 @@ def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""): debug.error("subprocess.CalledProcessError : TODO ...") # launch the subprocess: output, err = p.communicate() + if sys.version_info >= (3, 0): + output = output.decode("utf-8") + err = err.decode("utf-8") # Check error : if p.returncode == 0: debug.debug(lutinEnv.print_pretty(cmdLine))