Commit 2e1b87a9 authored by Boris Kocherov's avatar Boris Kocherov

speedup starting

parent 309a413b
......@@ -134,6 +134,14 @@ class OpenOffice(Application):
self.connection = "socket,host=%s,port=%d" % (self.hostname, self.port)
self.connection = "pipe,name=cloudooo_libreoffice_%s" % str(uuid.uuid1())
def isRunning(self):
if hasattr(self, "process"):
returncode = self.process.poll()
if returncode is not None and returncode != 0:
return False
return True
return False
def status(self):
if Application.status(self) and \
self._testOpenOffice():
......
......@@ -45,10 +45,10 @@ def removeDirectory(path):
def waitStartDaemon(daemon, attempts):
"""Wait a certain time to start the daemon."""
for num in range(attempts):
if daemon.status():
return True
elif daemon.pid() is None:
if not daemon.isRunning():
return False
elif daemon.status():
return True
sleep(1)
return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment