Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2012-04-16 15:25:54 -04:00
commit d219c78744
1 changed files with 6 additions and 1 deletions

View File

@ -298,7 +298,12 @@ def test_file_playability(pathname):
"""
liquidsoap_found = subprocess.call("which liquidsoap", shell=True)
if liquidsoap_found == 0:
return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True)
#return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True)
#when there is an single apostrophe inside of a string quoted by apostrophes, we can only escape it by replace that apostrophe
#with '\''. This breaks the string into two, and inserts an escaped single quote in between them.
command = "liquidsoap -c 'output.dummy(single(\"%s\"))'" % pathname.replace("'", "'\\''")
return_code = subprocess.call(command, shell=True)
else:
return_code = 0