def get_namespace(homme=False): return {u"titre": u"Test de STL no 1", u"date": date.today().strftime(u"%d/%m/%Y"), u"homme": homme, u"genre": u"M." if homme else u"Mme", u"nom": u"Michu", u"enum1": {'label': u"Revenu", 'value': 1234.56}, u"enum2": {'label': u"Âge", 'value': 65}, u"couleur": u"rouge", u"gras": u"gras comme un moine", u"élément": odf_create_span(u"élément", style='T2')}
def get_namespace(homme=False): return {"titre": "Test de STL no 1", "date": date.today().strftime("%d/%m/%Y"), "homme": homme, "genre": "M." if homme else "Mme", "nom": "Michu", "enum1": {'label': "Revenu", 'value': 1234.56}, "enum2": {'label': "Âge", 'value': 65}, "couleur": "rouge", "gras": "gras comme un moine", "élément": odf_create_span("élément", style='T2')}
def _convert_style_like(node, context, style_name): # Create the span span = odf_create_span(style=style_name) context["top"].append_element(span) # Save the current top old_top = context["top"] # Convert context["top"] = span for child in node: convert_node(child, context) # And restore the top context["top"] = old_top
def test_insert_span(self): body = self.body.clone() span = odf_create_span('my_style', u'my text') paragraph = body.get_paragraph(position=0) paragraph.append(span)
def test_create_span(self): span = odf_create_span(u'my text', style='my_style') expected = ('<text:span text:style-name="my_style">' 'my text' '</text:span>') self.assertEqual(span.serialize(), expected)