Example #1
0
paragraph._insert_between(user_field_get, u"The", u"is: ")

# 8- Page number
# --------------

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

text1 = u'The current page is: '
text2 = u'The previous page is: '
text3 = u'The next page is: '
text4 = u'The total page number is: '

paragraph = odf_create_paragraph(text1, style=u"Standard")
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: ")
Example #2
0

# 6- Page number
# --------------

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

text1 = u'The current page is: '
text2 = u'The previous page is: '
text3 = u'The next page is: '
text4 = u'The total page number is: '

paragraph = odf_create_paragraph(text1, style=u"Standard")
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: ")
 def test_create_page_number_complex(self):
     page_number = odf_create_page_number_variable(select_page='next',
                                                   page_adjust=1)
     expected = ('<text:page-number text:select-page="next" '
                 'text:page-adjust="1"/>')
     self.assertEqual(page_number.serialize(), expected)
 def test_create_page_number(self):
     page_number = odf_create_page_number_variable()
     expected = '<text:page-number text:select-page="current"/>'
     self.assertEqual(page_number.serialize(), expected)
Example #5
0
 def test_create_page_number_complex(self):
     page_number = odf_create_page_number_variable(select_page='next',
                                                   page_adjust=1)
     expected = ('<text:page-number text:select-page="next" '
                 'text:page-adjust="1"/>')
     self.assertEqual(page_number.serialize(), expected)
Example #6
0
 def test_create_page_number(self):
     page_number = odf_create_page_number_variable()
     expected = '<text:page-number text:select-page="current"/>'
     self.assertEqual(page_number.serialize(), expected)