Exemple #1
0
body.append(paragraph)
paragraph.insert_variable(odf_create_page_number_variable(), u"is: ")

paragraph = odf_create_paragraph(text2, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(
    odf_create_page_number_variable(select_page='previous'), u"is: ")

paragraph = odf_create_paragraph(text3, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_page_number_variable(select_page='next'),
                          u"is: ")

paragraph = odf_create_paragraph(text4, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_page_count_variable(), u"is: ")

# 9- Date
# -------

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

text1 = u'A fixed date: '
text2 = u'Today: '

paragraph = odf_create_paragraph(text1, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(
    odf_create_date_variable(date(2009, 7, 20), fixed=True), u"date: ")
 def test_create_page_count(self):
     page_count = odf_create_page_count_variable()
     expected = '<text:page-count/>'
     self.assertEqual(page_count.serialize(), expected)
Exemple #3
0
body.append(paragraph)
paragraph.insert_variable(odf_create_page_number_variable(), u"is: ")

paragraph = odf_create_paragraph(text2, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_page_number_variable(select_page='previous'),
        u"is: ")

paragraph = odf_create_paragraph(text3, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_page_number_variable(select_page='next'),
        u"is: ")

paragraph = odf_create_paragraph(text4, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_page_count_variable(), u"is: ")


# 7- Date
# -------

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

text1 = u'A fixed date: '
text2 = u'Today: '

paragraph = odf_create_paragraph(text1, style=u"Standard")
body.append(paragraph)
paragraph.insert_variable(odf_create_date_variable(date(2009, 7, 20),
    fixed=True), u"date: ")
 def test_create_page_count(self):
     page_count = odf_create_page_count_variable()
     expected = '<text:page-count/>'
     self.assertEqual(page_count.serialize(), expected)