py::qo::ext::OpenDocument::spreadsheet::Content Class Reference

Inheritance diagram for py::qo::ext::OpenDocument::spreadsheet::Content:

Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def append

Public Attributes

 doc
 root
 table


Member Function Documentation

def py::qo::ext::OpenDocument::spreadsheet::Content::__init__ (   self  ) 

00075                              :
00076                 self.doc = DOM_IMPL.createDocument( "urn:oasis:names:tc:opendocument:xmlns:office:1.0", "office:document-content", None )
00077                 self.root = self.doc.documentElement
00078                 self.root.setAttribute( "xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" )
00079                 self.root.setAttribute( "xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" )
00080                 self.root.setAttribute( "xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" )
00081 
00082                 body = self.doc.createElement( "office:body" )
00083                 sheet = self.doc.createElement( "office:spreadsheet" )
00084                 self.table = self.doc.createElement( "table:table" )
00085                 sheet.appendChild( self.table )
00086                 body.appendChild( sheet )
00087                 self.root.appendChild( body )
00088 
00089                 self.table.setAttribute( "table:name", "Sheet1" )
00090         
        def append( self, row ) :

def py::qo::ext::OpenDocument::spreadsheet::Content::append (   self,
  row 
)

00091                                 :
00092                 e_row = self.doc.createElement( "table:table-row" )
00093                 for x in row :
00094                         if x is None :
00095                                 x = ""
00096                         cell = self.doc.createElement( "table:table-cell" )
00097                         cell.setAttribute( "office:value-type", type_office(x) )
00098                         cell.setAttribute( "office:value", unicode(x) )
00099                         text = self.doc.createElement( "text:p" )
00100                         text.appendChild( self.doc.createTextNode( unicode(x) ) )
00101                         cell.appendChild( text )
00102                         e_row.appendChild( cell )
00103                 self.table.appendChild( e_row )
00104 
00105 
class Document :


Member Data Documentation

py::qo::ext::OpenDocument::spreadsheet::Content::doc

py::qo::ext::OpenDocument::spreadsheet::Content::root

py::qo::ext::OpenDocument::spreadsheet::Content::table


The documentation for this class was generated from the following file:
Generated on Tue Oct 9 20:40:32 2007 for Qomics by  doxygen 1.5.3