From 23afc8006b7aa3b6acfdaf9efcaffdb886bfaf92 Mon Sep 17 00:00:00 2001 From: ButenkoMS Date: Mon, 1 Apr 2024 17:02:01 +0300 Subject: [PATCH] GA --- .../workflows/test_app_dir_path_finder.yaml | 28 ++++++++----------- .../v_0/development/print_app_dirs.py | 9 +++--- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test_app_dir_path_finder.yaml b/.github/workflows/test_app_dir_path_finder.yaml index 7d5f65773..c88b52980 100644 --- a/.github/workflows/test_app_dir_path_finder.yaml +++ b/.github/workflows/test_app_dir_path_finder.yaml @@ -226,30 +226,24 @@ jobs: steps: - uses: actions/checkout@v4 - - # Prepare the Docker container without starting it - - name: Create Docker container + + # Create Docker container with a command that keeps it running + - name: Create and start Docker container id: create-container run: | - CONTAINER_ID=$(docker create -w /github/workspace --entrypoint /bin/bash ${{ matrix.image }}) + CONTAINER_ID=$(docker create -it -w /github/workspace ${{ matrix.image }} /bin/bash -c "tail -f /dev/null") + docker start $CONTAINER_ID echo "::set-output name=id::$CONTAINER_ID" - shell: bash - # Copy the checked-out repository into the Docker container + # Copy workspace to the running container - name: Copy workspace to container - run: | - docker cp . ${{ steps.create-container.outputs.id }}:/github/workspace - - # Start the container and keep it running so subsequent commands can execute within it - - name: Start container - run: | - docker start ${{ steps.create-container.outputs.id }} - - # Execute commands within the Docker container + run: docker cp . ${{ steps.create-container.outputs.id }}:/github/workspace + + # Proceed with setting up Python and other steps within the container - name: Set up Python in the Docker container run: | - docker exec ${{ steps.create-container.outputs.id }} yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip - docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade pip setuptools wheel + docker exec ${{ steps.create-container.outputs.id }} yum install -y python3.8 python3.8-pip + docker exec ${{ steps.create-container.outputs.id }} python3.8 -m pip install --upgrade pip setuptools wheel # Continue with your setup and test execution steps - name: Install basic Python dependencies in the Docker container diff --git a/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py b/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py index a66432625..c7523c42e 100644 --- a/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py +++ b/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py @@ -70,6 +70,7 @@ def main(): from cengal.ctypes_tools.types import GUID from cengal.ctypes_tools.constants import KnownfolderidConstants, S_OK from cengal.ctypes_tools.function_prototypes import SHGetKnownFolderPath as proto_SHGetKnownFolderPath, CoTaskMemFree + from cengal.ctypes_tools.constants import KnownfolderidConstants from cengal.file_system.directory_manager import ensure_dir as ensure_dir_exists from cengal.ctypes_tools.tools import cwfunc_def from typing import Union, Sequence, Any @@ -91,11 +92,10 @@ def main(): HRESULT ) - def get_known_folder_path(folder_id): + def get_known_folder_path(dir_guid): # Convert string representation of the GUID to a GUID object - folder_id_guid = UUID(folder_id).bytes_le path_ptr = POINTER(c_wchar_p)() - hresult = SHGetKnownFolderPath(byref(GUID(folder_id_guid)), 0, None, byref(path_ptr)) + hresult = SHGetKnownFolderPath(byref(dir_guid), 0, None, byref(path_ptr)) if hresult != 0: raise WinError(hresult) try: @@ -108,8 +108,7 @@ def get_known_folder_path(folder_id): # Example usage # Use the GUID for the folder you're interested in, for example, the Documents folder - folder_id = 'FDD39AD0-238F-46AF-ADB4-6C85480369C7' - path = get_known_folder_path(folder_id) + path = get_known_folder_path(KnownfolderidConstants.FOLDERID_Documents) print(f'Path: {path}') else: from cengal.file_system.app_fs_structure.app_dir_path import AppDirectoryType, AppDirPath