Skip to content

Commit

Permalink
#1761: split command line parsing code to its own module
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@18498 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 20, 2018
1 parent 53ba78a commit 016928b
Show file tree
Hide file tree
Showing 10 changed files with 1,215 additions and 1,189 deletions.
2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ def osx_pkgconfig(*pkgs_options, **ekw):
add_modules("xpra.codecs")
toggle_packages(client_ENABLED or server_ENABLED, "xpra.keyboard")
if client_ENABLED or server_ENABLED:
add_modules("xpra.scripts.config", "xpra.scripts.exec_util", "xpra.scripts.fdproxy", "xpra.scripts.version")
add_modules("xpra.scripts.config", "xpra.scripts.parsing", "xpra.scripts.exec_util", "xpra.scripts.fdproxy", "xpra.scripts.version")
if server_ENABLED or proxy_ENABLED:
add_modules("xpra.scripts.server")
if WIN32 and client_ENABLED and (gtk2_ENABLED or gtk3_ENABLED):
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/audio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from xpra.gtk_common.gobject_compat import import_glib
from xpra.platform.paths import get_icon_filename
from xpra.scripts.main import sound_option
from xpra.scripts.parsing import sound_option
from xpra.net.compression import Compressed
from xpra.os_util import get_machine_id, get_user_uuid, bytestostr, OSX, POSIX
from xpra.util import envint, typedict, csv
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/client/gtk_base/client_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def destroy(self, *args):
gtk.main_quit()

def update_options_from_URL(self, url):
from xpra.scripts.main import parse_URL
from xpra.scripts.parsing import parse_URL
address, props = parse_URL(url)
pa = address.split(":")
if pa[0] in ("tcp", "ssh") and len(pa)>=2:
Expand Down Expand Up @@ -906,7 +906,7 @@ def do_main():
from xpra.platform.gui import ready as gui_ready
gui_init()
try:
from xpra.scripts.main import parse_cmdline, fixup_debug_option
from xpra.scripts.parsing import parse_cmdline, fixup_debug_option
options, args = parse_cmdline(sys.argv)
debug = fixup_debug_option(options.debug)
if debug:
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
get_native_tray_menu_helper_class, get_xdpi, get_ydpi, get_number_of_desktops, get_desktop_names, get_wm_name, ClientExtras)
from xpra.codecs.loader import load_codecs, codec_versions, has_codec, get_codec, PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS
from xpra.codecs.video_helper import getVideoHelper, NO_GFX_CSC_OPTIONS
from xpra.scripts.main import full_version_str
from xpra.version_util import full_version_str
from xpra.scripts.config import parse_bool_or_int, parse_bool, FALSE_OPTIONS, TRUE_OPTIONS
from xpra.simple_stats import std_unit
from xpra.net import compression, packet_encoding
Expand Down
1,188 changes: 7 additions & 1,181 deletions src/xpra/scripts/main.py

Large diffs are not rendered by default.

1,188 changes: 1,188 additions & 0 deletions src/xpra/scripts/parsing.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/xpra/server/proxy/proxy_instance_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from xpra.version_util import XPRA_VERSION
from xpra.make_thread import start_thread
from xpra.scripts.config import parse_number, parse_bool
from xpra.scripts.main import full_version_str
from xpra.version_util import full_version_str
from xpra.server.socket_util import create_unix_domain_socket
from xpra.platform.dotxpra import DotXpra
from xpra.net.bytestreams import SocketConnection, SOCKET_TIMEOUT
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
from xpra.platform.paths import get_icon_filename, get_icon_dir
from xpra.notifications.common import parse_image_path, XPRA_IDLE_NOTIFICATION_ID
from xpra.child_reaper import reaper_cleanup
from xpra.scripts.parsing import sound_option, parse_env
from xpra.scripts.config import parse_bool_or_int, parse_bool, FALSE_OPTIONS, TRUE_OPTIONS
from xpra.scripts.main import sound_option, parse_env
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, load_codecs, codec_versions, get_codec, has_codec
from xpra.codecs.video_helper import getVideoHelper, ALL_VIDEO_ENCODER_OPTIONS, ALL_CSC_MODULE_OPTIONS
from xpra.net.file_transfer import FileTransferAttributes
Expand Down
3 changes: 2 additions & 1 deletion src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
dbuslog = Logger("dbus")

from xpra.version_util import XPRA_VERSION
from xpra.scripts.main import _socket_connect, full_version_str
from xpra.version_util import full_version_str
from xpra.scripts.main import _socket_connect
from xpra.scripts.server import deadly_signal
from xpra.scripts.config import InitException, parse_bool, python_platform, parse_with_unit, FALSE_OPTIONS
from xpra.net.bytestreams import SocketConnection, SSLSocketConnection, log_new_connection, pretty_socket, SOCKET_TIMEOUT
Expand Down
11 changes: 11 additions & 0 deletions src/xpra/version_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@

XPRA_VERSION = xpra.__version__ #@UndefinedVariable


def full_version_str():
s = XPRA_VERSION
try:
from xpra.src_info import REVISION, LOCAL_MODIFICATIONS
s += "-r%i%s" % (REVISION, ["","M"][int(LOCAL_MODIFICATIONS>0)])
except:
pass
return s


def version_as_numbers(version):
return [int(x) for x in version.split(".")]

Expand Down

0 comments on commit 016928b

Please sign in to comment.