def test_parse_serviceinfo(self):
     pi = unmarshall(open('test/PI.xml'))
     print pi
     print marshall(pi, indent='    ')
예제 #2
0
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#===============================================================================

from dabepg.xml import unmarshall

pi = unmarshall(open('PI.xml'))

print('Scope:', pi.schedule.get_scope())
print('=' * 40)
for programme in pi.schedule.programmes:
    print(programme)
    for location in programme.locations:
        print('\t', ','.join([str(x) for x in location.times]))
        print('\t', ','.join([str(x) for x in location.bearers]))
    for media in programme.media:
        print(media)
    for genre in programme.genres:
        print(genre)
    for link in programme.links:
        print(link)
    for keyword in programme.keywords:
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library 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 library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#===============================================================================

from dabepg.xml import unmarshall

pi = unmarshall(open('PI.xml'))

print 'Scope:', pi.schedule.get_scope()
print '='* 40
for programme in pi.schedule.programmes:
    print programme
    for location in programme.locations:
        print '\t', ','.join([str(x) for x in location.times])
        print '\t', ','.join([str(x) for x in location.bearers])
    for media in programme.media:
        print media
    for genre in programme.genres:
        print genre
    for link in programme.links:
        print link
    for keyword in programme.keywords:
예제 #4
0
 def test_parse_serviceinfo(self):
     pi = unmarshall(open('test/PI.xml'))
     print pi
     print marshall(pi, indent='    ')
 def test_parse_serviceinfo(self):
     si = unmarshall(open('test/SI.xml'))
     print si
     print marshall(si, indent='    ')