示例#1
0
文件: server.py 项目: adriavend/Code
def RecvXmlToObject(data):
    xml = ET.fromstring(data)
    root = xml.getchildren()

    playerNum = xml.find('playerNum')
    pNum = playerNum.text

    event = xml.find('event')
    evento = event.text
  
    position = xml.find('position')
    pos = position.text

    return info_receive.InfoReceive(pNum,evento,pos)
示例#2
0
  def __init__(self,wp='wp.xml',testing=False,do_images=True):

    self.wp = wp
    self.testing = testing
    self.do_images = do_images

    self.xml = None
    self.pivot_items_xml = ''
    self.images = []
    self.dzc_output = 'dzc_output'

    self.blurb_max_len = 500

    if self.testing:
      doc = minidom.parseString(testentry)
    else:
      f = codecs.open(self.wp, 'r', 'utf-8')
      xml = f.read()
      f.close()
      if xml.find('xmlns:atom="http://www.w3.org/2005/Atom"') == -1:
        xml = xml.replace('xmlns:wp="http://wordpress.org/export/1.0/"', 'xmlns:wp="http://wordpress.org/export/1.0/" xmlns:atom="http://www.w3.org/2005/Atom"')
        f = codecs.open(self.wp, 'w', 'utf-8')
        f.write(xml)
        f.close()
      doc = minidom.parse(self.wp)

    self.items = doc.getElementsByTagName('item')
示例#3
0
文件: ZDF.py 项目: Bobbaone/pyload
    def process(self, pyfile):
        xml = xml.etree.ElementTree.fromstring(self.load(self.XML_API % self.get_id(pyfile.url)))

        status = xml.findtext("./status/statuscode")
        if status != "ok":
            self.fail(_("Error retrieving manifest"))

        video = xml.find("video")
        title = video.findtext("information/title")

        pyfile.name = title

        target_url = sorted((v for v in video.iter("formitaet") if self.video_valid(v)),
                            key=self.video_key)[-1].findtext("url")

        self.download(target_url)
示例#4
0
文件: ZDF.py 项目: vaginessa/pyload
    def process(self, pyfile):
        xml = xml.etree.ElementTree.fromstring(
            self.load(self.XML_API % self.get_id(pyfile.url)))

        status = xml.findtext("./status/statuscode")
        if status != "ok":
            self.fail(_("Error retrieving manifest"))

        video = xml.find("video")
        title = video.findtext("information/title")

        pyfile.name = title

        target_url = sorted(
            (v for v in video.iter("formitaet") if self.video_valid(v)),
            key=self.video_key)[-1].findtext("url")

        self.download(target_url)