diff --git a/patacrep/content/section.py b/patacrep/content/section.py index e2ecfd32..2b56975e 100755 --- a/patacrep/content/section.py +++ b/patacrep/content/section.py @@ -37,8 +37,8 @@ def parse(keyword, argument, contentlist, config): their starred versions "part*", "chapter*", ... , "subparagraph*"): the section to use; - argument: unused; - - contentlist: a list of one or two strings, which are the names (short - and long) of the section; + - contentlist: a list of one or two strings, which are the names (long + and short) of the section; - config: configuration dictionary of the current songbook. """ if (keyword not in KEYWORDS) and (len(contentlist) != 1): diff --git a/test/test_content/sections_short.control b/test/test_content/sections_short.control new file mode 100644 index 00000000..a0dd3600 --- /dev/null +++ b/test/test_content/sections_short.control @@ -0,0 +1 @@ +["section:(tradi)Traditional", "exsong.sg", "section:Example", "texsong.tsg", "chordpro.csg", "exsong.sg"] \ No newline at end of file diff --git a/test/test_content/sections_short.source b/test/test_content/sections_short.source new file mode 100644 index 00000000..38693929 --- /dev/null +++ b/test/test_content/sections_short.source @@ -0,0 +1,6 @@ +[["section", "Traditional", "tradi"], + "exsong.sg", + ["section", "Example"], + "texsong.tsg", + "chordpro.csg", + "exsong.sg"] \ No newline at end of file diff --git a/test/test_content/test_content.py b/test/test_content/test_content.py index 3cec60b9..8b279793 100644 --- a/test/test_content/test_content.py +++ b/test/test_content/test_content.py @@ -75,7 +75,10 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): songpath = os.path.join(os.path.dirname(__file__), 'datadir', 'songs') return files.path2posix(files.relpath(elem.song.fullpath, songpath)) elif isinstance(elem, Section): - return "{}:{}".format(elem.keyword, elem.name) + if elem.short is None: + return "{}:{}".format(elem.keyword, elem.name) + else: + return "{}:({}){}".format(elem.keyword, elem.short, elem.name) else: raise Exception(elem)