diff --git a/src/xpra/scripts/main.py b/src/xpra/scripts/main.py index d67b4d4399..5fbfb96b9d 100755 --- a/src/xpra/scripts/main.py +++ b/src/xpra/scripts/main.py @@ -1426,14 +1426,17 @@ def connect(): except RuntimeError as e: #exceptions at this point are still initialization exceptions raise InitException(e.message) + ehelp = "help" in opts.encodings + if ehelp: + from xpra.codecs.loader import PREFERED_ENCODING_ORDER + opts.encodings = PREFERED_ENCODING_ORDER app.init(opts) - if opts.encoding: - #fix old encoding names if needed: - err = opts.encoding not in app.get_encodings() + if opts.encoding or ehelp: + err = opts.encoding and (opts.encoding not in app.get_encodings()) info = "" if err and opts.encoding!="help": info = "invalid encoding: %s\n" % opts.encoding - if opts.encoding=="help" or err: + if opts.encoding=="help" or ehelp or err: from xpra.codecs.loader import encodings_help raise InitInfo(info+"%s xpra client supports the following encodings:\n * %s" % (app.client_toolkit(), "\n * ".join(encodings_help(app.get_encodings())))) def handshake_complete(*args): diff --git a/src/xpra/scripts/server.py b/src/xpra/scripts/server.py index eb7e899da7..b6cb7e3b8c 100644 --- a/src/xpra/scripts/server.py +++ b/src/xpra/scripts/server.py @@ -881,7 +881,7 @@ def run_server(error_cb, opts, mode, xpra_file, extra_args, desktop_display=None if opts.password_file and not (opts.auth or opts.tcp_auth): raise InitException("when specifying a password-file, you must use auth or tcp-auth") validate_encryption(opts) - if opts.encoding and opts.encoding=="help": + if opts.encoding=="help" or "help" in opts.encodings: #avoid errors and warnings: opts.encoding = "" opts.clipboard = False @@ -898,13 +898,14 @@ def run_server(error_cb, opts, mode, xpra_file, extra_args, desktop_display=None from xpra.server.server_base import ServerBase sb = ServerBase() sb.init_options(opts) - #ensures that the threaded video helper init has completed - #(by running it again, which will block on the init lock) + from xpra.codecs.loader import PREFERED_ENCODING_ORDER, HELP_ORDER + if "help" in opts.encodings: + sb.allowed_encodings = PREFERED_ENCODING_ORDER from xpra.codecs.video_helper import getVideoHelper getVideoHelper().init() sb.init_encodings() from xpra.codecs.loader import encoding_help - for e in sb.encodings: + for e in (x for x in HELP_ORDER if x in sb.encodings): print(" * %s" % encoding_help(e)) return 0