Configuration parser and default values for yum.
Bases: object
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
Parse the string value to the Option‘s native value.
Parameters: | s – raw string value to parse |
---|---|
Returns: | validated native value |
Raise : | ValueError if there was a problem parsing the string. Subclasses should override this |
Initialise the option for a config instance. This must be called before the option can be set or retrieved.
Parameters: |
|
---|
Clone an Option instance for the purposes of inheritance. The returned instance has all the same properties as the input Option and shares items such as the default value. Use this to avoid redefinition of reused options.
Parameters: | option_obj – Option instance to inherit |
---|---|
Returns: | New Option instance inherited from the input |
Bases: yum.config.Option
An option containing a list of strings.
Convert a string from the config file to a workable list, parses globdir: paths as foo.d-style dirs.
Parameters: | s – The string to be converted to a list. Commas and whitespace are used as separators for the list |
---|---|
Returns: | s converted to a list |
Bases: yum.config.Option
This option handles lists of URLs with validation of the URL scheme.
Parse a url to make sure that it is valid, and in a scheme that can be used.
Parameters: | url – a string containing the url to parse |
---|---|
Returns: | url if it is valid |
Raises : | ValueError if there is an error parsing the url |
Bases: yum.config.ListOption
Option for handling lists of URLs with validation of the URL scheme.
Parse a string containing multiple urls into a list, and ensure that they are in a scheme that can be used.
Parameters: | s – the string to parse |
---|---|
Returns: | a list of strings containing the urls in s |
Raises : | ValueError if there is an error parsing the urls |
Bases: yum.config.Option
An option representing an integer value.
Parse a string containing an integer.
Parameters: | s – the string to parse |
---|---|
Returns: | the integer in s |
Raises : | ValueError if there is an error parsing the integer |
Bases: yum.config.IntOption
An option representing a positive integer value, where 0 can have a special representation.
Parameters: | s – the string to parse |
---|---|
Returns: | the integer in s |
Raises : | ValueError if there is an error parsing the integer |
Bases: yum.config.Option
An option representing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Return value will always be an integer
Parse a string containing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Parameters: | s – the string to parse |
---|---|
Returns: | an integer representing the number of seconds specified by s |
Raises : | ValueError if there is an error parsing the string |
Bases: yum.config.Option
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Parse a string containing a boolean value. 1, yes, and true will evaluate to True; and 0, no, and false will evaluate to False. Case is ignored.
Parameters: | s – the string containing the boolean value |
---|---|
Returns: | the boolean value contained in s |
Raises : | ValueError if there is an error in parsing the boolean value |
Bases: yum.config.Option
An option representing a numeric float value.
Parse a string containing a numeric float value.
Parameters: | s – a string containing a numeric float value to parse |
---|---|
Returns: | the numeric float value contained in s |
Raises : | ValueError if there is an error parsing float value |
Bases: yum.config.Option
Handles string values where only specific values are allowed.
Parse a string for specific values.
Parameters: | s – the string to parse |
---|---|
Returns: | s if it contains a valid value |
Raises : | ValueError if there is an error parsing the values |
Bases: yum.config.SelectionOption
Mainly for compatibility with BoolOption, works like SelectionOption but lowers input case.
Parse a string for specific values.
Parameters: | s – the string to parse |
---|---|
Returns: | s if it contains a valid value |
Raises : | ValueError if there is an error parsing the values |
Bases: yum.config.Option
An option representing a value in bytes. The value may be given in bytes, kilobytes, megabytes, or gigabytes.
Parse a friendly bandwidth option to bytes. The input should be a string containing a (possibly floating point) number followed by an optional single character unit. Valid units are ‘k’, ‘M’, ‘G’. Case is ignored. The convention that 1k = 1024 bytes is used.
Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0. Invalid inputs: -10, -0.1, 45.6L, 123Mb.
Parameters: | s – the string to parse |
---|---|
Returns: | the number of bytes represented by s |
Raises : | ValueError if the option can’t be parsed |
Bases: yum.config.BytesOption
An option representing a bandwidth throttle value. See parse() for acceptable input values.
Get a throttle option. Input may either be a percentage or a “friendly bandwidth value” as accepted by the BytesOption.
Valid inputs: 100, 50%, 80.5%, 123M, 45.6k, 12.4G, 100K, 786.0, 0. Invalid inputs: 100.1%, -4%, -500.
Parameters: | s – the string to parse |
---|---|
Returns: | the bandwidth represented by s. The return value will be an int if a bandwidth value was specified, and a float if a percentage was given |
Raises : | ValueError if input can’t be parsed |
Bases: object
Base class for storing configuration definitions. Subclass when creating your own definitions.
Return the current value of the given option.
Parameters: |
|
---|---|
Returns: | the value of the option specified by option, or default if it does not exist |
Return True if the given name refers to a defined option.
Parameters: |
|
---|---|
Returns: | whether name specifies a defined option |
Yield (name, value) pairs for every option in the instance. The value returned is the parsed, validated option value.
Yield the names of all defined options in the instance.
Return the Option instance for the given name.
Parameters: | |
---|---|
Returns: | the Option instance specified by name, or None if it does not exist and exceptions is False |
Raises : | KeyError if the specified Option does not exist, and exceptions is True |
Set option values from an INI file section.
Parameters: |
|
---|
Set the value of the given option to the given value.
Parameters: |
|
---|
Write out the configuration to a file-like object.
Parameters: |
|
---|
Bases: yum.config.BaseConfig
Configuration option definitions for yum.conf’s [main] section that are required early in the initialisation process or before the other [main] options can be parsed.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing an integer value.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing an integer value.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option containing a list of strings.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
Bases: yum.config.StartupConf
Configuration option definitions for yum.conf’s [main] section.
Note: see also options inherited from StartupConf
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a value in bytes. The value may be given in bytes, kilobytes, megabytes, or gigabytes.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Handles string values where only specific values are allowed.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option containing a list of strings.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Return a string representing the values of all the configuration options.
Returns: | a string representing the values of all the configuration options |
---|
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Handles string values where only specific values are allowed.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
Handles string values where only specific values are allowed.
An option representing a positive integer value, where 0 can have a special representation.
An option containing a list of strings.
Mainly for compatibility with BoolOption, works like SelectionOption but lowers input case.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option containing a list of strings.
An option representing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Return value will always be an integer
An option representing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Return value will always be an integer
Handles string values where only specific values are allowed.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
This option handles lists of URLs with validation of the URL scheme.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing an integer value.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
An option representing a positive integer value, where 0 can have a special representation.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a bandwidth throttle value. See parse() for acceptable input values.
An option representing a numeric float value.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
Bases: yum.config.BaseConfig
Option definitions for repository INI file sections.
An option representing a value in bytes. The value may be given in bytes, kilobytes, megabytes, or gigabytes.
Option for handling lists of URLs with validation of the URL scheme.
An option representing an integer value.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
Option for handling lists of URLs with validation of the URL scheme.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Option for handling lists of URLs with validation of the URL scheme.
Handles string values where only specific values are allowed.
An option containing a list of strings.
Mainly for compatibility with BoolOption, works like SelectionOption but lowers input case.
Yield the names of all defined options in the instance.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option containing a list of strings.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Return value will always be an integer
This option handles lists of URLs with validation of the URL scheme.
This option handles lists of URLs with validation of the URL scheme.
An option representing an integer value of seconds, or a human readable variation specifying days, hours, minutes or seconds until something happens. Works like BytesOption. Note that due to historical president -1 means “never”, so this accepts that and allows the word never, too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never. Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y.
Return value will always be an integer
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This option handles lists of URLs with validation of the URL scheme.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a positive integer value, where 0 can have a special representation.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
An option representing a bandwidth throttle value. See parse() for acceptable input values.
An option representing a numeric float value.
This class handles a single Yum configuration file option. Create subclasses for each type of supported configuration option. Python descriptor foo (__get__ and __set__) is used to make option definition easy and concise.
Bases: yum.config.BaseConfig
Option definitions for version groups.
An option containing a list of strings.
An option representing a boolean value. The value can be one of 0, 1, yes, no, true, or false.
Parse Yum’s main configuration file and return a StartupConf instance. This is required in order to access configuration settings required as Yum starts up.
Parameters: |
|
---|---|
Returns: | A StartupConf instance |
Raises : | Errors.ConfigError if a problem is detected with while parsing. |
Parse Yum’s main configuration file
Parameters: | startupconf – StartupConf instance as returned by readStartupConfig() |
---|---|
Returns: | Populated YumConf instance |
Parse the configuration file for version groups.
Parameters: | configfile – the configuration file to read |
---|---|
Returns: | a dictionary containing the parsed options |
Convenience function to retrieve a parsed and converted value from a ConfigParser.
Parameters: | |
---|---|
Returns: | The parsed value or default if value was not present |
Raises : | ValueError if the option could not be parsed |
Write changes in a repo object back to a .repo file.
Parameters: |
|
---|