Skip to content
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

make it possible to control header items display from configuration file #404

Merged
merged 8 commits into from
Feb 28, 2024

Conversation

dlax
Copy link
Member

@dlax dlax commented Feb 20, 2024

based on #405 and #406; only last tree commits are new.

This version has reached its end-of-life last year,
https://peps.python.org/pep-0537/#lifespan.
We use the syntax from PEP 585 and PEP 604 and rely on 'from __future__
import annotations' to modernize the code base.

However, not all generic aliases (e.g. Dict, List) can be replaced
before Python 3.9.
Rephrase their help text and move then to a dedicated options group.
We introduce UIHeader class to hold header-specific options.

Along the way, many names (variables, functions) are changed in order to
make things more explicit.
In the command-line parser, options related to header information have
their default value set to None in order to distinguish when the option
was not specified from when it got, as it would store False then. This
makes it possible to have a precedence of command-line options over the
configuration file (implemented in types.UIHeader.make()).

The validation of configuration options, previously in UISection, is
extracted into a BaseSectionMixin and reused in new HeaderSection.
@dlax dlax marked this pull request as ready for review February 21, 2024 15:06
@dlax dlax requested a review from blogh February 21, 2024 15:07
SectionProxy.get*() would never actually raise NoOptionError because
the 'fallback' argument defaults to None.
Copy link
Collaborator

@blogh blogh left a comment

Choose a reason for hiding this comment

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

LGTM

@dlax dlax merged commit 25b0d8a into master Feb 28, 2024
6 checks passed
@dlax dlax deleted the configure-header branch February 28, 2024 12:06
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