Helper function that builds the first few characters of every bar.
(tuning, padding=2)
| 28 | |
| 29 | |
| 30 | def begin_track(tuning, padding=2): |
| 31 | """Helper function that builds the first few characters of every bar.""" |
| 32 | # find longest shorthand tuning base |
| 33 | names = [x.to_shorthand() for x in tuning.tuning] |
| 34 | basesize = len(max(names)) + 3 |
| 35 | |
| 36 | # Build result |
| 37 | res = [] |
| 38 | for x in names: |
| 39 | r = " %s" % x |
| 40 | spaces = basesize - len(r) |
| 41 | r += " " * spaces + "||" + "-" * padding |
| 42 | res.append(r) |
| 43 | return res |
| 44 | |
| 45 | |
| 46 | def add_headers( |
no test coverage detected