config: generate sample-config files containing all and only classes relevant to configurable traits#289
Merged
minrk merged 4 commits intoipython:masterfrom Aug 26, 2016
Conversation
3883c49 to
4ed2009
Compare
Contributor
Author
|
Rational: This PR ensures that the sample-config file will describe to the user AND contain all the classes on which a trait-value may be overridden:
|
Contributor
Author
|
Attaching generated configs to facilitate review. The differences between the 2 listings are the following:
With this PR:#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
# This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
#c.Application.log_level = 30
#------------------------------------------------------------------------------
# MyApp(Application) configuration
#------------------------------------------------------------------------------
# This is an application.
## Load this config file
#c.MyApp.config_file = ''
## Is the app running?
#c.MyApp.running = False
## Should print a warning if `MyApp.warn-typo=...` command is passed
#c.MyApp.warn_tpyo = 'yes the name is wrong on purpose'
#------------------------------------------------------------------------------
# Bar(Configurable) configuration
#------------------------------------------------------------------------------
## The integer b.
#c.Bar.b = 0
## Enable bar.
#c.Bar.enabled = True
#------------------------------------------------------------------------------
# Foo(Configurable) configuration
#------------------------------------------------------------------------------
## Some long running text: Lorem ipsum dolor sit amet, consectetur adipiscing
# elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
# enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat.
#c.Foo.i = 0
## The integer j.
#c.Foo.j = 1
## First name.
#c.Foo.name = 'Brian'
#------------------------------------------------------------------------------
# NoTraits(Foo,Bar) configuration
#------------------------------------------------------------------------------Without this PR:#------------------------------------------------------------------------------
# Application configuration
#------------------------------------------------------------------------------
# This is an application.
# The date format used by logging formatters for %(asctime)s
# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
# The Logging format template
# c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
# Set the log level by value or name.
# c.Application.log_level = 30
#------------------------------------------------------------------------------
# MyApp configuration
#------------------------------------------------------------------------------
# This is an application.
# Load this config file
# c.MyApp.config_file = ''
# Is the app running?
# c.MyApp.running = False
# Should print a warning if `MyApp.warn-typo=...` command is passed
# c.MyApp.warn_tpyo = 'yes the name is wrong on purpose'
#------------------------------------------------------------------------------
# Bar configuration
#------------------------------------------------------------------------------
# The integer b.
# c.Bar.b = 0
# Enable bar.
# c.Bar.enabled = True
#------------------------------------------------------------------------------
# Foo configuration
#------------------------------------------------------------------------------
# Some long running text: Lorem ipsum dolor sit amet, consectetur adipiscing
# elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
# enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat.
# c.Foo.i = 0
# The integer j.
# c.Foo.j = 1
# First name.
# c.Foo.name = 'Brian' |
Contributor
Author
|
Updated the sample above to compare the new "demarcation" commit. |
c9c75c9 to
fcb4716
Compare
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Aug 25, 2016
… configs. The motivation is the user to know the relationships between the classes in the generated sample configuration-file, so that he can choose at which inheritance-level to override some trait value.
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Aug 25, 2016
…ir subclasses. Rational: This commit, along with the previous for printing also all configurable class-parents, ensures that the sample-config file will contain all classes on which a trait-value may be overridden: - either on the class owning the trait, - or on its subclasses, even if those subclasses do not define any traits themselves.
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Aug 25, 2016
…nclusion logic.
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Aug 25, 2016
…p by identation.
… configs. The motivation is the user to know the relationships between the classes in the generated sample configuration-file, so that he can choose at which inheritance-level to override some trait value.
…ir subclasses. Rational: This commit, along with the previous for printing also all configurable class-parents, ensures that the sample-config file will contain all classes on which a trait-value may be overridden: - either on the class owning the trait, - or on its subclasses, even if those subclasses do not define any traits themselves.
…nclusion logic.
…p by identation.
fcb4716 to
9a2079d
Compare
Member
|
Makes sense, thanks! |
This was referenced Sep 22, 2016
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Jan 13, 2017
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Jan 25, 2017
ankostis
added a commit
to ankostis/traitlets
that referenced
this pull request
Jan 30, 2017
This file contains hidden or 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
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.
The motivation is the user to know the relationships between the classes
in the generated sample configuration-file, so that he can choose at
which inheritance-level to override some trait value.