Source

dataliberation / issues / tigris / data / TigrisIssueMessage.py

Full commit
'''
Created on 08.04.2010

@author: dirk
'''

import io.xml

class TigrisIssueMessage:
    '''
    A single message in a Tigris issue.
    '''

    def __init__(self, who='', when='', text=''):
        '''
        Constructor
        '''
        self.who = who
        self.when = when
        self.text = text
        
    def appendNode(self, doc, root):
        e = doc.createElement("long_desc")
        io.xml.addChildText(doc, e, "who", self.who)
        io.xml.addChildText(doc, e, "issue_when", self.when)
        io.xml.addChildText(doc, e, "thetext", self.text)
        root.appendChild(e)
    
    def parseNode(self, node):
        self.who = io.xml.getChildText(node, "who")
        self.when = io.xml.getChildText(node, "issue_when")
        self.text = io.xml.getChildText(node, "thetext")