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

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

src/e/r/erp5-HEAD/product/ERP5OOo/transforms/oood_commandtransform.py   erp5(Download)
from zLOG import LOG
 
from Products.ERP5OOo.OOoUtils import OOoBuilder
import re
from lxml import etree
    - data: zipped archive content
    """
    builder = OOoBuilder(data)
    content = builder.extract('content.xml')
    xml_doc = etree.XML(content)

src/e/r/erp5-HEAD/product/ERP5OOo/transforms/odt_to_xml.py   erp5(Download)
from oood_commandtransform import OOOdCommandTransform, OOoDocumentDataStream
from zLOG import LOG
from Products.ERP5OOo.OOoUtils import OOoBuilder
import re
 
  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/FormPrintout.py   erp5(Download)
from Products.ERP5Form.ReportBox import ReportBox
from Products.ERP5Form.ImageField import ImageField
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.CMFCore.exceptions import AccessControl_Unauthorized
from Acquisition import Implicit, aq_base
 
    # Create a new builder instance
    ooo_builder = OOoBuilder(ooo_document)
    self.odf_existent_name_list = ooo_builder.getNameList()
 

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testFormPrintoutAsODT.py   erp5(Download)
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.MimetypesRegistry.mime_types.magic import guessMime
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5Type.tests.utils import FileUpload
    odf_document = foo_printout.index_html(REQUEST=request)
    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)
    odf_document = foo_printout.index_html(REQUEST=request)
    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)
    odf_document = foo_printout.index_html(REQUEST=request)
    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)
    odf_document = foo_printout(request, batch_mode=True) # call
    self.assertTrue(odf_document is not None)
    builder = OOoBuilder(odf_document)
    content_xml = builder.extract("content.xml")
    self.assertTrue(content_xml.find("call!") > 0)

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testFormPrintoutAsODG.py   erp5(Download)
from Products.ERP5OOo.tests.TestFormPrintoutMixin import TestFormPrintoutMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5Type.tests.utils import FileUpload
 
    # 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
    odf_document = foo_printout.index_html(request)
    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,
    odf_document = foo_printout.index_html(request)
    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)
    odf_document = foo_printout.index_html(request)
    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)

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testOOoDynamicStyle.py   erp5(Download)
from zLOG import LOG
from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5OOo.OOoUtils import OOoBuilder
 
 
    self.assertEqual(200, response.getStatus())
 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(len(styles_xml_body) > 0)
    response = self.publish('/' + self.getPortal().Dynamic_viewAsOdt.absolute_url(1))
    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)
                     response.getHeader('content-disposition'))
    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.assertEqual(200, response.getStatus())
    self._validate(response.getBody()) 
    ooo_builder = OOoBuilder(response.getBody())
    styles_xml_body = ooo_builder.extract('styles.xml')
    self.assertTrue(len(styles_xml_body) > 0)

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testDms.py   erp5(Download)
from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.tests.utils import DummyLocalizer
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager
    # convert web_page into odt
    mime_type, odt_archive = web_page.convert('odt')
    builder = OOoBuilder(odt_archive)
    image_count = builder._image_count
    failure_message = 'Expected image not found in ODF zipped archive'
    web_page.edit(text_content=html_content)
    mime_type, odt_archive = web_page.convert('odt')
    builder = OOoBuilder(odt_archive)
    image_count = builder._image_count
    # compute resized image for comparison
    web_page.edit(text_content=html_content)
    mime_type, odt_archive = web_page.convert('odt')
    builder = OOoBuilder(odt_archive)
    image_count = builder._image_count
    # compute resized image for comparison

src/e/r/erp5-HEAD/product/ERP5OOo/tests/testIngestion.py   erp5(Download)
from Products.ERP5Type.tests.utils import FileUpload, createZODBPythonScript
from Products.ERP5OOo.Document.OOoDocument import ConversionError
from Products.ERP5OOo.OOoUtils import OOoBuilder
from zLOG import LOG, INFO, ERROR
from Products.CMFCore.utils import getToolByName
    document = self.portal.restrictedTraverse(sequence.get('document_path'))
    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