Пример #1
0
 def renderV(self, token):
     if u'-' in token.value:  # Complex, eg 42-43
         self.cv = token.value[:token.value.index(u'-')].zfill(3)
     else:
         self.cv = token.value.zfill(3)
     if self.cv == u'001':
         if self.inSpanFlag:
             self.inSpanFlag = False
             self.write(u'</span>')
         self.inSpanFlag = True
         self.write(u'\n<span class="verse ' + books.readerName(self.cb) +
                    u"_" + str(int(self.cc)) + u"_" + str(int(self.cv)) +
                    u'" data-osis="' + books.readerName(self.cb) + u'.' +
                    str(int(self.cc)) + u"." + str(int(self.cv)) +
                    u'"><span class="verse-num v-1">' + token.value +
                    u'&nbsp;</span>')
     else:
         if self.inSpanFlag:
             self.inSpanFlag = False
             self.write(u'</span>')
         self.inSpanFlag = True
         self.write(u'\n<span class="verse ' + books.readerName(self.cb) +
                    u"_" + str(int(self.cc)) + u"_" + str(int(self.cv)) +
                    u'" data-osis="' + books.readerName(self.cb) + u'.' +
                    str(int(self.cc)) + u"." + str(int(self.cv)) +
                    u'"><span class="verse-num v-' + str(int(self.cv)) +
                    u'">' + token.value + u'&nbsp;</span>')
Пример #2
0
 def writeFooter(self):
     self.write(u'\n</div>')
     self.write(u'\n')
     self.write(u'\n\t</div>')
     self.write(u'\n\t<div data-role="footer">	')
     self.write(u'\n\t\t<div data-role="navbar">')
     self.write(u'\n\t\t\t<ul>')
     self.write(
         u'\n\t\t\t\t<li><a href="%(book)s.%(chapter)s.html" data-icon="arrow-l">%(fullbook)s %(chapter)s</a></li>'
         % {
             "fullbook": books.fullName(self.previousChapter()[0]),
             "book": books.readerName(self.previousChapter()[0]),
             "chapter": str(self.previousChapter()[1])
         })
     self.write(
         u'\n\t\t\t\t<li><a href="index.html" data-icon="home">Books</a></li>'
     )
     self.write(
         u'\n\t\t\t\t<li><a href="%(book)s.%(chapter)s.html" data-icon="arrow-r">%(fullbook)s %(chapter)s</a></li>'
         % {
             "fullbook": books.fullName(self.nextChapter()[0]),
             "book": books.readerName(self.nextChapter()[0]),
             "chapter": str(self.nextChapter()[1])
         })
     self.write(u'\n\t\t\t</ul>')
     self.write(u'\n\t\t</div>')
     self.write(u'\n\t</div>')
     self.write(u'\n</div>')
     self.write(u'\n</body>')
     self.write(u'\n</html>')
Пример #3
0
 def writeHeader(self, v=u''):
     self.write(
         u'<!--\nname: Open English Bible\ncontent: %(book)s %(chapter)s (OEB)\nauthor: Russell Allen\ndate:   4/6/2012 3:34:43 PM\n-->'
         % {
             "book": books.fullName(self.cb),
             "chapter": str(int(self.cc))
         })
     self.write(u'\n<!DOCTYPE html>')
     self.write(u'\n<html lang="en" dir="ltr">')
     self.write(u'\n<head>')
     self.write(u'\n\t<meta charset="utf-8" /> ')
     self.write(u'\n\t<title>%(book)s %(chapter)s (OEB)</title>' % {
         "book": books.fullName(self.cb),
         "chapter": str(int(self.cc))
     })
     self.write(
         u'\n\t<meta name="viewport" content="width=device-width, initial-scale=1" />'
     )
     self.write(u'\n\t<script src="../../../js/mobile.js"></script>')
     self.write(
         u'\n\t<link href="../../../css/mobile.css" rel="stylesheet" />')
     self.write(u'\n</head>')
     self.write(u'\n<body>')
     self.write(u'\n<div data-role="page">')
     self.write(u'\n\t<div data-role="header">')
     self.write(
         u'\n\t\t<a href="%(book)s.%(chapter)s.html" data-icon="arrow-l">%(fullbook)s %(chapter)s</a>'
         % {
             "fullbook": books.fullName(self.previousChapter()[0]),
             "book": books.readerName(self.previousChapter()[0]),
             "chapter": str(self.previousChapter()[1])
         })
     self.write(u'\n\t\t<h1>%(book)s %(chapter)s (OEB)</h1>' % {
         "book": books.fullName(self.cb),
         "chapter": str(int(self.cc))
     })
     self.write(
         u'\n\t\t<a href="%(book)s.%(chapter)s.html" data-icon="arrow-r">%(fullbook)s %(chapter)s</a>'
         % {
             "fullbook": books.fullName(self.nextChapter()[0]),
             "book": books.readerName(self.nextChapter()[0]),
             "chapter": str(self.nextChapter()[1])
         })
     self.write(u'\n\t</div>')
     self.write(u'\n\t<div data-role="content">')
     self.write(
         u'\n<div class="chapter OEB nt %(book)s_%(chapter)s" data-osis="%(book)s.%(chapter)s" lang="en" dir="ltr">'
         % {
             "book": books.readerName(self.cb),
             "chapter": str(int(self.cc))
         })
     self.write(u'\n<h2 class="chapter-num">' + v + u'</h2>\n<p>')
