Commit 60daafcc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

update for LibreOffice 5.0.0.5.

writer_png_Export filter now works but draw_eps_Export and impress_eps_Export do not work.
parent 3241978a
...@@ -100,19 +100,15 @@ class MimeMapper(object): ...@@ -100,19 +100,15 @@ class MimeMapper(object):
""" """
alternative_extension_dict = { alternative_extension_dict = {
'Microsoft Excel 2007 XML':'ms.xlsx', 'Microsoft Excel 2007 XML':'ms.xlsx',
'Microsoft Excel 2007/2010 XML':'ms.xlsx', 'Microsoft Excel 2007-2013 XML':'ms.xlsx',
'Microsoft Excel 2007/2010/2013 XML':'ms.xlsx',
'Microsoft Excel 5.0':'5.xls', 'Microsoft Excel 5.0':'5.xls',
'Microsoft Excel 95':'95.xls', 'Microsoft Excel 95':'95.xls',
'Microsoft PowerPoint 2007 XML AutoPlay':'ms.ppsx', 'Microsoft PowerPoint 2007 XML AutoPlay':'ms.ppsx',
'Microsoft PowerPoint 2007/2010 XML AutoPlay':'ms.ppsx', 'Microsoft PowerPoint 2007-2013 XML AutoPlay':'ms.ppsx',
'Microsoft PowerPoint 2007/2010/2013 XML AutoPlay':'ms.ppsx',
'Microsoft PowerPoint 2007 XML':'ms.pptx', 'Microsoft PowerPoint 2007 XML':'ms.pptx',
'Microsoft PowerPoint 2007/2010 XML':'ms.pptx', 'Microsoft PowerPoint 2007-2013 XML':'ms.pptx',
'Microsoft PowerPoint 2007/2010/2013 XML':'ms.pptx',
'Microsoft Word 2007 XML':'ms.docx', 'Microsoft Word 2007 XML':'ms.docx',
'Microsoft Word 2007/2010 XML':'ms.docx', 'Microsoft Word 2007-2013 XML':'ms.docx',
'Microsoft Word 2007/2010/2013 XML':'ms.docx',
'Microsoft Word 6.0':'6.doc', 'Microsoft Word 6.0':'6.doc',
'Microsoft Word 95':'95.doc', 'Microsoft Word 95':'95.doc',
} }
...@@ -136,7 +132,8 @@ class MimeMapper(object): ...@@ -136,7 +132,8 @@ class MimeMapper(object):
ooo_disable_filter_list = kw.get("ooo_disable_filter_list") or [] + [ ooo_disable_filter_list = kw.get("ooo_disable_filter_list") or [] + [
'writer_jpg_Export', # Seems not working from cloudooo in Libre Office 4.3.3.2 'writer_jpg_Export', # Seems not working from cloudooo in Libre Office 4.3.3.2
'writer_png_Export', # Seems not working from cloudooo in Libre Office 4.3.3.2 'draw_eps_Export', # Seems not working from cloudooo in Libre Office 5.0.0.5
'impress_eps_Export', # Seems not working from cloudooo in Libre Office 5.0.0.5
] ]
ooo_disable_filter_name_list = kw.get("ooo_disable_filter_name_list") or [] + [ ooo_disable_filter_name_list = kw.get("ooo_disable_filter_name_list") or [] + [
'Text', # Use 'Text - Choose Encoding' instead 'Text', # Use 'Text - Choose Encoding' instead
......
...@@ -31,15 +31,15 @@ from cloudooo.handler.ooo.application.openoffice import openoffice ...@@ -31,15 +31,15 @@ from cloudooo.handler.ooo.application.openoffice import openoffice
from cloudooo.handler.ooo.mimemapper import MimeMapper from cloudooo.handler.ooo.mimemapper import MimeMapper
text_expected_tuple = ( text_expected_tuple = (
('doc', 'Microsoft Word 97/2000/XP/2003'), ('doc', 'Microsoft Word 97-2003'),
('ms.docx', 'Microsoft Word 2007/2010/2013 XML'), ('ms.docx', 'Microsoft Word 2007-2013 XML'),
('docx', 'Office Open XML Text'), ('docx', 'Office Open XML Text'),
('fodt', 'Flat XML ODF Text Document'), ('fodt', 'Flat XML ODF Text Document'),
('html', 'HTML Document (Writer)'), ('html', 'HTML Document (Writer)'),
# ('jpg', 'JPEG - Joint Photographic Experts Group'), # ('jpg', 'JPEG - Joint Photographic Experts Group'),
('odt', 'ODF Text Document'), ('odt', 'ODF Text Document'),
('pdf', 'PDF - Portable Document Format'), ('pdf', 'PDF - Portable Document Format'),
# ('png', 'PNG - Portable Network Graphic'), ('png', 'PNG - Portable Network Graphic'),
('rtf', 'Rich Text'), ('rtf', 'Rich Text'),
('txt', 'Text - Choose Encoding'), ('txt', 'Text - Choose Encoding'),
) )
...@@ -50,7 +50,7 @@ global_expected_tuple = ( ...@@ -50,7 +50,7 @@ global_expected_tuple = (
drawing_expected_tuple = ( drawing_expected_tuple = (
('bmp', 'BMP - Windows Bitmap'), ('bmp', 'BMP - Windows Bitmap'),
('emf', 'EMF - Enhanced Metafile'), ('emf', 'EMF - Enhanced Metafile'),
('eps', 'EPS - Encapsulated PostScript'), # ('eps', 'EPS - Encapsulated PostScript'),
('fodg', 'Flat XML ODF Drawing'), ('fodg', 'Flat XML ODF Drawing'),
('gif', 'GIF - Graphics Interchange Format'), ('gif', 'GIF - Graphics Interchange Format'),
('html', 'HTML Document (Draw)'), ('html', 'HTML Document (Draw)'),
...@@ -83,7 +83,7 @@ web_expected_tuple = ( ...@@ -83,7 +83,7 @@ web_expected_tuple = (
presentation_expected_tuple = ( presentation_expected_tuple = (
('bmp', 'BMP - Windows Bitmap'), ('bmp', 'BMP - Windows Bitmap'),
('emf', 'EMF - Enhanced Metafile'), ('emf', 'EMF - Enhanced Metafile'),
('eps', 'EPS - Encapsulated PostScript'), # ('eps', 'EPS - Encapsulated PostScript'),
('fodp', 'Flat XML ODF Presentation'), ('fodp', 'Flat XML ODF Presentation'),
('gif', 'GIF - Graphics Interchange Format'), ('gif', 'GIF - Graphics Interchange Format'),
('html', 'HTML Document (Impress)'), ('html', 'HTML Document (Impress)'),
...@@ -97,11 +97,11 @@ presentation_expected_tuple = ( ...@@ -97,11 +97,11 @@ presentation_expected_tuple = (
('pgm', 'PGM - Portable Graymap'), ('pgm', 'PGM - Portable Graymap'),
('png', 'PNG - Portable Network Graphic'), ('png', 'PNG - Portable Network Graphic'),
('ppm', 'PPM - Portable Pixelmap'), ('ppm', 'PPM - Portable Pixelmap'),
('pps', 'Microsoft PowerPoint 97/2000/XP/2003 AutoPlay'), ('pps', 'Microsoft PowerPoint 97-2003 AutoPlay'),
('ms.ppsx', 'Microsoft PowerPoint 2007/2010/2013 XML AutoPlay'), ('ms.ppsx', 'Microsoft PowerPoint 2007-2013 XML AutoPlay'),
('ppsx', 'Office Open XML Presentation AutoPlay'), ('ppsx', 'Office Open XML Presentation AutoPlay'),
('ppt', 'Microsoft PowerPoint 97/2000/XP/2003'), ('ppt', 'Microsoft PowerPoint 97-2003'),
('ms.pptx', 'Microsoft PowerPoint 2007/2010/2013 XML'), ('ms.pptx', 'Microsoft PowerPoint 2007-2013 XML'),
('pptx', 'Office Open XML Presentation'), ('pptx', 'Office Open XML Presentation'),
('ras', 'RAS - Sun Raster Image'), ('ras', 'RAS - Sun Raster Image'),
('svg', 'SVG - Scalable Vector Graphics'), ('svg', 'SVG - Scalable Vector Graphics'),
...@@ -118,8 +118,8 @@ spreadsheet_expected_tuple = ( ...@@ -118,8 +118,8 @@ spreadsheet_expected_tuple = (
('ods', 'ODF Spreadsheet'), ('ods', 'ODF Spreadsheet'),
('pdf', 'PDF - Portable Document Format'), ('pdf', 'PDF - Portable Document Format'),
('slk', 'SYLK'), ('slk', 'SYLK'),
('xls', 'Microsoft Excel 97/2000/XP/2003'), ('xls', 'Microsoft Excel 97-2003'),
('ms.xlsx', 'Microsoft Excel 2007/2010/2013 XML'), ('ms.xlsx', 'Microsoft Excel 2007-2013 XML'),
('xlsx', 'Office Open XML Spreadsheet'), ('xlsx', 'Office Open XML Spreadsheet'),
) )
......
...@@ -480,11 +480,11 @@ class TestServer(TestCase): ...@@ -480,11 +480,11 @@ class TestServer(TestCase):
"""Test if getImageItemList can get the list of images items from odt file""" """Test if getImageItemList can get the list of images items from odt file"""
data = encodestring(open("./data/granulate_test.odt").read()) data = encodestring(open("./data/granulate_test.odt").read())
image_list = self.proxy.getImageItemList(data, "odt") image_list = self.proxy.getImageItemList(data, "odt")
self.assertEquals([['10000000000000C80000009CA3D5C3B7.jpg', ''], self.assertEquals([['10000000000000C80000009C76245A92.jpg', ''],
['10000201000000C80000004E7B947D46.png', 'TioLive Logo'], ['10000201000000C80000004EE2BCEED0.png', 'TioLive Logo'],
['10000201000000C80000004E7B947D46.png', ''], ['10000201000000C80000004EE2BCEED0.png', ''],
['2000004F00004233000013707E7DE37A.svm', 'Python Logo'], ['2000004F00004233000013707E7DE37A.svm', 'Python Logo'],
['10000201000000C80000004E7B947D46.png', ['10000201000000C80000004EE2BCEED0.png',
'Again TioLive Logo']], 'Again TioLive Logo']],
image_list) image_list)
...@@ -492,11 +492,11 @@ class TestServer(TestCase): ...@@ -492,11 +492,11 @@ class TestServer(TestCase):
"""Test if getImageItemList can get the list of images items from doc file""" """Test if getImageItemList can get the list of images items from doc file"""
data = encodestring(open("./data/granulate_test.doc").read()) data = encodestring(open("./data/granulate_test.doc").read())
image_list = self.proxy.getImageItemList(data, "doc") image_list = self.proxy.getImageItemList(data, "doc")
self.assertEquals([['10000000000000C80000009CA3D5C3B7.jpg', ''], self.assertEquals([['10000000000000C80000009C76245A92.jpg', ''],
['10000201000000C80000004E7B947D46.png', 'TioLive Logo'], ['10000201000000C80000004EE2BCEED0.png', 'TioLive Logo'],
['10000201000000C80000004E7B947D46.png', ''], ['10000201000000C80000004EE2BCEED0.png', ''],
['2000031600004233000013706A5EA1C8.wmf', 'Python Logo'], ['2000031600004233000013706A5EA1C8.wmf', 'Python Logo'],
['10000201000000C80000004E7B947D46.png', ['10000201000000C80000004EE2BCEED0.png',
'Again TioLive Logo']], 'Again TioLive Logo']],
image_list) image_list)
...@@ -516,7 +516,7 @@ class TestServer(TestCase): ...@@ -516,7 +516,7 @@ class TestServer(TestCase):
#so compare with the server return. #so compare with the server return.
data_odt = self.proxy.convertFile(data, 'doc', 'odt', False) data_odt = self.proxy.convertFile(data, 'doc', 'odt', False)
zip = ZipFile(StringIO(decodestring(data_odt))) zip = ZipFile(StringIO(decodestring(data_odt)))
image_id = '10000000000000C80000009CA3D5C3B7.jpg' image_id = '10000000000000C80000009C76245A92.jpg'
original_image = zip.read('Pictures/%s' % image_id) original_image = zip.read('Pictures/%s' % image_id)
geted_image = decodestring(self.proxy.getImage(data, image_id, "doc")) geted_image = decodestring(self.proxy.getImage(data, image_id, "doc"))
self.assertEquals(original_image, geted_image) self.assertEquals(original_image, geted_image)
......
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