mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-02 02:54:00 +02:00
New bypy CLI
This commit is contained in:
parent
f011bf5667
commit
65fc639949
1 changed files with 12 additions and 13 deletions
|
|
@ -25,18 +25,17 @@ def get_exe():
|
|||
return 'python3' if sys.version_info.major == 2 else sys.executable
|
||||
|
||||
|
||||
def get_cmd(exe, bypy, which, bitness, sign_installers, notarize=True, compression_level='9'):
|
||||
def get_cmd(exe, bypy, which, bitness, sign_installers, notarize=True, compression_level='9', action='program'):
|
||||
cmd = [exe, bypy, which]
|
||||
if bitness and bitness == '32':
|
||||
cmd.append(bitness)
|
||||
cmd.append('program')
|
||||
if not sys.stdout.isatty():
|
||||
cmd.append('--no-tty')
|
||||
if sign_installers or notarize:
|
||||
cmd.append('--sign-installers')
|
||||
if notarize:
|
||||
cmd.append('--notarize')
|
||||
cmd.append('--compression-level=' + compression_level)
|
||||
if bitness and bitness != '64':
|
||||
cmd += ['--arch', bitness]
|
||||
cmd.append(action)
|
||||
if action == 'program':
|
||||
if sign_installers or notarize:
|
||||
cmd.append('--sign-installers')
|
||||
if notarize:
|
||||
cmd.append('--notarize')
|
||||
cmd.append('--compression-level=' + compression_level)
|
||||
return cmd
|
||||
|
||||
|
||||
|
|
@ -62,7 +61,7 @@ def build_only(which, bitness, spec, shutdown=False):
|
|||
dist = get_dist(base, which, bitness)
|
||||
dist = os.path.join(dist, 'c-extensions')
|
||||
if shutdown:
|
||||
cmd = [exe, bypy, which, 'shutdown']
|
||||
cmd = get_cmd(action='shutdown')
|
||||
subprocess.Popen(cmd).wait()
|
||||
return dist
|
||||
|
||||
|
|
@ -87,7 +86,7 @@ def build_single(which='windows', bitness='64', shutdown=True, sign_installers=T
|
|||
pass
|
||||
os.link(src, dest)
|
||||
if shutdown:
|
||||
cmd = [exe, bypy, which, 'shutdown']
|
||||
cmd = get_cmd(action='shutdown')
|
||||
subprocess.Popen(cmd).wait()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue