X-Git-Url: http://git.maemo.org/git/?p=remotepc;a=blobdiff_plain;f=pcremote-server-desktop%2Futils%2Fplistparser.py;fp=pcremote-server-desktop%2Futils%2Fplistparser.py;h=0000000000000000000000000000000000000000;hp=faaa0ac17b89c6053eb796986ff1b901564e4edc;hb=e164265008086869be2d718f635900a9bf38b7dd;hpb=3885148cece97c7cd7e9e4aaa1cb51f341e53f6c diff --git a/pcremote-server-desktop/utils/plistparser.py b/pcremote-server-desktop/utils/plistparser.py deleted file mode 100755 index faaa0ac..0000000 --- a/pcremote-server-desktop/utils/plistparser.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- - -# **************************************************************************** -# Copyright (c) 2008 INdT/Fucapi. -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . -# -# ============================================================================ -# Project Name : PC Remote -# Author : Jonatas Isvi -# Email : jonatas.nona@gmail.com -# Reviewer : -# Email : -# Version : 1.0 -# Package : utils -# Description : plisparser -# ============================================================================ - -from xml.etree import cElementTree as ElementTree - -# get the file -def _request(url): - xml = url - return parse_playlist_file(xml) - -# parser the file -def parse_playlist_file(xml): - tree = ElementTree.parse(xml) - listsongs = [] - dictsongs = {} - count = duration = filesize = 0 - title = artist = path = '' - - for child in tree.getiterator(): - if child.tag == 'Title': - title = child.text - elif child.tag == 'Artist': - artist = child.text - elif child.tag == 'Length': - duration = child.text - elif child.tag == 'Filesize': - filesize = child.text - count = count + 1 - dictsongs = {'track' : count, - 'title' : title, - 'artist' : artist, - 'duration' : duration, - 'filesize' : filesize, - 'path' : None, - 'extension' : None, - } - listsongs.append(dictsongs) - - return listsongs - - - - - - - -