[SOLVED] Synchronous call to insync-headless

Hi
I’m using python script to set and configure my insync account.
with
check_call([‘insync-headless’, ‘start’], stdin=PIPE, stdout=PIPE, stderr=PIPE)
time.sleep(2)
p = Popen([‘insync-headless’, ‘get_status’], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"")
http://pastebin.com/mEhauebi
Problem is that first command is executed and completed, but second one returns status ‘not started’. After repeating it for 10 more times with sleep(0.1) I succeed to receive UNLINKED state in output.
How can call insync-headless command in synchronous mode? Or use some kind of callback to receive confirmation that executions is completed.

Provided solution with waiting loop shoud be enough.
PS: Somewhere in the depths of NET I found information about ‘no-daemon’ flag. But I was unable to use it. And help is silent about it.

Hi @T4ng10r I will tag our engineer @lpugoy in this and he will look into this.

@T4ng10r: The --no-daemon flag prevents Insync from daemonizing, keeping it running on the terminal. You can also call man insync to get more details on other Insync commands.