CC-2016: Rearrange python scripts for reusability

-moved files
This commit is contained in:
martin 2011-03-24 00:00:46 -04:00
parent f9c8a7cc11
commit 5c8719d90c
70 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,36 @@
# Register the cut protocol
def cue_protocol(arg,delay)
# The extraction program
# cut_file = "#{configure.libdir}/cut-file.py"
cue_script = "./cue_file.py"
# Parse args
ret = string.extract(pattern="cue_in=(\d+)",arg)
start =
if list.length(ret) == 0 then
"0"
else
ret["1"]
end
ret = string.extract(pattern="cue_out=(\d+)",arg)
stop =
if list.length(ret) == 0 then
"0"
else
ret["1"]
end
ret = string.extract(pattern=":(.*)$",arg)
uri =
if list.length(ret) == 0 then
""
else
ret["1"]
end
x = get_process_lines("#{cue_script} #{quote(uri)} #{start} #{stop}")
if list.hd(x) != "" then
([list.hd(x)],[])
else
([uri],[])
end
end
add_post_processor("cue_file", temporary=true, cue_protocol)