From 998ea17d541bcf673dabfc60a196959f72b459bb Mon Sep 17 00:00:00 2001 From: furkankalkan Date: Tue, 4 Feb 2025 10:25:17 +0300 Subject: [PATCH 1/3] fix: search fix --- finch/widgets/search.py | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/finch/widgets/search.py b/finch/widgets/search.py index 6702357..203c600 100644 --- a/finch/widgets/search.py +++ b/finch/widgets/search.py @@ -104,26 +104,37 @@ def _build_tree_structure(self, objects): tree = {} for path, size, date in objects: current = tree - *folders, filename = path.split('/') - for folder in folders: - current = current.setdefault(folder, {}) - current[filename] = {"_info": (size, date)} + parts = path.split('/') + + # Handle the case where path ends with '/' (folder) + if path.endswith('/'): + folders = parts[:-1] # Last element is empty for folders ending in '/' + for folder in folders: + current = current.setdefault(folder, {}) + else: + *folders, filename = parts + # Add all intermediate folders + for folder in folders: + current = current.setdefault(folder, {}) + # Add file with its metadata + current[filename] = {"_info": (size, date)} return tree def _add_items_to_tree(self, parent_item, tree_dict): """Recursively add items to the tree widget.""" - for key, value in tree_dict.items(): - if key == "_info": - continue - - item = self._create_tree_item(name=key, object_type=ObjectType.FOLDER) - parent_item.addChild(item) - - if "_info" in value: + # First add all folders + for key, value in sorted(tree_dict.items()): + if key != "_info" and not "_info" in value: + item = self._create_tree_item(name=key, object_type=ObjectType.FOLDER) + parent_item.addChild(item) + self._add_items_to_tree(item, value) + + # Then add all files + for key, value in sorted(tree_dict.items()): + if key != "_info" and "_info" in value: size, date = value["_info"] item = self._create_tree_item(name=key, object_type=ObjectType.FILE, size=size, date=date) - - self._add_items_to_tree(item, value) + parent_item.addChild(item) def _expand_and_select(self, item, search_term): """Recursively expand and select matching items.""" From 5334ef7a410742e134744ed5d48cacdd02f72ec7 Mon Sep 17 00:00:00 2001 From: furkankalkan Date: Tue, 4 Feb 2025 10:26:11 +0300 Subject: [PATCH 2/3] fix: about screen version text changed alpha to beta --- finch/about.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finch/about.py b/finch/about.py index b24da6b..be2be59 100644 --- a/finch/about.py +++ b/finch/about.py @@ -27,7 +27,7 @@ def __init__(self): subtitle_font = QFont('sans', 12) subtitle_font.setItalic(True) subtitle_label.setFont(subtitle_font) - version_label = QLabel('v1.0 ALPHA') + version_label = QLabel('v1.0 BETA') version_label.setFont(subtitle_font) contributors_label = QLabel("Contributors:") contributors_label.setContentsMargins(0, 10, 0, 0) From fa099edb7175bd4123b48a66f5d94105ba124ddb Mon Sep 17 00:00:00 2001 From: furkankalkan Date: Tue, 4 Feb 2025 10:31:37 +0300 Subject: [PATCH 3/3] feat: add flatpak support --- .github/workflows/create_release.yml | 33 +++++++++- flatpak/com.furkankalkan.FinchS3.yml | 66 +++++++++++++++++++ .../files/com.furkankalkan.FinchS3.desktop | 9 +++ .../com.furkankalkan.FinchS3.metainfo.xml | 33 ++++++++++ 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 flatpak/com.furkankalkan.FinchS3.yml create mode 100644 flatpak/files/com.furkankalkan.FinchS3.desktop create mode 100644 flatpak/files/com.furkankalkan.FinchS3.metainfo.xml diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 0c9a049..26d6899 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -211,10 +211,35 @@ jobs: name: linux-artifact path: dist/linux/finch-${{ env.VERSION }}-linux-all.deb + build-flatpak: + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 + options: --privileged + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Flatpak environment + run: | + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install -y org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 + - name: Build Flatpak bundle + run: | + flatpak-builder --repo=repo --force-clean build-dir flatpak/com.furkankalkan.FinchS3.yml + flatpak build-bundle repo finch-${{ env.VERSION }}-linux-x86_64.flatpak com.furkankalkan.FinchS3 + + - name: Upload Flatpak Artifact + uses: actions/upload-artifact@v4 + with: + name: flatpak-artifact + path: finch-${{ env.VERSION }}-linux-x86_64.flatpak release: - needs: [build-macos-arm, build-macos-intel, build-windows, build-linux] + needs: [build-macos-arm, build-macos-intel, build-windows, build-linux, build-flatpak] runs-on: ubuntu-latest steps: - name: Download MacOS Apple Silicon Artifact @@ -237,6 +262,11 @@ jobs: with: name: linux-artifact + - name: Download Flatpak Artifact + uses: actions/download-artifact@v4 + with: + name: flatpak-artifact + - name: Create Release uses: ncipollo/release-action@v1 with: @@ -249,3 +279,4 @@ jobs: finch-${{ env.VERSION }}-macos-x86_64.dmg finch-${{ env.VERSION }}-windows-x86_64.msi finch-${{ env.VERSION }}-linux-all.deb + finch-${{ env.VERSION }}-linux-x86_64.flatpak diff --git a/flatpak/com.furkankalkan.FinchS3.yml b/flatpak/com.furkankalkan.FinchS3.yml new file mode 100644 index 0000000..b37448c --- /dev/null +++ b/flatpak/com.furkankalkan.FinchS3.yml @@ -0,0 +1,66 @@ +app-id: com.furkankalkan.FinchS3 +runtime: org.freedesktop.Platform +runtime-version: '23.08' +sdk: org.freedesktop.Sdk +command: finch +finish-args: + - --share=network + - --share=ipc + - --socket=x11 + - --socket=wayland + - --filesystem=home + # For keyring access + - --talk-name=org.freedesktop.secrets + - --filesystem=xdg-config/finch:create + +build-options: + build-args: + - --share=network + +modules: + - name: python3-pip + buildsystem: simple + build-commands: + - python3 -m ensurepip + - pip3 install --upgrade pip + cleanup: + - /lib/python*/site-packages/pip + - /lib/python*/site-packages/setuptools + + - name: python3-boto3-slim + buildsystem: simple + build-commands: + # Install boto3 and dependencies + - pip3 install --prefix=/app boto3==1.35.5 + # Find botocore version and trim it + - | + BOTOCORE_PATH=$(python3 -c "import botocore; print(botocore.__path__[0])") + cd $BOTOCORE_PATH/data + for dir in *; do + if [[ ! "$dir" =~ ^s3.* ]]; then + rm -rf "$dir" + fi + done + + - name: python3-requirements + buildsystem: simple + build-commands: + - pip3 install --prefix=/app --no-cache-dir PyQt5==5.15.11 keyring==25.3.0 python-slugify==8.0.4 + + - name: finch + buildsystem: simple + build-commands: + # Copy project files to a known location + - cp -r /run/build/finch/project /app/ + # Install the package + - pip3 install --prefix=/app --no-deps /app/project + # Install application files + - install -Dm644 /app/project/icon.png /app/share/icons/hicolor/256x256/apps/com.furkankalkan.FinchS3.png + - install -Dm644 /app/project/flatpak/files/com.furkankalkan.FinchS3.desktop /app/share/applications/com.furkankalkan.FinchS3.desktop + - install -Dm644 /app/project/flatpak/files/com.furkankalkan.FinchS3.metainfo.xml /app/share/metainfo/com.furkankalkan.FinchS3.metainfo.xml + # Cleanup + - rm -rf /app/project + sources: + - type: dir + path: .. + dest: project \ No newline at end of file diff --git a/flatpak/files/com.furkankalkan.FinchS3.desktop b/flatpak/files/com.furkankalkan.FinchS3.desktop new file mode 100644 index 0000000..cc14bdc --- /dev/null +++ b/flatpak/files/com.furkankalkan.FinchS3.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Finch S3 Client +Comment=Open source and cross-platform GUI client for Amazon S3 +Exec=finch +Icon=com.furkankalkan.FinchS3 +Terminal=false +Type=Application +Categories=Network;FileTransfer; +Keywords=s3;aws;storage;cloud; \ No newline at end of file diff --git a/flatpak/files/com.furkankalkan.FinchS3.metainfo.xml b/flatpak/files/com.furkankalkan.FinchS3.metainfo.xml new file mode 100644 index 0000000..f38fbd9 --- /dev/null +++ b/flatpak/files/com.furkankalkan.FinchS3.metainfo.xml @@ -0,0 +1,33 @@ + + + com.furkankalkan.FinchS3 + MIT + MIT + Finch S3 Client + GUI client for Amazon S3 and compatible storage platforms + +

+ Open source and cross-platform GUI client for Amazon S3 and compatible storage platforms. +

+

Features:

+
    +
  • Support for multiple credential through access & secret keys
  • +
  • Use cross-platform secure secret key storage
  • +
  • Browse and manage your S3 buckets and objects in file tree
  • +
  • Delete folders and buckets recursively
  • +
  • Upload and download files
  • +
  • Searching buckets & objects
  • +
+
+ + + https://raw.githubusercontent.com/mantis-software-company/finch/main/img.png + + + https://github.com/mantis-software-company/finch + Furkan Kalkan + + + + +
\ No newline at end of file