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

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)

src/e/r/erp5-HEAD/product/ERP5Form/PDFParser.py   erp5(Download)
    """
    from Products.ERP5Type.Document import newTempPDFDocument
    from Products.ERP5Type.Document import newTempImage 
    temp_pdf_document_name = "tmp%s.pdf" %  str(random.random()).split('.')[-1]
    temp_pdf_document = newTempPDFDocument(self, temp_pdf_document_name)
    page_image = None
    if image_data is not None:
      page_image = newTempImage(self, "page_%s" % page)
      page_image.setData(page_image)    
    return page_image

src/e/r/erp5-HEAD/product/ERP5/Document/PDFTypeInformation.py   erp5(Download)
  def getERP5FormImage(self, page):
    """
      Returns the background image for a given page
    """
    from Products.ERP5Type.Document import newTempImage
    if image_data is None:
      return
    page_image = newTempImage(self, "page_%s" % page)
    page_image.setData(image_data)
    self.REQUEST.RESPONSE.setHeader('Content-Type', mime)

src/e/r/erp5-HEAD/product/ERP5OOo/OOoTemplate.py   erp5(Download)
      # If this is not a File, build a new file with this content
      if not isinstance(picture, File):
        tmp_picture = Products.ERP5Type.Document.newTempImage(self, 'tmp')
        tmp_picture.setData(picture())
        picture = tmp_picture

src/e/r/erp5-HEAD/product/ERP5/Document/File.py   erp5(Download)
      # The file should behave like it is an Image for convert
      # the content to target format.
      from Products.ERP5Type.Document import newTempImage
      return newTempImage(self, self.getId(),
                 data=self.getData(),

src/e/r/erp5-HEAD/product/ERP5/tests/testERP5Base.py   erp5(Download)
    self.assertEqual((320, 250), (image.getWidth(), image.getHeight()))
 
    from Products.ERP5Type.Document import newTempImage
    def convert(**kw):
      image_type, image_data = image.convert('jpg', display='thumbnail', **kw)
      self.assertEqual('image/jpeg', image_type)
      thumbnail = newTempImage(self.portal, 'thumbnail', data=image_data)