Exemplo n.º 1
0
paragraph.insert_variable(
    odf_create_time_variable(time(19, 30), time_adjust=timedelta(hours=1)),
    u"hour: ")

# 11- Chapter
# -----------

heading = odf_create_heading(1, text=u'Chapter')
body.append(heading)

text = u'The current chapter is: '

paragraph = odf_create_paragraph(text, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(
    odf_create_chapter_variable(display='number-and-name'), u"is: ")

# 11- Filename
# ------------

heading = odf_create_heading(1, text=u'Filename')
body.append(heading)

text = u'The current file name is: '

paragraph = odf_create_paragraph(text, style=u"Standard")
body.append(paragraph)
paragraph._insert_between(odf_create_filename_variable(), u"The", u"is: ")

# Save
# ----
Exemplo n.º 2
0
body.append(paragraph)
paragraph.insert_variable(odf_create_time_variable(time(19, 30),
    time_adjust=timedelta(hours=1)), u"hour: ")


# 9- Chapter
# -----------

heading = odf_create_heading(1, text=u'Chapter')
body.append(heading)

text = u'The current chapter is: '

paragraph = odf_create_paragraph(text, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_chapter_variable(display='number-and-name'),
        u"is: ")


# 10- Filename
# ------------

heading = odf_create_heading(1, text=u'Filename')
body.append(heading)

text = u'The current file name is: '

paragraph = odf_create_paragraph(text, style=u"Standard")
body.append(paragraph)
paragraph._insert_between(odf_create_filename_variable(), u"The", u"is: ")
Exemplo n.º 3
0
 def test_create_chapter_complex(self):
     chapter = odf_create_chapter_variable(display='number-and-name',
                                           outline_level=1)
     expected = ('<text:chapter text:display="number-and-name" '
                   'text:outline-level="1"/>')
     self.assertEqual(chapter.serialize(), expected)
Exemplo n.º 4
0
 def test_create_chapter(self):
     chapter = odf_create_chapter_variable()
     expected = '<text:chapter text:display="name"/>'
     self.assertEqual(chapter.serialize(), expected)
Exemplo n.º 5
0
 def test_create_chapter_complex(self):
     chapter = odf_create_chapter_variable(display='number-and-name',
                                           outline_level=1)
     expected = ('<text:chapter text:display="number-and-name" '
                   'text:outline-level="1"/>')
     self.assertEqual(chapter.serialize(), expected)
Exemplo n.º 6
0
 def test_create_chapter(self):
     chapter = odf_create_chapter_variable()
     expected = '<text:chapter text:display="name"/>'
     self.assertEqual(chapter.serialize(), expected)