Skip to content
Snippets Groups Projects
Commit 22a43ca2 authored by nimrod's avatar nimrod
Browse files

Added simple search and parsing for CPLs (ID and issue date).

parent fd22da96
No related branches found
No related tags found
No related merge requests found
dcpman (0.1.5) UNRELEASED; urgency=medium
* Tagged debian/0.1.4
* modified: debian/changelog modified: fabfile.py
* Now logs exception as well.
-- Adar Nimrod <nimrod@shore.co.il> Sun, 28 Sep 2014 10:03:55 +0300
dcpman (0.1.4) unstable; urgency=medium dcpman (0.1.4) unstable; urgency=medium
* Tagged debian/0.1.4 * Tagged debian/0.1.4
......
...@@ -11,7 +11,6 @@ def publish (): ...@@ -11,7 +11,6 @@ def publish ():
@task @task
def build (): def build ():
#local ('''git dch -a''')
local ('''dpkg-buildpackage -us -uc''') local ('''dpkg-buildpackage -us -uc''')
@task @task
...@@ -25,4 +24,4 @@ def clean (): ...@@ -25,4 +24,4 @@ def clean ():
@task @task
def push (): def push ():
local ('''git push --all gitweb''') local ('''git push --all gitdaemon''')
...@@ -180,6 +180,21 @@ class DCP: ...@@ -180,6 +180,21 @@ class DCP:
except BaseException as e: except BaseException as e:
raise RuntimeError ('Failed to parse packinglist file') from e raise RuntimeError ('Failed to parse packinglist file') from e
def _find_cpl (self):
'''Goes through the xml files, finds the CPL and extracts the data from
it.'''
for asset in [x for x in self.assets if hasattr (x, 'type') and x.type.find ('xml') > -1]:
elements = (parse (asset.fullpath)).getElementsByTagName \
('CompositionPlaylist')
if len (elements) > 0:
try:
self.cpl_id = elements[0].getElementsByTagName \
('Id')[0].firstChild.data
self.cpl_date = elements[0].getElementsByTagName \
('IssueDate')[0].firstChild.data
except:
pass
def __init__ (self, directory): def __init__ (self, directory):
'''Parses the DCP in the directory specified.''' '''Parses the DCP in the directory specified.'''
self.directory = directory self.directory = directory
...@@ -191,6 +206,7 @@ class DCP: ...@@ -191,6 +206,7 @@ class DCP:
(x, 'duration')]) (x, 'duration')])
except: except:
self.duration = 'Unknown' self.duration = 'Unknown'
self._find_cpl ()
def copyAndVerify (self, destination): def copyAndVerify (self, destination):
'''Copies the DCP to the destination directory and verifies during.''' '''Copies the DCP to the destination directory and verifies during.'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment