From d5c18820c2bae0656043ca127f4b05b756ea1479 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 14 May 2025 23:28:05 +0100 Subject: [PATCH 1/4] bump version to 4.6 --- README.md | 2 +- android-file-transfer-linux.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d290947e..0236fe67 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Android File Transfer For Linux (FreeBSD and macOS, too!) [![License](https://img.shields.io/:license-LGPLv2.1-blue.svg)](https://github.com/whoozle/android-file-transfer-linux/blob/master/LICENSE) -[![Version](https://img.shields.io/:version-4.5-green.svg)](https://github.com/whoozle/android-file-transfer-linux) +[![Version](https://img.shields.io/:version-4.6-green.svg)](https://github.com/whoozle/android-file-transfer-linux) [![Android File Transfer for Linux (and macOS!)](https://github.com/whoozle/android-file-transfer-linux/actions/workflows/actions.yml/badge.svg)](https://github.com/whoozle/android-file-transfer-linux/actions/workflows/actions.yml) Android File Transfer for Linux — a reliable [MTP](https://en.wikipedia.org/wiki/Media_Transfer_Protocol) client with minimalistic UI similar to [Android File Transfer](https://www.android.com/intl/en_us/filetransfer/). diff --git a/android-file-transfer-linux.json b/android-file-transfer-linux.json index af46e8bd..5c7d6db4 100644 --- a/android-file-transfer-linux.json +++ b/android-file-transfer-linux.json @@ -13,7 +13,7 @@ "config-opts": [ "-DCMAKE_BUILD_TYPE=Release" ], "sources": [{ "type": "git", - "tag": "v4.5", + "tag": "v4.6", "url": "https://github.com/whoozle/android-file-transfer-linux.git" }] } From e588ed7a5277451ac4135d4712a36fb898076248 Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Mon, 13 Oct 2025 15:52:26 -0700 Subject: [PATCH 2/4] Use InquirerPy instead. **Problem** PyInquirer has no longer maintained and not working with recent python. **Solution** Use InquirerPy instead. --- python/example/menu.py | 4 ++-- python/example/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/example/menu.py b/python/example/menu.py index b13ed43b..8aa0c3ab 100755 --- a/python/example/menu.py +++ b/python/example/menu.py @@ -5,7 +5,7 @@ hierarchical prompt usage example """ from __future__ import print_function, unicode_literals -from PyInquirer import style_from_dict, Token, prompt, Separator +from InquirerPy import prompt, separator import aftl @@ -52,7 +52,7 @@ def get_object_action(session): 'message': 'Object Action (press h for help)', 'choices': [ { 'key': 'b', 'name': 'Back', 'value': 'back' }, - Separator(), + separator.Separator(), { 'key': 'd', 'name': 'Download', 'value': 'download' }, ] } diff --git a/python/example/requirements.txt b/python/example/requirements.txt index 04ef61f8..b02ee910 100644 --- a/python/example/requirements.txt +++ b/python/example/requirements.txt @@ -1 +1 @@ -pyinquirer +InquirerPy ~= 0.3.4 From 474e72a8b133313a9851e71cf95c79795ef751bc Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Mon, 13 Oct 2025 16:06:21 -0700 Subject: [PATCH 3/4] Add `pyproject.toml` to create Python package. **Problem** Since the repository doesn't have packaging configuration for Python but only for binding, it is not easy to use Python binding. **Solution** Add a Python packaging installation in CMake and minimum `pyproject.toml` file for packaging by using scikit-build-core. With these changes, users can install and use Python binding by simply using regular python package manager such as `pip` or `uv`. --- pyproject.toml | 17 +++++++++++++++++ python/CMakeLists.txt | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9d886987 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "android-file-transfer-linux" +version = "4.6" + +[build-system] +requires = ["scikit-build-core", "pybind11"] +build-backend = "scikit_build_core.build" + +[tool.scikit-build] +build.targets = ["aftl"] +install.components = ["aftl"] +# Rely only on CMake install. +wheel.packages = [] + +[tool.scikit-build.cmake.define] +BUILD_FUSE = false +BUILD_QT_UI = false diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index aac7adcf..ba384369 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -4,3 +4,7 @@ include(pybind11Tools) pybind11_add_module(aftl aftl.cpp) target_link_libraries(aftl PRIVATE ${LIB_NAME}) +# Use destination `.` to place `.so` file in `site-packages`, then it can be `import aftl`. +# Set component to only install this target `.so` file. +# See `pyproject.toml`. +install(TARGETS aftl DESTINATION . COMPONENT aftl) From eeff31a0888a18e9daa121a002f80c36e55f49a5 Mon Sep 17 00:00:00 2001 From: Vekhir <134215107+Vekhir@users.noreply.github.com> Date: Mon, 13 Oct 2025 15:23:47 +0200 Subject: [PATCH 4/4] fix: Avoid double counting files and folders (#287) Adding the directory to the files list is used to recurse into the subdirectories. The iterator flag QDirIterator::Subdirectories already does that automatically, so we only need to create the directory, not recurse into it. --- qt/fileuploader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/qt/fileuploader.cpp b/qt/fileuploader.cpp index 2ebce27d..47308be8 100644 --- a/qt/fileuploader.cpp +++ b/qt/fileuploader.cpp @@ -119,7 +119,6 @@ void FileUploader::upload(QStringList files, mtp::ObjectFormat format) else if (fi.isDir()) { commands.push_back(new MakeDirectory(next)); - files.push_back(next); } } }