Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions
ss1.NumericCell Class Reference
Inheritance diagram for ss1.NumericCell:
Inheritance graph
[legend]
Collaboration diagram for ss1.NumericCell:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def recalc
def format
def xml

Public Attributes

 value
 fmt
 alignment

Private Member Functions

def _xml_int
def _xml_long
def _xml_float
def _xml_complex

Detailed Description

Definition at line 328 of file ss1.py.


Constructor & Destructor Documentation

def ss1.NumericCell.__init__ (   self,
  value,
  fmt = "%s",
  alignment = RIGHT 
)

Definition at line 330 of file ss1.py.

00330 
00331     def __init__(self, value, fmt="%s", alignment=RIGHT):
00332         assert isinstance(value, (int, int, float, complex))
00333         assert alignment in (LEFT, CENTER, RIGHT)
00334         self.value = value
00335         self.fmt = fmt
00336         self.alignment = alignment

Here is the caller graph for this function:


Member Function Documentation

def ss1.NumericCell._xml_complex (   self) [private]

Definition at line 366 of file ss1.py.

00366 
00367     def _xml_complex(self):
00368         return '<complex>%s</double>' % repr(self.value)

def ss1.NumericCell._xml_float (   self) [private]

Definition at line 363 of file ss1.py.

00363 
00364     def _xml_float(self):
00365         return '<double>%s</double>' % repr(self.value)

def ss1.NumericCell._xml_int (   self) [private]

Definition at line 354 of file ss1.py.

00354 
00355     def _xml_int(self):
00356         if -2**31 <= self.value < 2**31:
00357             return '<int>%s</int>' % self.value
00358         else:
00359             return self._xml_long()

Here is the call graph for this function:

def ss1.NumericCell._xml_long (   self) [private]

Definition at line 360 of file ss1.py.

00360 
00361     def _xml_long(self):
00362         return '<long>%s</long>' % self.value

Here is the caller graph for this function:

def ss1.NumericCell.format (   self)

Definition at line 340 of file ss1.py.

00340 
00341     def format(self):
00342         try:
00343             text = self.fmt % self.value
00344         except:
00345             text = str(self.value)
00346         return text, self.alignment

Here is the caller graph for this function:

def ss1.NumericCell.recalc (   self,
  ns 
)

Definition at line 337 of file ss1.py.

00337 
00338     def recalc(self, ns):
00339         return self.value

def ss1.NumericCell.xml (   self)

Definition at line 347 of file ss1.py.

00347 
00348     def xml(self):
00349         method = getattr(self, '_xml_' + type(self.value).__name__)
00350         return '<value align="%s" format="%s">%s</value>' % (
00351                 align2xml[self.alignment],
00352                 self.fmt,
00353                 method())

Here is the call graph for this function:


Member Data Documentation

Definition at line 335 of file ss1.py.

Definition at line 334 of file ss1.py.

Definition at line 333 of file ss1.py.


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