浏览代码

Moved cueconvert path to begining.

Removed whitespace.
Added main().
master
Svend Sorensen 19 年前
父节点
当前提交
afb3a422a5
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. +9
    -4
      extras/cueconvert.cgi

+ 9
- 4
extras/cueconvert.cgi 查看文件

@@ -1,13 +1,15 @@
#!/usr/bin/env python

# cueconvert.cgi - use HTML form to drive cueconvert
# ./cueconvert should be the cueconvert binary, or a link to it

import os
import cgi
# error reporting
#import cgitb; cgitb.enable()

# cueconvert path
CUECONVERT = "./cueconvert"

def print_form(iformat, oformat, text, errors):
# input format radio buttons
# one "" and one "checked"
@@ -66,7 +68,7 @@ def convert(iformat, oformat, text):

returns converted text, and any error messages"""

command = "./cueconvert"
command = CUECONVERT

# append flags to command
if iformat == "cue":
@@ -86,10 +88,10 @@ def convert(iformat, oformat, text):
errors = efile.read()
ofile.close()
efile.close()
return text, errors

if __name__ == '__main__':
def main():
iformat = "cue" # input format
oformat = "toc" # output format
text = "" # input file content
@@ -106,3 +108,6 @@ if __name__ == '__main__':
iformat, oformat = oformat, iformat

print_form(iformat, oformat, text, errors)

if __name__ == '__main__':
main()

正在加载...
取消
保存