Convert a mingus.containers.Suite to an ASCII tablature string, complete with headers. This function makes use of the Suite's title, subtitle, author, email and description attributes.
(suite, maxwidth=80)
| 419 | |
| 420 | |
| 421 | def from_Suite(suite, maxwidth=80): |
| 422 | """Convert a mingus.containers.Suite to an ASCII tablature string, complete |
| 423 | with headers. |
| 424 | |
| 425 | This function makes use of the Suite's title, subtitle, author, email |
| 426 | and description attributes. |
| 427 | """ |
| 428 | subtitle = ( |
| 429 | str(len(suite.compositions)) + " Compositions" |
| 430 | if suite.subtitle == "" |
| 431 | else suite.subtitle |
| 432 | ) |
| 433 | result = os.linesep.join( |
| 434 | add_headers( |
| 435 | maxwidth, |
| 436 | suite.title, |
| 437 | subtitle, |
| 438 | suite.author, |
| 439 | suite.email, |
| 440 | suite.description, |
| 441 | ) |
| 442 | ) |
| 443 | hr = maxwidth * "=" |
| 444 | n = os.linesep |
| 445 | result = n + hr + n + result + n + hr + n + n |
| 446 | for comp in suite: |
| 447 | c = from_Composition(comp, maxwidth) |
| 448 | result += c + n + hr + n + n |
| 449 | return result |
| 450 | |
| 451 | |
| 452 | def _get_qsize(tuning, width): |
nothing calls this directly
no test coverage detected