Peach :: Generators :: static :: Static :: Class Static
[hide private]

Class Static

source code


Contains a static value that never changes. Value can be any form of static data.

Example:

>>> gen = Static('Hello world')
>>> print gen.getValue()
Hello world

See Also: StaticBinary

Instance Methods [hide private]
 
__init__(self, value)
Base constructor, please call me!
source code
string
getRawValue(self)
Return raw value w/o passing through transformer if set.
source code
Static
setValue(self, value)
Set static value to return.
source code
 
next(self)
Next value.
source code

Inherited from generator.Generator: __iter__, getGroup, getName, getTransformer, getValue, identity, reset, setGroup, setName, setTransformer

Static Methods [hide private]
 
unittest() source code
Class Variables [hide private]
  _value = ''
Method Details [hide private]

__init__(self, value)
(Constructor)

source code 

Base constructor, please call me!

Parameters:
  • value (string) - Static data
Overrides: generator.Generator.__init__

getRawValue(self)

source code 

Return raw value w/o passing through transformer if set. OVERRIDE

Returns: string
Data before transformations
Overrides: generator.Generator.getRawValue
(inherited documentation)

setValue(self, value)

source code 

Set static value to return.

Parameters:
  • value (string) - Static data
Returns: Static
self

next(self)

source code 

Next value. OVERRIDE

From Python docs on next():

The intention of the protocol is that once an iterator's next() method raises StopIteration, it will continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. (This constraint was added in Python 2.3; in Python 2.2, various iterators are broken according to this rule.)

For Generators, please use the GeneratorCompleted exception instead of StopIteration (its a subclass).

Overrides: generator.Generator.next
(inherited documentation)