The profile list in the main window is already sorted by name (alphabetically, case-sensitive). However the profile list in the *Backup Now* action found in the tray menu wasn't. This commit constructs the sql query to return the profiles in order.
* src/vorta/tray_menu.py
Our `DiffResultDialog` and `ExtractDialog` show a context menu for items of the list/tree view. The collapse action in this menu only makes sense for the tree mode of the view. This commit therefore enables the option only for this view mode.
* src/vorta/views/extract_dialog.py
* src/vorta/views/diff_result.py
* tests/unit/test_diff.py : Add tests for the new behaviour.
* tests/unit/test_extract.py
* Add developer name to appdata
Flathub is getting more and more strict when it comes to metadata.
I've added "Vorta developers" no, I can also be more specific if people prefer that.
* Update com.borgbase.Vorta.appdata.xml
* Add dependency for pyobjc-CoreWLAN on darwin
* Rename existing implementation with Android
The current implementation was tested with Android, but does not work
with iOS.
Move the existing implementation and include android in the name to make
room for adding a new iOS metered connection detection strategy.
* get_current_wifi works with objc
Switch from using command line tools to using the Objective-C Cocoa API
to get the Wi-Fi status information.
Cocoa has an API to specifically check whether a Wi-Fi connection is
using a Personal Hotspot on iOS.
I'm using a private method to get the Wi-Fi interface object in Cocoa.
The reason for this is that cleaning up mocks on PyObjC/ObjC objects is
much harder than mocking out methods on objects in our control. Using
test doubles also let's me check for different states the Wi-Fi network
could be in.
* get_known_wifis works on darwin
Use the networksetup command on macOS to get the list of the user's
Wi-Fi networks.
networksetup -listpreferredwirelessnetworks bsd_device
It looks like this command and option has existed on macOS since at
least 2013.
Also add some type annotations around the PyObjC return values to help
the reader know what they're dealing with at each step.
* Add test for get_current_wifi when wifi is off
The user might have Wi-Fi turned off. Account for that use case.
* Add iOS Personal Hotspot support to is_network_metered
The DarwinNetworkManager can now determine if the user is connected to
a Personal Hotspot Wi-Fi network from iOS.
Account for whether the user has Wi-Fi turned on and off.
* Refactor to avoid deprecated API in Cocoa
According to Apple's developer documentation, creating CWInterface
objects directly are discouraged. Instead, they prefer to use
CWInterface objects created by CWWiFiClient.
This also happens to be more compliant with Apple's application sandbox.
Creating CWInterface objects directly accesses raw BSD sockets which is
not allowed in the sandbox.
More details here:
https://developer.apple.com/documentation/corewlan/cwinterface
* Add test case for blank Wi-Fi network name
I have one of these in my list of networks in Vorta. And this also
covers a missing branch in get_known_wifis.
* Move private method below public methods
This is to provide a little more clarity. Especially since this class is
subclassing another one.
* Account for when there is no wifi interface
When a Mac does not have a Wi-Fi interface, CWWiFiClient.interface() can
return None.
Update the type annotation to mark it as Optional, and account for the
null condition in the other methods.
* Fix type annotation error
The CI tests failed on python 3.8.
I used the wrong type annotation to describe a list of SystemWifiInfo's.
The tests now pass for me when I run 'make test-unit' using a python 3.8
interpreter.
* Fix linter issue with imports
The appdata.xml doesn't pass validation of flathub
1. The `launchable` tag is nowadays required
2. Flatpak doesn't like the beta releases. In the end, it only made sense to remove them from the xml
* fix PEP8 E721
do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
* remove redundant parentheses
* fix SiteWorker.run for empty job queue
local variable job is not assigned if queue was empty
when calling .run(), but it is used in exception handler.
* remove unreachable code in parse_diff_lines
* bug fix for unreachable code in is_worker_running
the code intended to check if *any* worker is running for
any site was *unreachable*.
this caused false negative results for site=None.
* check_failed_response: remove outdated part of docstring
* pull request template: fix relative path to LICENSE.txt
* fix typos
* use logger.warning, .warn is deprecated
Fixes#1776. Now the indicator is red for unhealthy files.
* src/vorta/views/extract_dialog.py (ExtractTree.data): Set red instead of green colour for unhealthy files.
Move existing tests into subfolder `tests/unit`. Write integration tests that actually run the installed borg executable. Those tests can be found in `tests/integration`. Those pytest fixtures that are the same for both kinds of tests remain in `tests/conftest.py`. The others can be found in `tests/integration/conftest.py` or `tests/unit/conftest.py`. This adds nox to the project and configures it to run the tests with different borg versions. This also updates the ci workflow to run the integration tests using nox.
* noxfile.py : Run pytest with a matrix of borg versions OR a specific borg version
* Makefile : Run using nox. Add phonies `test-unit` and `test-integration`.
* tests/conftest.py : Move some fixtures/functions to `tests/unit/conftest.py`.
* tests/test_*.py --> tests/unit/ : Move unittests and assets into subfolder
* tests/integration/ : Write integration tests.
* requirements.d/dev.txt: Add `nox` and `pkgconfig`. The latter is needed for installing new borg versions.
* .github/actions/setup/action.yml : Update to install pre-commit and nox when needed. The action now no longer installs Vorta.
* .github/actions/install-dependencies/action.yml : Install system deps of borg with this new composite action.
* .github/workflows/test.yml : Rename `test` ci to `test-unit` and update it for the new test setup.
Implement `test-integration` ci.
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>