def __getExtractor( source, env ) :
# we check each unpacker and get the correc list command first, run the command and
# replace the target filelist with the list values, we sorte the extractors by their priority
- for unpackername, extractor in sorted(env["UNPACK"]["EXTRACTOR"].iteritems(), key = lambda (k,v) : (v["PRIORITY"],k)):
+ for unpackername, extractor in sorted(iter(env["UNPACK"]["EXTRACTOR"].items()), key = lambda k_v : (k_v[1]["PRIORITY"],k_v[0])):
# if the run command not set, we continue the extractor search, otherwise we check the extractor parameters
if not SCons.Util.is_String(extractor["RUN"]) :
# @param source source name
# @param env environment object
def __message( s, target, source, env ) :
- print "extract [%s] ..." % (source[0])
+ print("extract [%s] ..." % (source[0]))
# action function for extracting of the data
devnull = open(os.devnull, "wb")
handle = subprocess.Popen( cmd, shell=True, stdout=devnull, cwd=cwd)
- if handle.wait() <> 0 :
+ if handle.wait() != 0 :
raise SCons.Errors.BuildError( "error running extractor [%s] on the source [%s]" % (cmd, source[0]) )
fhandle = open(target_path, 'a')
}
# read tools for Windows system
- if env["PLATFORM"] <> "darwin" and "win" in env["PLATFORM"] :
+ if env["PLATFORM"] != "darwin" and "win" in env["PLATFORM"] :
if env.WhereIs("7z"):
toolset["EXTRACTOR"]["TARGZ"]["RUN"] = "7z"