|
@ -17,7 +17,7 @@ def __usage(): |
|
|
return "python3 -m patacrep.songs.convert INPUTFORMAT OUTPUTFORMAT FILES" |
|
|
return "python3 -m patacrep.songs.convert INPUTFORMAT OUTPUTFORMAT FILES" |
|
|
|
|
|
|
|
|
def confirm(destname): |
|
|
def confirm(destname): |
|
|
while True |
|
|
while True: |
|
|
try: |
|
|
try: |
|
|
return yesno(input("File '{}' already exist. Overwrite? [yn] ".format(destname))) |
|
|
return yesno(input("File '{}' already exist. Overwrite? [yn] ".format(destname))) |
|
|
except ValueError: |
|
|
except ValueError: |
|
@ -62,7 +62,7 @@ if __name__ == "__main__": |
|
|
if not confirm(destname): |
|
|
if not confirm(destname): |
|
|
continue |
|
|
continue |
|
|
with open(destname, "w") as destfile: |
|
|
with open(destname, "w") as destfile: |
|
|
destfile.write(song.render(dest)) |
|
|
destfile.write(song.render()) |
|
|
|
|
|
|
|
|
except NotImplementedError: |
|
|
except NotImplementedError: |
|
|
LOGGER.error("Cannot convert to format '%s'.", dest) |
|
|
LOGGER.error("Cannot convert to format '%s'.", dest) |
|
|