Commit c3a763a2 authored by Gabriel Monnerat's avatar Gabriel Monnerat

add configuration in setup.py to create the scripts unoconverter and...

add configuration in setup.py to create the scripts unoconverter and unomimemapper and refactor cloudooo.py to obtain this paths by cloudooo configuration

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@37605 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e6b8797
...@@ -93,10 +93,7 @@ class UnoConverter(object): ...@@ -93,10 +93,7 @@ class UnoConverter(object):
property_list.append(property) property_list.append(property)
property = ooolib.createProperty("FilterName", filter_name) property = ooolib.createProperty("FilterName", filter_name)
property_list.append(property) property_list.append(property)
if "htm" in destination_format: property_list.extend(ooolib.createSpecificProperty(filter_name))
# XXX - condition to obtain a property that returns all images in png
# format
property_list.append(ooolib.createHTMLProperty())
return property_list return property_list
else: else:
return () return ()
......
...@@ -61,17 +61,30 @@ def createProperty(name, value): ...@@ -61,17 +61,30 @@ def createProperty(name, value):
return property return property
# XXX - method duplicated # XXX - method duplicated
def createHTMLProperty(): def createSpecificProperty(filter_name):
"""Returns a property to create all images in png format""" """Creates a property according to the filter"""
setUpUnoEnvironment() setUpUnoEnvironment()
import uno import uno
from com.sun.star.beans import PropertyValue from com.sun.star.beans import PropertyValue
if filter_name == "impress_html_Export":
property = PropertyValue('FilterData', 0,
uno.Any('[]com.sun.star.beans.PropertyValue',
(PropertyValue('IsExportNotes', 0, True, 0),
PropertyValue('Format', 0, 2, 0),),), 0)
elif filter_name == "impress_pdf_Export":
property = PropertyValue('FilterData', 0,
uno.Any('[]com.sun.star.beans.PropertyValue',
(PropertyValue('ExportNotesPages', 0, True, 0),),), 0)
elif filter_name == "draw_html_Export":
property = PropertyValue('FilterData', 0,
uno.Any('[]com.sun.star.beans.PropertyValue',
(PropertyValue('Format', 0, 2, 0),),), 0)
elif filter_name == "Text (encoded)":
property = PropertyValue('FilterFlags', 0, 'UTF8,LF', 0)
else:
return []
property = PropertyValue('FilterData', 0, return [property,]
uno.Any('[]com.sun.star.beans.PropertyValue',
(PropertyValue('IsExportNotes', 0, True, 0),
PropertyValue('Format', 0, 2, 0),),), 0) # PNG format
return property
def getServiceManager(host, port): def getServiceManager(host, port):
"""Get the ServiceManager from the running OpenOffice.org.""" """Get the ServiceManager from the running OpenOffice.org."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment