def PackageArgsForExtractedZip(d):
"""Returns the aapt args for an extracted resources zip.
A resources zip either contains the resources for a single target or for
multiple targets. If it is multiple targets merged into one, the actual
resource directories will be contained in the subdirectories 0, 1, 2, ...
"""
subdirs = [os.path.join(d, s) for s in os.listdir(d)]
subdirs = [s for s in subdirs if os.path.isdir(s)]
is_multi = any(os.path.basename(s).isdigit() for s in subdirs)
if is_multi:
res_dirs = sorted(subdirs, key=lambda p : int(os.path.basename(p)))
else:
res_dirs = [d]
package_command = []
for d in res_dirs:
MoveImagesToNonMdpiFolders(d)
package_command += ['-S', d]
return package_command
评论列表
文章目录