Package gavo :: Package utils :: Module fancyconfig :: Class IntListConfigItem
[frames] | no frames]

Class IntListConfigItem

source code

  object --+            
           |            
  ConfigItem --+        
               |        
StringConfigItem --+    
                   |    
      ListConfigItem --+
                       |
                      IntListConfigItem
Known Subclasses:

A ConfigItem containing a comma separated list of ints.

Literal handling is analoguos to ListConfigItem.

>>> ci = IntListConfigItem("foo"); ci.value, ci.getAsString()
([], '')
>>> ci.set("3,2, 1"); ci.value, ci.getAsString()
([3, 2, 1], '3, 2, 1, ')
>>> ci.set(ci.getAsString()); ci.value
[3, 2, 1]
>>> ci.set("1, 2, 3, rubbish")
Traceback (most recent call last):
ParseError: Non-integer in integer list
Instance Methods

Inherited from ConfigItem: __init__, getAsString, set

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

Class Variables
  typedesc = 'list of integers'
  default = ""
hash(x)
Properties

Inherited from object: __class__