Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Attributes
MoinMoin.util.dataset.Dataset Class Reference
Inheritance diagram for MoinMoin.util.dataset.Dataset:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __len__
def reset
def next
def addRow

Public Attributes

 columns
 data
 data_id

Private Attributes

 _pos

Detailed Description

Base dataset.

Holds a 2-dimensional data set (m rows of n columns) and associated
meta-data (column titles, etc.).

Note: Dataset rows and column must contain only ascii or Unicode values!

Definition at line 37 of file dataset.py.


Constructor & Destructor Documentation

def MoinMoin.util.dataset.Dataset.__init__ (   self,
  data_id = None 
)

Definition at line 46 of file dataset.py.

00046 
00047     def __init__(self, data_id=None):
00048         self.columns = []
00049         self.data = []
00050         self._pos = 0
00051         self.data_id = data_id


Member Function Documentation

Definition at line 52 of file dataset.py.

00052 
00053     def __len__(self):
00054         return len(self.data)

def MoinMoin.util.dataset.Dataset.addRow (   self,
  row 
)
Add a row to the dataset.

Definition at line 70 of file dataset.py.

00070 
00071     def addRow(self, row):
00072         """ Add a row to the dataset.
00073         """
00074         self.data.append(row)
00075 

Return next row as a tuple, ordered by columns.

Reimplemented in MoinMoin.util.dataset.DictDataset.

Definition at line 60 of file dataset.py.

00060 
00061     def next(self):
00062         """ Return next row as a tuple, ordered by columns.
00063         """
00064         if self._pos >= len(self):
00065             return None
00066 
00067         row = self.data[self._pos]
00068         self._pos += 1
00069         return row

Reset iterator to start.

Definition at line 55 of file dataset.py.

00055 
00056     def reset(self):
00057         """ Reset iterator to start.
00058         """
00059         self._pos = 0


Member Data Documentation

Definition at line 49 of file dataset.py.

Definition at line 47 of file dataset.py.

Definition at line 48 of file dataset.py.

Definition at line 50 of file dataset.py.


The documentation for this class was generated from the following file: