Commit 9c3137f2 authored by Jérome Perrin's avatar Jérome Perrin

dms: py3

parent 82b67321
...@@ -24,7 +24,7 @@ class DocToDocx: ...@@ -24,7 +24,7 @@ class DocToDocx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
doc = OOOdCommandTransform(context, filename, data, self.inputs[0]) doc = OOOdCommandTransform(context, filename, data, self.inputs[0])
docx = doc.convertTo('docx') docx = doc.convertTo('docx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class DocToHtml: ...@@ -24,7 +24,7 @@ class DocToHtml:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
doc = OOOdCommandTransform(context, filename, data, self.inputs[0]) doc = OOOdCommandTransform(context, filename, data, self.inputs[0])
html = doc.convertTo('html') html = doc.convertTo('html')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class DocxToDocy: ...@@ -23,7 +23,7 @@ class DocxToDocy:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
docx = OOOdCommandTransform(context, filename, data, self.inputs[0]) docx = OOOdCommandTransform(context, filename, data, self.inputs[0])
docy = docx.convertTo('docy') docy = docx.convertTo('docy')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class DocxToOdt: ...@@ -23,7 +23,7 @@ class DocxToOdt:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
docx = OOOdCommandTransform(context, filename, data, self.inputs[0]) docx = OOOdCommandTransform(context, filename, data, self.inputs[0])
odt = docx.convertTo('odt') odt = docx.convertTo('odt')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class DocyToDocx: ...@@ -23,7 +23,7 @@ class DocyToDocx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
docy = OOOdCommandTransform(context, filename, data, self.inputs[0]) docy = OOOdCommandTransform(context, filename, data, self.inputs[0])
docx = docy.convertTo('docx') docx = docy.convertTo('docx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdpToHtml: ...@@ -24,7 +24,7 @@ class OdpToHtml:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odp = OOOdCommandTransform(context, filename, data, self.inputs[0]) odp = OOOdCommandTransform(context, filename, data, self.inputs[0])
html = odp.convertTo('html') html = odp.convertTo('html')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdpToPdf: ...@@ -24,7 +24,7 @@ class OdpToPdf:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odp = OOOdCommandTransform(context, filename, data, self.inputs[0]) odp = OOOdCommandTransform(context, filename, data, self.inputs[0])
pdf = odp.convertTo('pdf') pdf = odp.convertTo('pdf')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdpToPptx: ...@@ -24,7 +24,7 @@ class OdpToPptx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odp = OOOdCommandTransform(context, filename, data, self.inputs[0]) odp = OOOdCommandTransform(context, filename, data, self.inputs[0])
pptx = odp.convertTo('pptx') pptx = odp.convertTo('pptx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdpToSxi: ...@@ -24,7 +24,7 @@ class OdpToSxi:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odp = OOOdCommandTransform(context, filename, data, self.inputs[0]) odp = OOOdCommandTransform(context, filename, data, self.inputs[0])
sxi = odp.convertTo('sxi') sxi = odp.convertTo('sxi')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdsToHtml: ...@@ -24,7 +24,7 @@ class OdsToHtml:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
ods = OOOdCommandTransform(context, filename, data, self.inputs[0]) ods = OOOdCommandTransform(context, filename, data, self.inputs[0])
html = ods.convertTo('html') html = ods.convertTo('html')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdsToPdf: ...@@ -24,7 +24,7 @@ class OdsToPdf:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
ods = OOOdCommandTransform(context, filename, data, self.inputs[0]) ods = OOOdCommandTransform(context, filename, data, self.inputs[0])
pdf = ods.convertTo('pdf') pdf = ods.convertTo('pdf')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class OdsToXlsx: ...@@ -23,7 +23,7 @@ class OdsToXlsx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
ods = OOOdCommandTransform(context, filename, data, self.inputs[0]) ods = OOOdCommandTransform(context, filename, data, self.inputs[0])
xlsx = ods.convertTo('xlsx') xlsx = ods.convertTo('xlsx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdtToDocx: ...@@ -24,7 +24,7 @@ class OdtToDocx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odt = OOOdCommandTransform(context, filename, data, self.inputs[0]) odt = OOOdCommandTransform(context, filename, data, self.inputs[0])
docx = odt.convertTo('docx') docx = odt.convertTo('docx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class OdtToHtml: ...@@ -24,7 +24,7 @@ class OdtToHtml:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
odt = OOOdCommandTransform(context, filename, data, self.inputs[0]) odt = OOOdCommandTransform(context, filename, data, self.inputs[0])
html = odt.convertTo('html') html = odt.convertTo('html')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class PdfToBmp: ...@@ -24,7 +24,7 @@ class PdfToBmp:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
pdf = OOOdCommandTransform(context, filename, data, self.inputs[0]) pdf = OOOdCommandTransform(context, filename, data, self.inputs[0])
bmp = pdf.convertTo('bmp') bmp = pdf.convertTo('bmp')
if cache is not None: if cache is not None:
......
...@@ -27,7 +27,7 @@ class PptToPptx: ...@@ -27,7 +27,7 @@ class PptToPptx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
ppt = OOOdCommandTransform(context, filename, data, self.inputs[0]) ppt = OOOdCommandTransform(context, filename, data, self.inputs[0])
pptx = ppt.convertTo('pptx') pptx = ppt.convertTo('pptx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class PptxToOdp: ...@@ -24,7 +24,7 @@ class PptxToOdp:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
pptx = OOOdCommandTransform(context, filename, data, self.inputs[0]) pptx = OOOdCommandTransform(context, filename, data, self.inputs[0])
odp = pptx.convertTo('odp') odp = pptx.convertTo('odp')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class PptxToPpty: ...@@ -23,7 +23,7 @@ class PptxToPpty:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
pptx = OOOdCommandTransform(context, filename, data, self.inputs[0]) pptx = OOOdCommandTransform(context, filename, data, self.inputs[0])
ppty = pptx.convertTo('ppty') ppty = pptx.convertTo('ppty')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class PptyToPptx: ...@@ -23,7 +23,7 @@ class PptyToPptx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
ppty = OOOdCommandTransform(context, filename, data, self.inputs[0]) ppty = OOOdCommandTransform(context, filename, data, self.inputs[0])
pptx = ppty.convertTo('pptx') pptx = ppty.convertTo('pptx')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class SxiToHtml: ...@@ -24,7 +24,7 @@ class SxiToHtml:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
sxi = OOOdCommandTransform(context, filename, data, self.inputs[0]) sxi = OOOdCommandTransform(context, filename, data, self.inputs[0])
html = sxi.convertTo('html') html = sxi.convertTo('html')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class SxiToOdp: ...@@ -24,7 +24,7 @@ class SxiToOdp:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
sxi = OOOdCommandTransform(context, filename, data, self.inputs[0]) sxi = OOOdCommandTransform(context, filename, data, self.inputs[0])
odp = sxi.convertTo('odp') odp = sxi.convertTo('odp')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class XlsToOds: ...@@ -23,7 +23,7 @@ class XlsToOds:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
xls = OOOdCommandTransform(context, filename, data, self.inputs[0]) xls = OOOdCommandTransform(context, filename, data, self.inputs[0])
ods = xls.convertTo('ods') ods = xls.convertTo('ods')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class XlsToXlsx: ...@@ -23,7 +23,7 @@ class XlsToXlsx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
xls = OOOdCommandTransform(context, filename, data, self.inputs[0]) xls = OOOdCommandTransform(context, filename, data, self.inputs[0])
xlsx = xls.convertTo('xlsx') xlsx = xls.convertTo('xlsx')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class XlsxToOds: ...@@ -23,7 +23,7 @@ class XlsxToOds:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
xlsx = OOOdCommandTransform(context, filename, data, self.inputs[0]) xlsx = OOOdCommandTransform(context, filename, data, self.inputs[0])
ods = xlsx.convertTo('ods') ods = xlsx.convertTo('ods')
if cache is not None: if cache is not None:
......
...@@ -24,7 +24,7 @@ class XlsxToXlsy: ...@@ -24,7 +24,7 @@ class XlsxToXlsy:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
xlsx = OOOdCommandTransform(context, filename, data, self.inputs[0]) xlsx = OOOdCommandTransform(context, filename, data, self.inputs[0])
xlsy = xlsx.convertTo('xlsy') xlsy = xlsx.convertTo('xlsy')
if cache is not None: if cache is not None:
......
...@@ -23,7 +23,7 @@ class XlsyToXlsx: ...@@ -23,7 +23,7 @@ class XlsyToXlsx:
raise AttributeError(attr) raise AttributeError(attr)
def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs): def convert(self, orig, data, cache=None, filename=None, context=None, **kwargs):
data = str(orig) data = bytes(orig)
xlsy = OOOdCommandTransform(context, filename, data, self.inputs[0]) xlsy = OOOdCommandTransform(context, filename, data, self.inputs[0])
xlsx = xlsy.convertTo('xlsx') xlsx = xlsy.convertTo('xlsx')
if cache is not None: if cache is not None:
......
...@@ -41,6 +41,6 @@ if relation_id == 'all': ...@@ -41,6 +41,6 @@ if relation_id == 'all':
for obj in (predecessor_value_list + successor_value_list + for obj in (predecessor_value_list + successor_value_list +
similar_value_list): similar_value_list):
dic[obj] = None dic[obj] = None
return dic.keys() return list(dic.keys())
return [] # failover - undefined relation return [] # failover - undefined relation
...@@ -5,10 +5,7 @@ if brain.getValidationState() == 'embedded': ...@@ -5,10 +5,7 @@ if brain.getValidationState() == 'embedded':
else: else:
reference = brain.getReference() reference = brain.getReference()
return unicode( return "javascript:SelectFile('%s?format=%s')" % (
"javascript:SelectFile('%s?format=%s')" % ( reference.replace("'", "\\'"),
reference.replace("'", "\\'"), context.getPortalObject().portal_preferences.getPreferredImageFormat()
context.getPortalObject().portal_preferences.getPreferredImageFormat() )
), \ No newline at end of file
'utf-8',
)
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