-
Notifications
You must be signed in to change notification settings - Fork 219
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
refactor!: Demonstrator: New config management class (and some more stuff) #1850
Draft
buhtz
wants to merge
65
commits into
bit-team:dev
Choose a base branch
from
buhtz:konfig
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
buhtz
added
Discussion
decision or consensus needed
PR: Waiting for review
PR won't be merged until review and approval from a member of the maintenance team.
labels
Aug 24, 2024
daviewales
reviewed
Aug 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @buhtz, I've had a look over this.
I don't have any big suggestions, but I commented on a few small things.
There are a few style tweaks (particularly the suggestion for create-manpage
at the end), so let me know if you'd prefer not to get these kind of style comments.
This was referenced Sep 27, 2024
buhtz
changed the title
Demonstrator: New config management class (and some more stuff)
refactor!: Demonstrator: New config management class (and some more stuff)
Nov 19, 2024
buhtz
added a commit
that referenced
this pull request
Jan 5, 2025
This introduce a state file at $XDG_STATE_HOME/backintime.json in JSON format. Several fields from the config file $XDG_CONFIG_HOME/backintime/config are moved into it. Fix also a minor GUI bug where the width of the fourth column ("Date") in files view was not stored between sessions. This PR is in preparation of #1850 (introduce a new configuration management).
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.
Blocked by
That PR is intended to get merged but also it is more a demonstrator instead of a modification to the current BIT behavior. The code technically is not "connected" to regular BIT and merging it won't change BIT behavior.
The objective was to replace the configuration management logic currently realized in the
Config
class. The current implementation is inefficient and blown up. Additionally that class does a lot more then just managing the configuration.The PR demonstrate the new solution. Some details are not finished and need to be solved. But I would like to discuss the approach as early as possible before finishing it.
__main__
incommon/konfig.py
file for a short example.Konfig
as name for the new class because of lack of a better alternative. I am open for suggestions. On a long run we will "delete" the wholeConfig
class with separating its behavior in several other classes. Once whenConfig
is gone we can renameKonfig
intoConfig
.configparser
now is used to read and write the config file. Because that package reads INI-like files I used a little trick because BIT's config file is not an INI file. After reading the raw file into memory I simply add[BIT]
before the first line and then read it withconfigparser
.Profile
internally dealing withKonfig
.backintime-config (1)
man page still is done with a script. The script does not parse the konfig.py file anymore but useinspect
to extract the relevant information (from public properties with docstrings).How to integrate it into BIT? Not in this PR but later. I would use
Config
in a wrapper-like manner usingKonfig
internally. This is a lot of extra work. But this step would make it smooth and less-risky transforming the codebase into usingKonfig
. And also the needed PRs can be smaller. This way we can carefully decouple the codebase step by step from theConfig
class monolith.Side note to myself
ConfigParser
can't handle lines like this:Problem is solved.