Skip to content

Commit

Permalink
#1253: improve error message when the client or server components are…
Browse files Browse the repository at this point in the history
…n't installed

git-svn-id: https://xpra.org/svn/Xpra/trunk@15333 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 19, 2017
1 parent ccc2c4a commit 2c3c2c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,12 @@ def run_mode(script_file, error_cb, options, args, mode, defaults):
elif (mode in ("start", "start-desktop", "upgrade") and supports_server) or \
(mode=="shadow" and supports_shadow) or (mode=="proxy" and supports_proxy):
current_display = nox()
from xpra.scripts.server import run_server
try:
from xpra import server
assert server
from xpra.scripts.server import run_server
except ImportError as e:
error_cb("Xpra server is not installed")
return run_server(error_cb, options, mode, script_file, args, current_display)
elif mode in ("attach", "detach", "screenshot", "version", "info", "control", "_monitor", "print", "connect-test"):
return run_client(error_cb, options, args, mode)
Expand Down Expand Up @@ -1996,6 +2001,12 @@ def run_client(error_cb, opts, extra_args, mode):
screenshot_filename = extra_args[0]
extra_args = extra_args[1:]

try:
from xpra import client
assert client
except ImportError as e:
error_cb("Xpra client is not installed")

if opts.compression_level < 0 or opts.compression_level > 9:
error_cb("Compression level must be between 0 and 9 inclusive.")
if opts.quality!=-1 and (opts.quality < 0 or opts.quality > 100):
Expand Down

0 comments on commit 2c3c2c6

Please sign in to comment.