Skip to content

Change for XDG complicance #1318

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

Closed
wants to merge 4 commits into from
Closed

Change for XDG complicance #1318

wants to merge 4 commits into from

Conversation

goranmoomin
Copy link

Fixes #1317 :-)

@goranmoomin
Copy link
Author

My python skills are super rusty(I used python about ~4 years ago) so, you can fix it to be more 'pythonic'!

@goranmoomin
Copy link
Author

@lra Updated commit to be more structured, added a test for XDG config (but isn't extensively testing as the code relies on the existence of a file in disk).

@goranmoomin
Copy link
Author

@lra May I kindly ask you to review my PR? I would be very thankful if XDG landed in mackup; It's one of the five apps in my computer that doesn't follow XDG compliance.

Is there is anything that is blocking from merging?

@josh1703658784
Copy link

josh1703658784 commented Apr 29, 2020

@lra is there any interest in merging this? Does more work need done? I'd be more than happy to help get this feature in.

@lra
Copy link
Owner

lra commented Apr 29, 2020

Sure! I just need to protected time to get my head around it ;)

@ya2s
Copy link
Contributor

ya2s commented May 15, 2020

PR duplicates(#632).
It looks to need XDG_CUSTOM_APPS_DIR not only MACKUP_XDG_CONFIG_FILE

@goranmoomin
Copy link
Author

@yamatsum Oops, Why did I not realize that! I should also have changed that... Maybe I'll try to resolve the conflicts, fix that problem and make a new PR tomorrow or the day after that.

@ya2s
Copy link
Contributor

ya2s commented May 15, 2020

@pcr910303 I think your PR is great!
The only thing I was worried about was the file name.
I would recommend the following.

# Mackup config file; for XDG users
XDG_MACKUP_CONFIG_FILE = 'mackup.cfg'
# Directory that can contains user defined app configs; for XDG users
XDG_CUSTOM_APPS_DIR = 'mackup'

@goranmoomin
Copy link
Author

OK, I'm working on this.

So I didn't want to have nested directories in $XDG_CONFIG_HOME/mackup, I wanted both user defined custom app configuration files and the mackup config file there. I just decided to make the config file name config.cfg, and when you load custom app configuration, you just ignore the file config.cfg.

Would this be fine?

Or... should I just revert to using a directory? 😢

@ya2s
Copy link
Contributor

ya2s commented May 20, 2020

@pcr910303 Thank you for a great job!
I can't judge whether the specification to implement without nesting in $XDG_CONFIG_HOME/mackup is good or not.
But if the file name is config.cfg, it becomes config.config.
So I think mackup.cfg is better.

"""
xdg_cfg_dir = get_xdg_cfg_dir()
home_custom_apps_dir = os.path.join(os.environ["HOME"], constants.CUSTOM_APPS_DIR)
if os.path.isdir(xdg_cfg_dir):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MACKUP_XDG_CONFIG_FILE does not exist, but xdg_cfg_dir does exist, is that okay?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that would force using the default config?

@goranmoomin
Copy link
Author

Sorry for the late reply. I'm pretty busy, I think I won't be able to touch this PR for a while (probably until mid-June), but I just updated the PR to change it to mackup.cfg. I originally didn't use that because it will block making customization to mackup, but I'm not sure about that.

@ya2s
Copy link
Contributor

ya2s commented Jun 12, 2020

@lra If you don't have any problems, can you merge?

@lra
Copy link
Owner

lra commented Jun 12, 2020

I started reviewing it, and was stopped, I can't blindly merge and break everyone's install, it's not as simple as this is a chicken/egg problem, the mackup config is impacting all other configs and must be loaded before anything else, but if it's in a place that depends on a config value, it won't work.

If there was a test to check this, it would be easier to review.

So I need more time to make sure this does not break, sorry.

Also I'd like to respect #632 and see if there is a way to merge both.

@goranmoomin
Copy link
Author

Yeah, this PR is not really ready as @lra said. I'll try to make it ready, but it won't work in it's current state.

@goranmoomin
Copy link
Author

Ok, I'm sorry about abandoning this PR, but I clean-installed macOS Big Sur on my machine and I'm not using Mackup anymore (not that it's not useful, but I lost my Mackup backup so... 🤦🏻‍♀️), so I don't think I'll have enough time to continue this PR . Maybe someone might continue this, but I'm closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow the XDG spec for configuration
4 participants