fix: wait for snap chromium IPC client to finish handshake using subprocess.run
This commit is contained in:
parent
74526cf7a6
commit
9e2b2a83e6
1 changed files with 12 additions and 5 deletions
|
|
@ -238,19 +238,26 @@ def main():
|
|||
if chromium_cmd:
|
||||
try:
|
||||
cmd = chromium_cmd + [deeplink]
|
||||
subprocess.Popen(
|
||||
res = subprocess.run(
|
||||
cmd,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=15,
|
||||
)
|
||||
except Exception:
|
||||
webbrowser.open(deeplink)
|
||||
if res.returncode == 0:
|
||||
print(" -> Brouillon transmis avec succès à votre session Outlook !")
|
||||
else:
|
||||
webbrowser.open(deeplink)
|
||||
|
||||
print(" -> Brouillon ouvert dans votre fenêtre Outlook !")
|
||||
print(" -> Brouillon ouvert via le navigateur par défaut.")
|
||||
except Exception:
|
||||
webbrowser.open(deeplink)
|
||||
print(" -> Brouillon ouvert via le navigateur par défaut.")
|
||||
else:
|
||||
webbrowser.open(deeplink)
|
||||
print(" -> Brouillon ouvert dans votre navigateur !")
|
||||
|
||||
if not args.step and idx < len(drafts) and not args.dry_run:
|
||||
print(f" Attente de {args.delay}s pour laisser Outlook enregistrer le brouillon...")
|
||||
time.sleep(args.delay)
|
||||
|
||||
print("\nTous les brouillons ont été traités.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue