summaryrefslogtreecommitdiff
path: root/liveengine/bin/data/makeplaylist.py
diff options
context:
space:
mode:
Diffstat (limited to 'liveengine/bin/data/makeplaylist.py')
-rwxr-xr-xliveengine/bin/data/makeplaylist.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/liveengine/bin/data/makeplaylist.py b/liveengine/bin/data/makeplaylist.py
new file mode 100755
index 0000000..92ff865
--- /dev/null
+++ b/liveengine/bin/data/makeplaylist.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+from lxml import etree
+import sys,os
+
+if len(sys.argv)<2:
+ print "usage: makeplaylist source_directory"
+ sys.exit(0)
+
+sourcedir=sys.argv[1]
+
+page = etree.Element('playlist')
+doc = etree.ElementTree(page)
+
+dirList=sorted(os.listdir(sourcedir))
+note = 36
+while note<100:
+ for fname in dirList:
+ pageElement = etree.SubElement(page, 'svglayer',
+ note=str(note),
+ file=sourcedir+"/"+fname)
+ note +=1
+ if note>100:
+ break
+
+file= open(sourcedir+".xml", "w")
+doc.write(file, xml_declaration=True, encoding='utf-8',pretty_print=True)
+file.close() \ No newline at end of file