def __init__(self, mp3_file_obj): AbsXMLNode.__init__(self) # setup a tiny XML doc of one node that will be appended to bigger one later mp3_node = self.elm.createElement('mp3') for i,node_name in enumerate(MP3File.getFieldLabels()): node_obj = self.elm.createElement(strtool.sanitizeTrackStr(node_name)) txt = unicode(mp3_file_obj.getFieldList()[i]).encode('utf-8').strip() node_val_txt = self.elm.createTextNode(txt) node_obj.appendChild(node_val_txt) mp3_node.appendChild(node_obj) self.elm.appendChild(mp3_node)
def __init__(self, parent): super(MP3Grid, self).__init__(parent) # setup grid and all its glory labelz = MP3File.getFieldLabels() self.CreateGrid(globalz.MAXROWS, len(labelz)) self.EnableEditing(False) self.EnableCellEditControl(False) for x, l in enumerate(labelz): self.SetColLabelValue(x, l) self.SetColSize(0, 150) self.SetColSize(1, 150) for c in xrange(2,6): self.SetColSize(c, 300)