Пример #4
0
 def render_v(self, token):
     if u'-' in token.value: # Complex, eg 42-43
         self.cv = token.value[:token.value.index(u'-')].zfill(3)
     else:
         self.cv = token.value.zfill(3)
     if self.cv == u'001':
         if self.inSpanFlag:
                 self.inSpanFlag = False
                 self.write(u'</span>')
         self.inSpanFlag = True
         self.write(u'\n<span class="verse ' + books.readerName(self.cb) + u"_" + str(int(self.cc)) + u"_" + str(int(self.cv)) + u'" data-osis="' + books.readerName(self.cb) + u'.' + str(int(self.cc)) + u"." + str(int(self.cv)) + u'"><span class="verse-num v-1">' + token.value + u'&nbsp;</span>')
     else:
         if self.inSpanFlag:
                 self.inSpanFlag = False
                 self.write(u'</span>')
         self.inSpanFlag = True
         self.write(u'\n<span class="verse ' + books.readerName(self.cb) + u"_" + str(int(self.cc)) + u"_" + str(int(self.cv)) + u'" data-osis="' + books.readerName(self.cb) + u'.' + str(int(self.cc)) + u"." + str(int(self.cv)) + u'"><span class="verse-num v-' + str(int(self.cv)) + u'">' + token.value + u'&nbsp;</span>')
Пример #5
0
 def writeFooter(self):
     self.write(u'\n</div>')   
     self.write(u'\n')   
     self.write(u'\n\t</div>')   
     self.write(u'\n\t<div data-role="footer">	')   
     self.write(u'\n\t\t<div data-role="navbar">')   
     self.write(u'\n\t\t\t<ul>')   
     self.write(u'\n\t\t\t\t<li><a href="%(book)s.%(chapter)s.html" data-icon="arrow-l">%(fullbook)s %(chapter)s</a></li>' % {"fullbook": books.fullName(self.previousChapter()[0]), "book": books.readerName(self.previousChapter()[0]), "chapter": str(self.previousChapter()[1])})
     self.write(u'\n\t\t\t\t<li><a href="index.html" data-icon="home">Books</a></li>')   
     self.write(u'\n\t\t\t\t<li><a href="%(book)s.%(chapter)s.html" data-icon="arrow-r">%(fullbook)s %(chapter)s</a></li>' % {"fullbook": books.fullName(self.nextChapter()[0]), "book": books.readerName(self.nextChapter()[0]), "chapter": str(self.nextChapter()[1])})
     self.write(u'\n\t\t\t</ul>')   
     self.write(u'\n\t\t</div>')   
     self.write(u'\n\t</div>')   
     self.write(u'\n</div>')   
     self.write(u'\n</body>')   
     self.write(u'\n</html>')   
Пример #6
0
 def writeHeader(self, v=u''):
     self.write(u'<!--\nname: Open English Bible\ncontent: %(book)s %(chapter)s (OEB)\nauthor: Russell Allen\ndate:   4/6/2012 3:34:43 PM\n-->' % {"book": books.fullName(self.cb), "chapter": str(int(self.cc))})
     self.write(u'\n<!DOCTYPE html>')
     self.write(u'\n<html lang="en" dir="ltr">')
     self.write(u'\n<head>')
     self.write(u'\n\t<meta charset="utf-8" /> ')
     self.write(u'\n\t<title>%(book)s %(chapter)s (OEB)</title>' % {"book": books.fullName(self.cb), "chapter": str(int(self.cc))})
     self.write(u'\n\t<meta name="viewport" content="width=device-width, initial-scale=1" />')
     self.write(u'\n\t<script src="../../../js/mobile.js"></script>')
     self.write(u'\n\t<link href="../../../css/mobile.css" rel="stylesheet" />')
     self.write(u'\n</head>')
     self.write(u'\n<body>')
     self.write(u'\n<div data-role="page">')
     self.write(u'\n\t<div data-role="header">')
     self.write(u'\n\t\t<a href="%(book)s.%(chapter)s.html" data-icon="arrow-l">%(fullbook)s %(chapter)s</a>' % {"fullbook": books.fullName(self.previousChapter()[0]), "book": books.readerName(self.previousChapter()[0]), "chapter": str(self.previousChapter()[1])})
     self.write(u'\n\t\t<h1>%(book)s %(chapter)s (OEB)</h1>' % {"book": books.fullName(self.cb), "chapter": str(int(self.cc))})
     self.write(u'\n\t\t<a href="%(book)s.%(chapter)s.html" data-icon="arrow-r">%(fullbook)s %(chapter)s</a>' % {"fullbook": books.fullName(self.nextChapter()[0]), "book": books.readerName(self.nextChapter()[0]), "chapter": str(self.nextChapter()[1])})
     self.write(u'\n\t</div>')
     self.write(u'\n\t<div data-role="content">')
     self.write(u'\n<div class="chapter OEB nt %(book)s_%(chapter)s" data-osis="%(book)s.%(chapter)s" lang="en" dir="ltr">' % {"book": books.readerName(self.cb), "chapter": str(int(self.cc))})
     self.write(u'\n<h2 class="chapter-num">' + v + u'</h2>\n<p>')   
Пример #7
0
 def openNextFile(self):
     self.f = open(self.outputDir + u'/' + books.readerName(self.cb) + u'.' + str(int(self.cc)) + u'.html', 'w')