# this check belongs in Tags
if len(track_tags) != 1:
sys.stderr.write('bogus TRACKNUMBER %s: %s\n' % (track_tags, fn))
- return 3
+ return 4
track = int(track_tags[0])
for tag, values in tags._global.iteritems():
# Makes no sense to save TRACKNUMBER in coll_tags.
if len(args) != len(tags):
sys.stderr.write('expected %d flac files, got %d\n'
% (len(tags), len(args)))
- return 4
+ return 2
artist = tags.get_path_safe('ARTIST')
album = tags.get_path_safe('ALBUM')
try:
def main(args):
if len(args) < 3:
return usage()
- if args[1] == 'read':
- return do_read(args[2:])
- if args[1] == 'write':
- return do_write(args[2:])
+ try:
+ if args[1] == 'read':
+ return do_read(args[2:])
+ if args[1] == 'write':
+ return do_write(args[2:])
+ except SubprocessError, e:
+ sys.stderr.write('%s\n%s\n' % (e.stderr, e))
+ return 3
return usage()
def usage():