Methods
|
|
|
|
__getitem__
|
__getitem__ ( self, x )
Return row x as an instance of Row from this ASV instance
|
|
__init__
|
__init__ ( self )
|
|
__setitem__
|
__setitem__ (
self,
x,
row,
field_names=None,
)
Set item x to row
row can be either a Row instance or a list. field_names is a list of field names that each
element in the row correnponds with and only makes sense if row is a list since a Row
instance already has field names
|
|
append
|
append (
self,
row,
field_names=None,
)
Append row to this ASV instance
row can be either a Row instance or a list. field_names is a list of field names that each
element in the row correnponds with and only makes sense if row is a list since a Row
instance already has field names
Exceptions
|
|
ASVError( "Can't specify row of type Row and field_names since a Row object has its own field_names" )
Mismatched_Field_Names_Error( "Field '%s' not found in ASV instance" % field_name )
Mismatched_Field_Names_Error( "Too many field names from row to ASV instance" )
Too_Many_Fields_Error("'%s' contains more than the %s field names this ASV instance knows about" %(row, len( self._field_names ) ) )
|
|
|
extend
|
extend (
self,
rows,
field_names=None,
)
Append list rows to this ASV instance
rows must be a list. Elements in rows should either all be Row instances or lists themselves;
if this is not the case the result of the extend is undefined.
row can be either a Row instance or a list. field_names is a list of field names that each
element in the row correnponds with and only makes sense if row is a list since a Row
instance already has field names.
|
|
get_field_names
|
get_field_names ( self )
Return this ASV instances field names
Returns None if this ASV instance does not have any field names
|
|
input
|
input (
self,
data,
input_class,
*args,
*kwargs,
)
Process input data using input_class
Although the input_class can specify what type data should be, in general it should be a
string.
See input and output classes in the main documentation for more discussion of what
input_class should refer to.
|
|
input_from_file
|
input_from_file (
self,
input_file,
input_class,
*args,
*kwargs,
)
Process input data from a named file
This is a convenience method. input_file should be the name of a readable file; see the
input method for details of the other arguments
|
|
output
|
output (
self,
output_class,
*args,
*kwargs,
)
Create output data using output_class
|
|
output_to_file
|
output_to_file (
self,
output_file,
output_class,
*args,
*kwargs,
)
Output data straight to a named file
This is a convenience method for the output method
|
|
set_field_names
|
set_field_names ( self, field_names )
Set the field names for this ASV instance
field_names must be a list of strings.
You can not set field names if you they have already been set (either explicitly be using
this method or indirectly by another method such as input) or if this ASV instance already
holds data.
Exceptions
|
|
ASVError( "Field names can not be changed once set" )
ASVError( "Field names can not be set once data has already been stored" )
|
|