MCPcopy Create free account
hub / github.com/bspaans/python-mingus / from_Suite

Function from_Suite

mingus/extra/tablature.py:421–449  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

419
420
421def 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
452def _get_qsize(tuning, width):

Callers

nothing calls this directly

Calls 2

add_headersFunction · 0.85
from_CompositionFunction · 0.70

Tested by

no test coverage detected