Skip to content

Conversation

ErwannCodes
Copy link

Resolving the Issue: Using --config for a Custom Configuration Path
Problem: When a user specified the --config option with khal configure, the configuration file was always created in ~/.config/khal/config, even if a valid custom path was provided.

Identified Causes:

The value of --config was not correctly passed to configwizard.
Permissions for the specified path were not checked, leading to silent errors or failures.

Solution Provided
Correctly Passing --config:

The configure command now properly passes the --config value to configwizard.
configwizard uses this value to create or validate the configuration file.

Permission Handling:

If the specified path does not exist, it is automatically created.
If the necessary permissions are not available, a clear error message is displayed.

Handling Existing Files:

If a configuration file already exists at the specified path, a critical message is displayed, and the process is aborted to prevent overwriting.

@@ -0,0 +1,11 @@
Metadata-Version: 2.1
Copy link
Member

Choose a reason for hiding this comment

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

This file should not have been committed.

@@ -0,0 +1,188 @@
.coveragerc
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

setproctitle('khal')
if ctx.logfilepath:
# S'assurer que ctx.obj est initialisé
if ctx.obj is None:
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to check for this explicitly; ensure_object only sets the inner object if is None. I.e.: it already does the check for you.

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.

2 participants