add a couple more helpers

This commit is contained in:
Jean-Paul Calderone 2019-03-18 16:35:35 -04:00
parent a44c5d0f11
commit 9bc00c4f76

View File

@ -329,3 +329,19 @@ def await_file_vanishes(path, timeout=10):
return
time.sleep(1)
raise FileShouldVanishException(path, timeout)
def cli(reactor, node_dir, *argv):
proto = _CollectOutputProtocol()
reactor.spawnProcess(
proto,
sys.executable,
[
sys.executable, '-m', 'allmydata.scripts.runner',
'--node-directory', node_dir,
] + list(argv),
)
return proto.done
def magic_folder_cli(reactor, node_dir, *argv):
return cli(reactor, node_dir, "magic-folder", *argv)