function name correction
This commit is contained in:
parent
c5210be289
commit
f7d8edba6a
1 changed files with 7 additions and 7 deletions
|
@ -91,11 +91,11 @@ def listFile(directory, pattern, recursive):
|
|||
return files_list
|
||||
|
||||
|
||||
def getFileName(path):
|
||||
def get_file_name(path):
|
||||
return os.path.splitext(os.path.basename(path))[0]
|
||||
|
||||
|
||||
def processArg(sysarg):
|
||||
def process_arg(sysarg):
|
||||
try:
|
||||
opts, args = getopt.getopt(
|
||||
sysarg, "hi:o:dp:a:v:2",
|
||||
|
@ -114,7 +114,7 @@ def processArg(sysarg):
|
|||
usage()
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt in ("-h, --help"):
|
||||
if opt in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit()
|
||||
if opt in ("-o", "--output"):
|
||||
|
@ -185,7 +185,7 @@ if __name__ == "__main__":
|
|||
if not exec_ffmpeg:
|
||||
print('ffmpeg not found, exiting')
|
||||
sys.exit(2)
|
||||
processArg(sys.argv[1:])
|
||||
process_arg(sys.argv[1:])
|
||||
if not params["file_input"]:
|
||||
print("you must specify a file / directory input")
|
||||
sys.exit(2)
|
||||
|
@ -201,14 +201,14 @@ if __name__ == "__main__":
|
|||
)
|
||||
for f in video_files:
|
||||
logging.info('batch encode | file %s to %s', f)
|
||||
encode_h264(f, params["file_output"] + getFileName(f))
|
||||
encode_h264(f, params["file_output"] + get_file_name(f))
|
||||
else:
|
||||
if os.path.isfile(params["file_input"]):
|
||||
if not params["file_output"]:
|
||||
params["file_output"] = getFileName(params["file_input"])
|
||||
params["file_output"] = get_file_name(params["file_input"])
|
||||
else:
|
||||
if(os.path.isdir(params["file_output"])):
|
||||
params["file_input"] += getFileName(params["file_input"])
|
||||
params["file_input"] += get_file_name(params["file_input"])
|
||||
logging.info('%s is a file', params["file_input"])
|
||||
encode_h264(params["file_input"], params["file_output"])
|
||||
else:
|
||||
|
|
Reference in a new issue