def test_genre(self): from dabepg.binary import encode_genre from dabepg import Genre genre = Genre('urn:tva:metadata:cs:ContentCS:2002:3.6.9', 'World/Traditional/Ethnic/Folk Music') print 'genre', genre, 'encodes as' bits = encode_genre(genre) print bitarray_to_binary(bits) print bitarray_to_hex(bits)
class Intention: ENTERTAIN = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.1', 'ENTERTAIN') INFORM = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.2', 'INFORM') Infotainment = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.2.3', 'Infotainment') Advice = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.2.4', 'Advice') EDUCATE = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.3"', 'EDUCATE') ENRICH = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.8', 'ENRICH') Inspirational_enrichment = Genre('urn:tva:metadata:cs:IntentionCS:2005:1.8.2', 'Inspirational enrichment')
class Cultural(Genre): def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.1.10', 'Cultural') Arts = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.1', 'Arts') Entertainment = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.2', 'Entertainment') Film = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.3', 'Film') Music = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.4', 'Music') Radio = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.5', 'Radio') TV = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.6', 'TV')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.2', 'Jazz')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.9', 'World/Traditional/Ethnic/Folk music')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.8', 'Electronic/Club/Urban/Dance')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.8', 'Transport and Communications')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.6', 'Sciences')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.4', 'Arts')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.2', 'Religion/Philosophies')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1', 'NON-FICTION/INFORMATION')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.1', 'Classical music')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.1.1', 'Early')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6', 'Music')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.5', 'AMUSEMENT/ENTERTAINMENT')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.4', 'FICTION/DRAMA')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.2', 'SPORTS')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.11', 'Listings')
class News(Genre): def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.1', 'News') Daily_News = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.1', 'Daily news') Special_News = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.2', 'Special news/edition') Special_Report = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.3', 'Special Report') Commentary = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.4', 'Commentary') Periodical = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.5', 'Periodical') National_Politics = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.6', 'National politics/National assembly') Economy = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.7', 'Economy/Market/Financial/Business') International = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.8', 'Foreign/International') Sports = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.9', 'Sports') class Cultural(Genre): def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.1.10', 'Cultural') Arts = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.1', 'Arts') Entertainment = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.2', 'Entertainment') Film = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.3', 'Film') Music = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.4', 'Music') Radio = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.5', 'Radio') TV = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.10.6', 'TV') Local = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.11', 'Local/Regional') Traffic = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.12', 'Traffic') Weather = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.13', 'Weather forecasts') Service_information = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.14', 'Service information') Public_affairs = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.15', 'Public affairs') Current_affairs = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.16', 'Current affairs') Consumer_affairs = Genre('urn:tva:metadata:cs:ContentCS:2009:3.1.1.17', 'Consumer affairs')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.3', 'Background music')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.1.10', 'Cultural')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.4', 'Pop-rock')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.3', 'General non-fiction')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.5', 'Blues/Rhythm and Blues/Soul/Gospel')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.5', 'Humanities')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.6', 'Country and Western')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.6.7', 'Rap/Hip Hop/Reggae')
def __init__(self): Genre.__init__(self, 'urn:tva:metadata:cs:ContentCS:2009:3.1.7', 'Human interest')