beets/test/rsrc/convert_stub.py
2016-05-31 17:50:54 -07:00

20 lines
476 B
Python
Executable file

#!/usr/bin/env python
"""A tiny tool used to test the `convert` plugin. It copies a file and appends
a specified text tag.
"""
import sys
def convert(in_file, out_file, tag):
"""Copy `in_file` to `out_file` and append the string `tag`.
"""
with open(out_file, 'wb') as out_f:
with open(in_file, 'rb') as in_f:
out_f.write(in_f.read())
out_f.write(tag)
if __name__ == '__main__':
convert(sys.argv[1], sys.argv[2], sys.argv[3])