trevorbaca / baca

Trevor Bača's Abjad library.
8 stars 3 forks source link

Add human-readable selector messaging #44

Open trevorbaca opened 4 years ago

trevorbaca commented 4 years ago

Now:

Removing harmony/segments/Q/__make_segment_pdf__.py ...
Traceback (most recent call last):
  File "/Users/trevorbaca/abjad/abjad/utilities/Expression.py", line 580, in _ev
    result = eval(statement, globals_)
  File "<string>", line 1, in <module>
  File "/Users/trevorbaca/baca/baca/classes.py", line 5089, in pleaf
    return self.pleaves(exclude=exclude, grace=grace)[n]
  File "/Users/trevorbaca/abjad/abjad/core/Selection.py", line 207, in __getitem
    result = self.items.__getitem__(argument)
IndexError: tuple index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/trevorbaca/Scores/harmony/harmony/segments/Q/__make_segment_pdf__
    segment_directory=segment_directory,
  File "/Users/trevorbaca/baca/baca/segmentmaker.py", line 6728, in run
    command_count = self._call_commands()
  File "/Users/trevorbaca/baca/baca/segmentmaker.py", line 1692, in _call_comman
    command(selection, runtime)
  File "/Users/trevorbaca/baca/baca/scoping.py", line 298, in __call__
    return self._call(argument=argument)
  File "/Users/trevorbaca/baca/baca/commands.py", line 1528, in _call
    argument = self.selector(argument)
  File "/Users/trevorbaca/abjad/abjad/utilities/Expression.py", line 296, in __c
    result = expression._evaluate(result, **keywords)
  File "/Users/trevorbaca/abjad/abjad/utilities/Expression.py", line 584, in _ev
    raise type(exception)(message)
IndexError: evaluable statement '__argument_0.pleaf(0)' raises 'tuple index out 

Find a way to raise human-readable input when selectors fail to select user-requested components.