Beispiel #1
0
 def _metadataToDom(self, parentNode):
     XMLIntf.appendTextElements(parentNode,
                                ((u"BroadcastID", self.Broadcast.ID),
                                 (u"ClassID", self.Class.ID),
                                 (u"Callsign", self.Callsign)))
     self.ForeignCallsign.toDom(parentNode, u"Callsign")
     XMLIntf.appendDateElement(parentNode, u"Timestamp", self.Timestamp)
     XMLIntf.appendTextElements(parentNode,
                                ((u"Recording", self.RecordingURL),
                                 (u"Remarks", self.Remarks)))
Beispiel #2
0
 def _metadataToDom(self, parentNode):
     XMLIntf.appendTextElements(parentNode,
         (
             (u"BroadcastID", self.Broadcast.ID),
             (u"ClassID", self.Class.ID),
             (u"Callsign", self.Callsign)
         )
     )
     self.ForeignCallsign.toDom(parentNode, u"Callsign")
     XMLIntf.appendDateElement(parentNode, u"Timestamp", self.Timestamp)
     XMLIntf.appendTextElements(parentNode,
         (
             (u"Recording", self.RecordingURL),
             (u"Remarks", self.Remarks)
         )
     )
Beispiel #3
0
    def toDom(self, parentNode, flags=None):
        broadcast = XMLIntf.SubElement(parentNode, u"broadcast")

        XMLIntf.appendTextElement(broadcast, u"ID", unicode(self.ID))
        XMLIntf.appendDateElement(broadcast, u"Start", self.BroadcastStart)
        if self.BroadcastEnd is not None:
            XMLIntf.appendDateElement(broadcast, u"End", self.BroadcastEnd)
        XMLIntf.appendTextElements(
            broadcast, [(u"StationID", unicode(self.StationID)),
                        (u"Type", self.Type),
                        (u"Confirmed", "" if self.Confirmed else None),
                        (u"on-air", "" if self.getIsOnAir() else None),
                        (u"has-transmissions",
                         "" if self.Transmissions.count() > 0 else None)])
        for frequency in self.Frequencies:
            frequency.toDom(broadcast)

        if flags is not None and "broadcast-transmissions" in flags:
            for transmission in self.Transmissions:
                transmission.toDom(broadcast, flags)