# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py
# class Text(BaseClass.Base):
# class CreditText(Text):
# class Lyric(Text):
# class Direction(Text):
# class RehearsalMark(Direction):
# class Forward(Direction):
# class RepeatSign(Direction):
# class Line(Direction):
# class OctaveShift(Line):
# class WavyLine(Line):
# class Pedal(Line):
# class Bracket(Line):
# class Metronome(Direction):
# class Dynamic(Direction):
# class Wedge(Dynamic):
# class Slur(Direction):
#     def __init__(self, **kwargs):
#     def get(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def get_detail(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
# 
# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Meta.py
# class Meta(BaseClass.Base):
# 
#     """
#     Class which holds information about the piece.
# 
# 
#     # Optional inputs
# 
#     - title: name of the piece
# 
#     - composer
# 
#     - copyright: company or tag line who owns the copyright
#     """
# 
#     def __init__(self, **kwargs):
#         BaseClass.Base.__init__(self)
#         if "title" in kwargs:
#             if kwargs["title"] is not None:
#                 self.title = kwargs["title"]
#         if "composer" in kwargs:
#             if kwargs["composer"] is not None:
#                 self.composer = kwargs["composer"]
#         if "copyright" in kwargs:
#             if kwargs["copyright"] is not None:
#                 self.copyright = kwargs["copyright"]
# 
#     def EscapeQuotes(self, value):
#         list_of_string = list(value)
#         output = []
#         for item in list_of_string:
#             if item == "\"":
#                 output.append("\\")
#             output.append(item)
#         return "".join(output)
# 
#     def toLily(self):
#         val = "\header {\n"
#         if hasattr(self, "title") and self.title is not None:
#             val += "title = \"" + self.EscapeQuotes(self.title) + "\"\n"
#         if hasattr(self, "composer") and self.composer is not None:
#             val += "composer = \"" + self.EscapeQuotes(self.composer) + "\"\n"
#         if hasattr(self, "copyright"):
#             val += "tagline = \"" + self.EscapeQuotes(self.copyright) + "\""
#         val += "\n}"
#         if hasattr(self, "pageNum"):
#             if self.pageNum:
#                 val += "\n \paper {\n print-page-number = True \n}\n\n"
#         if hasattr(self, "credits"):
#             val += "\\markuplist {"
#             for credit in self.credits:
#                 val += "\n\\vspace #0.5\n"
#                 val += "\n" + credit.toLily()
#             val += " }"
# 
#         return val
# 
#     def AddCredit(self, credit):
#         if not hasattr(self, "credits"):
#             self.credits = []
#         self.credits.append(credit)
# 
# Path: MuseParse/tests/testLilyMethods/lily.py
# class Lily(unittest.TestCase):
# 
#     def setUp(self):
#         self.compile = False
#         self.wrappers = []
# 
#     def testValue(self):
#         if hasattr(self, "lilystring"):
#             if hasattr(self, "item"):
#                 self.assertEqual(self.lilystring, self.item.toLily())
# 
#     def testCompilation(self):
#         if hasattr(self, "compile") and self.compile is True:
# 
#             filepath = expanduser("~")
#             script = ''
#             if sys.platform == 'darwin':
#                 script = os.path.join(filepath, 'bin', 'lilypond')
#             filepath = os.path.join(filepath, self.name)
#             if self.compile and hasattr(self, "item"):
#                 if os.path.exists(filepath + ".pdf"):
#                     os.remove(filepath + ".pdf")
# 
#                 ly = LilypondOutput.LilypondRenderer(
#                     self.item, filepath + ".xml", script)
#                 if hasattr(self, "wrappers"):
#                     ly.run(wrappers=self.wrappers)
#                 else:
#                     ly.run()
#                 self.assertTrue(os.path.exists(filepath + ".pdf"))


from MuseParse.classes.ObjectHierarchy.ItemClasses import Directions, Meta
from MuseParse.tests.testLilyMethods.lily import Lily


class testMeta(Lily):

    def setUp(self):
        self.item = Meta.Meta()
        self.lilystring = "\header {\n\n}"


class testMetaTitle(Lily):

    def setUp(self):
        self.item = Meta.Meta(title="hello world")
        self.lilystring = "\header {\ntitle = \"hello world\"\n\n}"


class testMetaComposer(Lily):

    def setUp(self):
        self.item = Meta.Meta(composer="Danny Brown")
        self.lilystring = "\header {\ncomposer = \"Danny Brown\"\n\n}"


class testMetaCreds(Lily):

    def setUp(self):

# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py
# class Text(BaseClass.Base):
# class CreditText(Text):
# class Lyric(Text):
# class Direction(Text):
# class RehearsalMark(Direction):
# class Forward(Direction):
# class RepeatSign(Direction):
# class Line(Direction):
# class OctaveShift(Line):
# class WavyLine(Line):
# class Pedal(Line):
# class Bracket(Line):
# class Metronome(Direction):
# class Dynamic(Direction):
# class Wedge(Dynamic):
# class Slur(Direction):
#     def __init__(self, **kwargs):
#     def get(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def get_detail(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
#     def __init__(self, **kwargs):
#     def toLily(self):
# 
# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Meta.py
# class Meta(BaseClass.Base):
# 
#     """
#     Class which holds information about the piece.
# 
# 
#     # Optional inputs
# 
#     - title: name of the piece
# 
#     - composer
# 
#     - copyright: company or tag line who owns the copyright
#     """
# 
#     def __init__(self, **kwargs):
#         BaseClass.Base.__init__(self)
#         if "title" in kwargs:
#             if kwargs["title"] is not None:
#                 self.title = kwargs["title"]
#         if "composer" in kwargs:
#             if kwargs["composer"] is not None:
#                 self.composer = kwargs["composer"]
#         if "copyright" in kwargs:
#             if kwargs["copyright"] is not None:
#                 self.copyright = kwargs["copyright"]
# 
#     def EscapeQuotes(self, value):
#         list_of_string = list(value)
#         output = []
#         for item in list_of_string:
#             if item == "\"":
#                 output.append("\\")
#             output.append(item)
#         return "".join(output)
# 
#     def toLily(self):
#         val = "\header {\n"
#         if hasattr(self, "title") and self.title is not None:
#             val += "title = \"" + self.EscapeQuotes(self.title) + "\"\n"
#         if hasattr(self, "composer") and self.composer is not None:
#             val += "composer = \"" + self.EscapeQuotes(self.composer) + "\"\n"
#         if hasattr(self, "copyright"):
#             val += "tagline = \"" + self.EscapeQuotes(self.copyright) + "\""
#         val += "\n}"
#         if hasattr(self, "pageNum"):
#             if self.pageNum:
#                 val += "\n \paper {\n print-page-number = True \n}\n\n"
#         if hasattr(self, "credits"):
#             val += "\\markuplist {"
#             for credit in self.credits:
#                 val += "\n\\vspace #0.5\n"
#                 val += "\n" + credit.toLily()
#             val += " }"
# 
#         return val
# 
#     def AddCredit(self, credit):
#         if not hasattr(self, "credits"):
#             self.credits = []
#         self.credits.append(credit)
# 
# Path: MuseParse/tests/testLilyMethods/lily.py
# class Lily(unittest.TestCase):
# 
#     def setUp(self):
#         self.compile = False
#         self.wrappers = []
# 
#     def testValue(self):
#         if hasattr(self, "lilystring"):
#             if hasattr(self, "item"):
#                 self.assertEqual(self.lilystring, self.item.toLily())
# 
#     def testCompilation(self):
#         if hasattr(self, "compile") and self.compile is True:
# 
#             filepath = expanduser("~")
#             script = ''
#             if sys.platform == 'darwin':
#                 script = os.path.join(filepath, 'bin', 'lilypond')
#             filepath = os.path.join(filepath, self.name)
#             if self.compile and hasattr(self, "item"):
#                 if os.path.exists(filepath + ".pdf"):
#                     os.remove(filepath + ".pdf")
# 
#                 ly = LilypondOutput.LilypondRenderer(
#                     self.item, filepath + ".xml", script)
#                 if hasattr(self, "wrappers"):
#                     ly.run(wrappers=self.wrappers)
#                 else:
#                     ly.run()
#                 self.assertTrue(os.path.exists(filepath + ".pdf"))


# Path: MuseParse/tests/testLilyMethods/testMeta.py
from MuseParse.classes.ObjectHierarchy.ItemClasses import Directions, Meta
from MuseParse.tests.testLilyMethods.lily import Lily



class testMeta(Lily):

    def setUp(self):
        self.item = Meta.Meta()
        self.lilystring = "\header {\n\n}"


class testMetaTitle(Lily):

    def setUp(self):
        self.item = Meta.Meta(title="hello world")
        self.lilystring = "\header {\ntitle = \"hello world\"\n\n}"


class testMetaComposer(Lily):

    def setUp(self):
        self.item = Meta.Meta(composer="Danny Brown")
        self.lilystring = "\header {\ncomposer = \"Danny Brown\"\n\n}"


class testMetaCreds(Lily):

    def setUp(self):

        self.item = Meta.Meta()