def __init__(self, path_to, title="\ding{72}"):
     self.path_to = path_to
     self.title = title
     self.tex = None
     self.base = ENCAPSULATOR_BASE
     self.package_code = get_contents("package_code.tex")
     self.content = get_contents(self.path_to)
Esempio n. 2
0
def get_poem(filename):
    """ Return the contents of a file, or return a placeholder if
    necessary. """
    if filename == None:
        return get_contents("poems/placeholder_poem.tex")
    else:
        return get_contents("poems/book1/" + filename)
Esempio n. 3
0
 def __init__(self):
     self.tex = None
     self.base = get_contents(PATH_TO_BASE)
     self.package_code = get_contents("package_code.tex")
     self.autumnal1 = get_poem(which_poems.autumnal1)
     self.autumnal2 = get_poem(which_poems.autumnal2)
     self.autumnal3 = get_poem(which_poems.autumnal3)
     self.hibernal1 = get_poem(which_poems.hibernal1)
     self.hibernal2 = get_poem(which_poems.hibernal2)
     self.hibernal3 = get_poem(which_poems.hibernal3)
     self.vernal1 = get_poem(which_poems.vernal1)
     self.vernal2 = get_poem(which_poems.vernal2)
     self.vernal3 = get_poem(which_poems.vernal3)
     self.aestival1 = get_poem(which_poems.aestival1)
     self.aestival2 = get_poem(which_poems.aestival2)
     self.aestival3 = get_poem(which_poems.aestival3)
     self.autumnal_prose = get_prose("autumnal.tex")
     self.hibernal_prose = get_prose("hibernal.tex")
     self.vernal_prose = get_prose("vernal.tex")
     self.aestival_prose = get_prose("aestival.tex")
     self.autumnal_image = get_image("autumnal." + AUTUMNAL_IMAGE_EXT)
     self.hibernal_image = get_image("hibernal." + HIBERNAL_IMAGE_EXT)
     self.vernal_image = get_image("vernal." + VERNAL_IMAGE_EXT)
     self.aestival_image = get_image("aestival." + AESTIVAL_IMAGE_EXT)
Esempio n. 4
0
 def __init__(self, filename):
     self.filename = filename
     self.title = self.parse_title()
     self.body = get_contents("poems/book2/"+filename)
     self.printout = self.get_printout()
Esempio n. 5
0
 def __init__(self):
     self.tex = None
     self.base = get_contents("book2_base.tex")
     self.package_code = get_contents("package_code.tex")
Esempio n. 6
0
def get_prose(filename):
    """ Another helper function. """
    if os.path.exists("prose/" + filename):
        return get_contents("prose/" + filename)
    else:
        return get_contents("prose/placeholder_prose.tex")