Repository navigation
Conversation
- .upper() all notes in _make_scales (so Ab gets AB, but the first reads better in source) - remove frequencies.get(note.upper(), frequencies[note]), as now everything is upper - add .lower() to value lookup
WasabiFan
left a comment
There was a problem hiding this comment.
Minor changes requested.
It would be really nice to have unit tests for this (inject a fake beep method which just logs the args, play a song, then assert the beep args match the expected. Could generate that list from the previous version of this code and compare.) but only do that if you're interested in it -- we didn't have tests before and I don't expect you to have to add them.
| else: | ||
| freq = self._NOTE_FREQUENCIES[note.upper()] | ||
| self.beep('-f %d -l %d -D %d' % (freq, duration_ms, delay_ms)) | ||
| except KeyError as e: |
There was a problem hiding this comment.
this try...except around the whole thing is scary. Can we move it to the smallest relevant statement, probably the freq lookup?
There was a problem hiding this comment.
If you get a chance to change this I'll merge the PR.
|
We haven't heard from mvolfik for a few months so I grabbed his/her patch, addressed the code review comments and posted a new PR. Will give them credit or the patch in the commit message. |
Also fix ignoring note capitalization and add ignoring value capit.
EDIT: Sorry, I didn't know that # links don't work in title...
fixes #595