-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drive Backup 2.0 #6
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit refactors the code needed to interface with Drive Backup through a cli. A big part of this is adding in the rich library. This enables much nicer terminal styling, formatting, and progress tracking.
This replaces pync with my own swift macOS app, Drive Backup Notifications, for making notifications on macOS.
Sanitizes the file and directory names from items downloaded from Google Drive. Also, validate the backup name when a custom name is given. If the custom backup name is invalid, fail with a critical error.
This adds a workflow to build a Github Pages site on release and when initiated manually. For now, the items that will be included in the Pages build are each line item in 'github-pages-items.txt'.
This adds a macOS and Windows project to handle showing notifications. It seems the best way to show a notification for each OS is to do so natively (or close to it in the case of Windows). The macOS project is native swift done with Xcode and the Windows is in C++ done with Visual Studio. I ultimately felt it was easier to control how the notifications worked by doing it like this. Now Drive backup is using the most modern APIs to send notifications and can take advantage of this if it is useful. Since the notifications that are sent from Drive Backup are so simple, the code in each native app that handles this is also very very simple. I'm checking in the Xcode project for macOS into the project's repo because I am not interested, at this time, in trying to get the bundle built and signed with GitHub Actions. It seems a lot easier to do locally with Xcode. In the future I may revisit this, but for now, this will do. Building the Windows executable is simpler to handle with GitHub Actions so that I will setup.
Each time a backup is run this will store the config in a file. This file can also be included as a flag to future backups to set the config to match the previous backup. This also adds the option to provide a path to where the log file should be stored. The flags that dealt with 'logging_' had their names changed to start with 'log_' to make them shorter.
Originally I was thinking the notification would be just something done via the cli (and not a potential gui in the future). But since it seems to now be working so well, I think it would be appropriate to use regardless the interface. The other benefit in doing this is it makes it easy to show a notification on a failure as well.
This improves the handling of the client credential. Some of the code for this handling has been moved into it's own module and the parts that remain in 'drivebackup.py' now have improved error handling. This also adds the ability to specify the path to the credentials file in the config (it can be passed in as a command line argument).
The main change here is to move the credential handling code into its own module. On top of this there is also some other refactoring taking place and the notifications module was moved into core.
Rather than checking if we should potentially run the poetry plugins in the 'activate' function, check in the dispatched function. When 'poetry.pyproject' is queried, if the pyproject.toml doesn't exist, it exits, and does nothing. This will happen for *all* functions. Even for 'init' and 'new'. This is obviously problematic. By checking in the dispatched function, *after* we check if the corresponding command was run (i.e. build or install), we avoid this problem. We won't ever ask when functions are run where not having a pyproject.toml is okay. We only ask for build and install, where you already need the pyproject.toml.
The previous icon was denied by Google when I tried to get the OAuth verification for the app. This one, hopefully, will be acceptable.
Since I am not going to be able to have the app verified at this time, I added a lot of information around what that means so users can be well informed.
dunkmann00
temporarily deployed
to
github-pages
September 13, 2024 03:17
— with
GitHub Actions
Inactive
dunkmann00
temporarily deployed
to
github-pages
September 26, 2024 20:55
— with
GitHub Actions
Inactive
- It should be okay if the directory exists in the Application Support directory. - The notification authorization command was missing a hyphen.
dunkmann00
temporarily deployed
to
github-pages
September 27, 2024 02:26
— with
GitHub Actions
Inactive
dunkmann00
temporarily deployed
to
github-pages
September 27, 2024 19:40
— with
GitHub Actions
Inactive
I think this is all good, finally ready for a merge! 😄 |
dunkmann00
had a problem deploying
to
github-pages
September 27, 2024 20:40
— with
GitHub Actions
Error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are a bunch of changes I've been working on for 2.0. This should really improve all aspects of
Drive Backup
. I'll add a list of the noteworthy improvements in this PR's description.