Skip to content

Commit

Permalink
simplify: always use progress(), call it from check_xvfb automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 25, 2021
1 parent 6bf3105 commit 075e0e4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,6 @@ def show_progress(pct, text=""):
else:
def noprogressshown(*_args):
""" messages aren't shown """
def stop_progress_process():
""" nothing to stop """
progress = noprogressshown

progress(10, "initializing environment")
Expand Down Expand Up @@ -1136,12 +1134,14 @@ def xvfb_terminated():
def check_xvfb(timeout=0):
if xvfb is None:
return True
return check_xvfb_process(xvfb, timeout=timeout, command=opts.xvfb)
if not check_xvfb_process(xvfb, timeout=timeout, command=opts.xvfb):
progress(100, "xvfb failed")
return False
return True

write_displayfd(display_name, displayfd)

if not check_xvfb(1):
stop_progress_process()
noerr(stderr.write, "vfb failed to start, exiting\n")
return EXIT_VFB_ERROR

Expand Down Expand Up @@ -1175,7 +1175,6 @@ def check_xvfb(timeout=0):
del stderr

if not check_xvfb():
stop_progress_process()
noerr(stderr.write, "vfb failed to start, exiting\n")
return EXIT_VFB_ERROR

Expand Down Expand Up @@ -1264,7 +1263,6 @@ def init_local_sockets():

if not proxying and POSIX and not OSX:
if not check_xvfb():
stop_progress_process()
return 1
from xpra.x11.gtk_x11.gdk_display_source import init_gdk_display_source
if os.environ.get("NO_AT_BRIDGE") is None:
Expand Down Expand Up @@ -1314,7 +1312,7 @@ def server_not_started(msg="server not started"):
app.display_name = display_name
app.init(opts)
if not app.validate():
stop_progress_process()
progress(100, "server validation failed")
return 1
init_local_sockets()
app.init_sockets(sockets)
Expand Down

0 comments on commit 075e0e4

Please sign in to comment.