-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add --replace-all
option for development
#751
base: master
Are you sure you want to change the base?
Add --replace-all
option for development
#751
Commits on Dec 27, 2023
-
Fix quit dbus action for the GUI
This action was registered, but did not work because the handler accepted too few arguments and also called itself recursively. This fixes both, calling the 'quit' action (as exposed through dbus by gtk automatically) now actually quits the GUI.
Configuration menu - View commit details
-
Copy full SHA for e58e609 - Browse repository at this point
Copy the full SHA e58e609View commit details -
hamster-cli: Flatten commandline handling flow
This simplifies the flow a bit by putting the handling of "add" with arguments at the same level of all other application actions instead of below it, needing one fewer level of indentation. Behavior should be fully unchanged. Diff best viewed while ignoring whitespace changes.
Configuration menu - View commit details
-
Copy full SHA for 76bed1d - Browse repository at this point
Copy the full SHA 76bed1dView commit details -
Print "hamster-service up" later and use logger
This logs the message after the storage class was actually instantiated and registered on the bus, rather than before.
Configuration menu - View commit details
-
Copy full SHA for 4e78ca6 - Browse repository at this point
Copy the full SHA 4e78ca6View commit details -
hamster-windows-service: Use logger
This converts the single print in this script to use a logger instance (like hamster-service already uses).
Configuration menu - View commit details
-
Copy full SHA for 3a5aacf - Browse repository at this point
Copy the full SHA 3a5aacfView commit details -
Fix dbus name claiming race condition
This refactors the way that dbus names are claimed for hamster-service and hamster-window-service. Instead of checking if the name is already claimed beforehand, this tries to claim the and checks the result. This fixes a minor race condition when a service is started twice at the same time. Before, the name would appear to be free when it was checked, but when the script proceeded to actually claim the name, it could have been claimed by another instance already. Because do_not_queue was not yet used, this means that the claim would probably not even fail, but leave a pointless process running. This commit refactors the code structure to introduce a claim_bus_name helper, which claims the name with do_not_queue=True so it either fails when the name is already taken, or is sure the name is claimed. This also raises the bus claiming code out of the Storage and WindowServer classes into the main script, since that is a better place to decide to abort startup and log messages about this. This refactoring also prepares for implementing a `--replace` option in a subsequent commit.
Configuration menu - View commit details
-
Copy full SHA for 0fbd1ad - Browse repository at this point
Copy the full SHA 0fbd1adView commit details -
Implement --replace option for all three binaries
This makes them replace any currently running GUI, storage service or windows service. This is primarily useful during development, to prevent having to kill these services manually. For the two services, this is implemented properly by trying to claim the bus name and if it is taken, calling the quit method on the current instance while the existing claim is kept in the dbus request queue. This ensures that as soon as the name is released, it is claimed again by the new process (preventing a race condition where a service autostart could occur in between). For the GUI, this race condition is not prevented due to the way Gtk/Gio.Application claims its name, but this should be minor enough an issue to not be problematic (especially since the user can always easily quit the GUI manually beforehand). This commit implements most of projecthamster#746.
Configuration menu - View commit details
-
Copy full SHA for 3a22d3b - Browse repository at this point
Copy the full SHA 3a22d3bView commit details -
Remove .py extension from main scripts
This makes the filenames equal to the name they get when installed, which is more consistent and makes it easier to call them programmatically (this prepares for implementing `--replace-all` in subsequent commit). The .py extension was added in commit 774c315 (give .py extension to hamster-*), on account of letting xgettext understand these are python files. Currently, there is no working (or at least not documented) xgettext flow anyway, and xgettext seems to support passing an explicit language parameter, so this can probably be used, removing the need for these explicit extensions.
Configuration menu - View commit details
-
Copy full SHA for fca47a2 - Browse repository at this point
Copy the full SHA fca47a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for eee3c1c - Browse repository at this point
Copy the full SHA eee3c1cView commit details -
Revert "Remove .py extension from main scripts"
This reverts commit 767f80a22593757aec10b3f6ab3a4ef3ab8a0809.
Configuration menu - View commit details
-
Copy full SHA for db55ab6 - Browse repository at this point
Copy the full SHA db55ab6View commit details -
Detach/daemonize service processes
This lets the service commands (hamster-service and hamster-windows-service) daemonize after initialization. This ensures they are detached from their parent process, and allows a caller to wait for them to return to know whether startup succeeded or not.
Configuration menu - View commit details
-
Copy full SHA for e5ba311 - Browse repository at this point
Copy the full SHA e5ba311View commit details -
Implement --replace-all option
This replaces the GUI and two background services (by using the recently added `--replace` options). This is helpful during development to easily replace the existing deamons (even when installed system-wide) with a development version, without having to resort to fragile pkill commands. This also updates the README to recommend using this option instead of kill commands. This also removes a note about not calling windows via dbus, since that does not seem to be true with the current codebase. This fixes projecthamster#746
Configuration menu - View commit details
-
Copy full SHA for 4109d79 - Browse repository at this point
Copy the full SHA 4109d79View commit details