From 2fa81f8281a10740047986284dedbdab38c8c345 Mon Sep 17 00:00:00 2001 From: Timothee 'TTimo' Besset <ttimo@ttimo.net> Date: Thu, 2 Nov 2023 19:53:25 -0500 Subject: [PATCH] rename locate_external_tool -> locate_cygwin_tool for clarity. we are specifically looking for the cygwin version of these (on windows at least). --- client/devkit_client/__init__.py | 12 ++++++------ client/devkit_client/gui2/gui2.py | 2 +- setup/package-windows.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/devkit_client/__init__.py b/client/devkit_client/__init__.py index eeab25f..42bdb1f 100644 --- a/client/devkit_client/__init__.py +++ b/client/devkit_client/__init__.py @@ -228,7 +228,7 @@ def get_remote_debuggers(): return g_remote_debuggers -def _locate_external_tool(name): +def _locate_cygwin_tool(name): assert sys.platform == 'win32' if getattr(sys, 'frozen', False): # Scripts that were frozen into a standalone executable via cx_freeze are expected to package the binaries @@ -262,7 +262,7 @@ def _locate_external_tool(name): return ret raise Exception('Required external tool not found: {!r}'.format(name)) -def locate_external_tools(): +def locate_cygwin_tools(): '''Returns a tuple of paths (cygpath, ssh, rsync, ssh_know_hosts)''' global g_external_tools if g_external_tools is not None: @@ -275,9 +275,9 @@ def locate_external_tools(): raise Exception(f'{tool} not found - please install.') return g_external_tools - cygpath = _locate_external_tool('cygpath.exe') - ssh = _locate_external_tool('ssh.exe') - rsync = _locate_external_tool('rsync.exe') + cygpath = _locate_cygwin_tool('cygpath.exe') + ssh = _locate_cygwin_tool('ssh.exe') + rsync = _locate_cygwin_tool('rsync.exe') USERPROFILE = os.getenv('USERPROFILE') if USERPROFILE is None: @@ -595,7 +595,7 @@ class DevkitClient(object): appdirs.user_config_dir('steamos-devkit'), 'devkit_rsa', ) - (self.cygpath, self.ssh, self.rsync, self.ssh_known_hosts) = locate_external_tools() + (self.cygpath, self.ssh, self.rsync, self.ssh_known_hosts) = locate_cygwin_tools() self.ssh_result = {} self.last_device_list_time = 0 self.rsync_process = None diff --git a/client/devkit_client/gui2/gui2.py b/client/devkit_client/gui2/gui2.py index 18c86bc..bcab326 100644 --- a/client/devkit_client/gui2/gui2.py +++ b/client/devkit_client/gui2/gui2.py @@ -1214,7 +1214,7 @@ class DevkitsWindow(ToolWindow): # === draw ========================================================================= if self.first_draw: try: - devkit_client.locate_external_tools() + devkit_client.locate_cygwin_tools() except Exception as e: failed_future = concurrent.futures.Future() failed_future.set_exception(e) diff --git a/setup/package-windows.py b/setup/package-windows.py index fac8c50..5e4e505 100644 --- a/setup/package-windows.py +++ b/setup/package-windows.py @@ -18,7 +18,7 @@ DIST_DIR = os.path.join(ROOT_DIR, 'dist') # cursed, but delicious sys.path.append(CLIENT_DIR) -from devkit_client import locate_external_tools +from devkit_client import locate_cygwin_tools sys.path.pop() # don't let python buffering get in the way or readable output @@ -64,7 +64,7 @@ if __name__ == '__main__': dir_path = os.path.join(CLIENT_DIR, name) shutil.copytree(dir_path, os.path.join(DIST_DIR, name), dirs_exist_ok=True) - cygroot = os.path.dirname(locate_external_tools()[0]) + cygroot = os.path.dirname(locate_cygwin_tools()[0]) assert os.path.isdir(cygroot) cygwin_dst_dir = os.path.join(DIST_DIR, 'cygroot/bin') os.makedirs(cygwin_dst_dir, exist_ok=True) -- GitLab