mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-25 06:33:43 +00:00
Replace os.system() with subprocess.check_call().
This commit is contained in:
parent
c22a3d7367
commit
4c9989509a
1 changed files with 9 additions and 6 deletions
15
setup.py
15
setup.py
|
|
@ -528,14 +528,17 @@ try:
|
|||
def run (self):
|
||||
# First, let py2app do it's work.
|
||||
py2app_build.run(self)
|
||||
imgPath = os.path.join(self.dist_dir, "LinkChecker.dmg")
|
||||
tmpImgPath = os.path.join(self.dist_dir, "LinkChecker.tmp.dmg")
|
||||
dist_dir = self.dist_dir
|
||||
imgPath = os.path.join(dist_dir, "LinkChecker-%s.dmg" % AppVersion)
|
||||
tmpImgPath = os.path.join(dist_dir, "LinkChecker.tmp.dmg")
|
||||
print "*** generating temporary DMG image ***"
|
||||
os.system('hdiutil create -srcfolder "%s" -volname "LinkChecker" -format UDZO "%s"' %
|
||||
(self.dist_dir, tmpImgPath))
|
||||
args = ['hdiutil', 'create', '-srcfolder', dist_dir,
|
||||
'-volname', 'LinkChecker', '-format', 'UDZO', tmpImgPath]
|
||||
subprocess.check_call(args)
|
||||
print "*** generating final DMG image ***"
|
||||
os.system('hdiutil "%s" convert -format UDZO -imagekey zlib-level=9 -o "%s"' %
|
||||
(tmpImgPath, imgPath))
|
||||
args = ['hdiutil', tmpImgPath, 'convert', '-format', 'UDZO',
|
||||
'-imagekey', 'zlib-level=9', '-o', imgPath]
|
||||
subprocess.check_call(args)
|
||||
os.remove(tmpImgPath)
|
||||
except ImportError:
|
||||
class MyPy2app:
|
||||
|
|
|
|||
Loading…
Reference in a new issue