ethman / slakh-utils

Utilities for interfacing with Slakh2100
MIT License
59 stars 15 forks source link

Conflicting option string in submixes #2

Closed methevoz closed 5 years ago

methevoz commented 5 years ago

There seems to be an issue in the file submixes.py: The -s flag is used both for submix-definition-file and src-dir, which raises the following error when running the script:

Traceback (most recent call last):
  File "submixes/submixes.py", line 119, in <module>
    help='Directory of a single track to create a submix for.')
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1367, in add_argument
    return self._add_action(action)
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1730, in _add_action
    self._optionals._add_action(action)
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1571, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1381, in _add_action
    self._check_conflict(action)
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1520, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/home/mthevoz/miniconda3/envs/MSS/lib/python3.7/argparse.py", line 1529, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument -src-dir/-s: conflicting option string: -s

Changing one of the flags to something else fixes this.

Also, another issue:

File "submixes/submixes.py", line 124, in <module>
    if args.root_dir is None and args.src_dir is None:
AttributeError: 'Namespace' object has no attribute 'root_dir'

I'm guessing args.root_dir there and in the next few lines is supposed to refer to args.input_dir as defined in line 116? There seems to be a problem with the variables' names used in the parser here.

ethman commented 5 years ago

Great. I'll be able to get a fix for this in soon. Thanks for finding this.