Cleanup some variable naming.
parent
1ca9912987
commit
aa15d2a7e2
|
@ -45,9 +45,9 @@ def mktemp(dir=None, suffix=''):
|
||||||
|
|
||||||
|
|
||||||
def main(options, args):
|
def main(options, args):
|
||||||
dmgFile, license = args
|
dmg_file, license = args
|
||||||
with mktemp('.') as tmpFile:
|
with mktemp('.') as tmp_file:
|
||||||
with open(tmpFile, 'w') as f:
|
with open(tmp_file, 'w') as f:
|
||||||
f.write("""data 'TMPL' (128, "LPic") {
|
f.write("""data 'TMPL' (128, "LPic") {
|
||||||
$"1344 6566 6175 6C74 204C 616E 6775 6167"
|
$"1344 6566 6175 6C74 204C 616E 6775 6167"
|
||||||
$"6520 4944 4457 5244 0543 6F75 6E74 4F43"
|
$"6520 4944 4457 5244 0543 6F75 6E74 4F43"
|
||||||
|
@ -110,24 +110,24 @@ data 'STR#' (5002, "English") {
|
||||||
$"0100 0000 0000 0000 0000 0000 002A 000C"
|
$"0100 0000 0000 0000 0000 0000 002A 000C"
|
||||||
$"0009 0014 0000 0000 0000 0000 0000"
|
$"0009 0014 0000 0000 0000 0000 0000"
|
||||||
};\n""")
|
};\n""")
|
||||||
os.system('hdiutil unflatten -quiet "%s"' % dmgFile)
|
os.system('hdiutil unflatten -quiet "%s"' % dmg_file)
|
||||||
ret = os.system('%s -a %s -o "%s"' %
|
ret = os.system('%s -a %s -o "%s"' %
|
||||||
(options.rez, tmpFile, dmgFile))
|
(options.rez, tmp_file, dmg_file))
|
||||||
os.system('hdiutil flatten -quiet "%s"' % dmgFile)
|
os.system('hdiutil flatten -quiet "%s"' % dmg_file)
|
||||||
if options.compression is not None:
|
if options.compression is not None:
|
||||||
os.system('cp %s %s.temp.dmg' % (dmgFile, dmgFile))
|
os.system('cp %s %s.temp.dmg' % (dmg_file, dmg_file))
|
||||||
os.remove(dmgFile)
|
os.remove(dmg_file)
|
||||||
if options.compression == "bz2":
|
if options.compression == "bz2":
|
||||||
os.system('hdiutil convert %s.temp.dmg -format UDBZ -o %s' %
|
os.system('hdiutil convert %s.temp.dmg -format UDBZ -o %s' %
|
||||||
(dmgFile, dmgFile))
|
(dmg_file, dmg_file))
|
||||||
elif options.compression == "gz":
|
elif options.compression == "gz":
|
||||||
os.system('hdiutil convert %s.temp.dmg -format ' % dmgFile +
|
os.system('hdiutil convert %s.temp.dmg -format ' % dmg_file +
|
||||||
'UDZO -imagekey zlib-devel=9 -o %s' % dmgFile)
|
'UDZO -imagekey zlib-devel=9 -o %s' % dmg_file)
|
||||||
os.remove('%s.temp.dmg' % dmgFile)
|
os.remove('%s.temp.dmg' % dmg_file)
|
||||||
if ret == 0:
|
if ret == 0:
|
||||||
print("Successfully added license to '%s'" % dmgFile)
|
print("Successfully added license to '%s'" % dmg_file)
|
||||||
else:
|
else:
|
||||||
print("Failed to add license to '%s'" % dmgFile)
|
print("Failed to add license to '%s'" % dmg_file)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue