Package yum :: Module config :: Class ThrottleOption
[hide private]
[frames] | no frames]

Class ThrottleOption

source code


An option representing a bandwidth throttle value. See ThrottleOption.parse for acceptable input values.

Instance Methods [hide private]
 
parse(self, s)
Get a throttle option.
source code

Inherited from Option: __get__, __init__, __set__, clone, setup, tostring

Inherited from Option (private): _setattrname

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from BytesOption: MULTS

Inherited from Option: __slotnames__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

parse(self, s)

source code 

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

Return value will be a int if a bandwidth value was specified or a float if a percentage was given.

ValueError will be raised if input couldn't be parsed.

Parameters:
  • s - Raw string value to parse.
Returns:
Validated native value.

Will raise ValueError if there was a problem parsing the string. Subclasses should override this.

Overrides: Option.parse