summaryrefslogtreecommitdiff
path: root/liveengine/bin/data/makeplaylist.py
diff options
context:
space:
mode:
authorTim Redfern <tim@gray.(none)>2012-10-28 17:40:19 +0000
committerTim Redfern <tim@gray.(none)>2012-10-28 17:40:19 +0000
commit796d647fd38f7cf01cb70bbb0700b75427e42d55 (patch)
tree9022fe609a3db0e8f5d92bc179155a6f785707e0 /liveengine/bin/data/makeplaylist.py
parent1584507071a2aa4cb27801e980dce0e1843069a4 (diff)
starting to build kinect addition
Diffstat (limited to 'liveengine/bin/data/makeplaylist.py')
-rwxr-xr-xliveengine/bin/data/makeplaylist.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/liveengine/bin/data/makeplaylist.py b/liveengine/bin/data/makeplaylist.py
index 92ff865..2376f3d 100755
--- a/liveengine/bin/data/makeplaylist.py
+++ b/liveengine/bin/data/makeplaylist.py
@@ -1,26 +1,32 @@
#!/usr/bin/python
from lxml import etree
-import sys,os
+import sys,os,random
if len(sys.argv)<2:
- print "usage: makeplaylist source_directory"
+ print "usage: makeplaylist source_directory playlist_name"
sys.exit(0)
sourcedir=sys.argv[1]
+playlistname=sys.argv[1]
-page = etree.Element('playlist')
+if len(sys.argv)>2:
+ playlistname=sys.argv[2]
+
+page = etree.Element('playlist',name=playlistname)
doc = etree.ElementTree(page)
dirList=sorted(os.listdir(sourcedir))
-note = 36
-while note<100:
+nums=range(64)
+random.shuffle(nums)
+note = 0
+while note<64:
for fname in dirList:
pageElement = etree.SubElement(page, 'svglayer',
- note=str(note),
+ note=str(nums[note]+36),
file=sourcedir+"/"+fname)
note +=1
- if note>100:
+ if note>63:
break
file= open(sourcedir+".xml", "w")