Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(59)  |  Call(59)  |  Derive(0)  |  Import(0)

src/e/r/erp5-HEAD/product/ERP5OOo/transforms/oood_commandtransform.py   erp5(Download)
    """
    builder = OOoBuilder(data)
    content = builder.extract('content.xml')
    xml_doc = etree.XML(content)
    image_tag_list = xml_doc.xpath('//*[name() = "draw:image"]')

src/e/r/erp5-HEAD/product/ERP5OOo/transforms/odt_to_xml.py   erp5(Download)
  def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
    data = str(orig)
    doc = OOOdCommandTransform(context, filename, data, self.inputs[0])
    builder = OOoBuilder(doc)
    content = builder.extract('content.xml')

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testFormPrintoutAsODT.py   erp5(Download)
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("Foo title!") > 0)
    self.assertEqual(request.RESPONSE.getHeader('content-type'),
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("Changed Title!") > 0)
    self._validate(odf_document)
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertFalse(content_xml.find("you cannot find") > 0)
    self._validate(odf_document)
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("call!") > 0)
    self.assertEqual(request.RESPONSE.getHeader('content-type'), 'text/html')
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("Fran├žais") > 0)
    self._validate(odf_document)

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testFormPrintoutAsODG.py   erp5(Download)
    # extract content.xml from original odg document
    original_doc_builder = OOoBuilder(original_file_content)
    original_content_xml = original_doc_builder.extract("content.xml")
    # get style of the title in the orignal test document
    original_document_style_dict = self.getStyleDictFromFieldName(original_content_xml,
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    final_document_style_dict = self.getStyleDictFromFieldName(content_xml,
        'my_title')
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("Changed Title!") > 0)
    self._validate(odf_document)
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertFalse(content_xml.find("you cannot find") > 0)
    self._validate(odf_document)
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("call!") > 0)
    # when just call FormPrintout, it does not change content-type

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testOOoDynamicStyle.py   erp5(Download)
 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(len(styles_xml_body) > 0)
    # 'Style sheet ja' text is in the odt document header, 
    self._validate(response.getBody()) 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(styles_xml_body.find('Style sheet en') > 0)
 
    self._validate(response.getBody()) 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(len(styles_xml_body) > 0)
    self.assertTrue(styles_xml_body.find('Style sheet ja') > 0)
    self._validate(response.getBody()) 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(len(styles_xml_body) > 0)
    self.assertTrue(styles_xml_body.find('Style sheet en') > 0)

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testDms.py   erp5(Download)
    failure_message = 'Expected image not found in ODF zipped archive'
    # fetch image from zipped archive content then compare with ERP5 Image
    self.assertEqual(builder.extract('Pictures/%s.jpeg' % image_count),
                      image.getData(), failure_message)
 
    # fetch image from zipped archive content
    # then compare with resized ERP5 Image
    self.assertEqual(builder.extract('Pictures/%s.jpeg' % image_count),
                      converted_image, failure_message)
 
    # fetch image from zipped archive content
    # then compare with resized ERP5 Image
    self.assertEqual(builder.extract('Pictures/%s.png' % image_count),
                      converted_image, failure_message)
 

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testIngestion.py   erp5(Download)
    newcontent = document.getBaseData()
    builder = OOoBuilder(newcontent)
    xml_tree = etree.fromstring(builder.extract('meta.xml'))
    title = xml_tree.find('*/{%s}title' % xml_tree.nsmap['dc']).text
    self.assertEqual(title, 'another title')