Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
cloudooo
Commits
4aae0f75
Commit
4aae0f75
authored
Feb 22, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update for LibreOffice 5.1.0.3.
parent
f05f03ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+4
-4
cloudooo/handler/ooo/tests/testOooMimemapper.py
cloudooo/handler/ooo/tests/testOooMimemapper.py
+5
-3
cloudooo/handler/ooo/tests/testOooServer.py
cloudooo/handler/ooo/tests/testOooServer.py
+13
-15
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
4aae0f75
...
@@ -131,10 +131,10 @@ class MimeMapper(object):
...
@@ -131,10 +131,10 @@ class MimeMapper(object):
filter_dict
,
type_dict
=
json
.
loads
(
stdout
)
filter_dict
,
type_dict
=
json
.
loads
(
stdout
)
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
#
'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
#
'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
#
'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
...
...
cloudooo/handler/ooo/tests/testOooMimemapper.py
View file @
4aae0f75
...
@@ -36,7 +36,7 @@ text_expected_tuple = (
...
@@ -36,7 +36,7 @@ text_expected_tuple = (
(
'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'),
...
@@ -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)'
),
...
@@ -117,8 +117,10 @@ spreadsheet_expected_tuple = (
...
@@ -117,8 +117,10 @@ spreadsheet_expected_tuple = (
(
'html'
,
'HTML Document (Calc)'
),
(
'html'
,
'HTML Document (Calc)'
),
(
'ods'
,
'ODF Spreadsheet'
),
(
'ods'
,
'ODF Spreadsheet'
),
(
'pdf'
,
'PDF - Portable Document Format'
),
(
'pdf'
,
'PDF - Portable Document Format'
),
(
'png'
,
'PNG - Portable Network Graphic'
),
(
'slk'
,
'SYLK'
),
(
'slk'
,
'SYLK'
),
(
'xls'
,
'Microsoft Excel 97-2003'
),
(
'xls'
,
'Microsoft Excel 97-2003'
),
(
'xlsm'
,
'Microsoft Excel 2007-2016 XML (macro enabled)'
),
(
'ms.xlsx'
,
'Microsoft Excel 2007-2013 XML'
),
(
'ms.xlsx'
,
'Microsoft Excel 2007-2013 XML'
),
(
'xlsx'
,
'Office Open XML Spreadsheet'
),
(
'xlsx'
,
'Office Open XML Spreadsheet'
),
)
)
...
...
cloudooo/handler/ooo/tests/testOooServer.py
View file @
4aae0f75
...
@@ -480,25 +480,23 @@ class TestServer(TestCase):
...
@@ -480,25 +480,23 @@ 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
([[
'10000000000000C80000009C76245A92.jpg'
,
''
],
self
.
assertEquals
([[
'10000000000000C80000009CBF079A6E41EE290C.jpg'
,
''
],
[
'10000201000000C80000004EE2BCEED0.png'
,
'TioLive Logo'
],
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
'TioLive Logo'
],
[
'10000201000000C80000004EE2BCEED0.png'
,
''
],
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
''
],
[
'2000004F00004233000013707E7DE37A.svm'
,
'Python Logo'
],
[
'2000004F0000423300001370ADF6545B2997B448.svm'
,
'Python Logo'
],
[
'10000201000000C80000004EE2BCEED0.png'
,
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
'Again TioLive Logo'
]],
'Again TioLive Logo'
]],
image_list
)
image_list
)
def
testGetImageItemListFromDoc
(
self
):
def
testGetImageItemListFromDoc
(
self
):
"""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
([[
'10000000000000C80000009C76245A92.jpg'
,
''
],
self
.
assertEquals
([[
'10000000000000C80000009CBF079A6E41EE290C.jpg'
,
''
],
[
'10000201000000C80000004EE2BCEED0.png'
,
'TioLive Logo'
],
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
'TioLive Logo'
],
[
'10000201000000C80000004EE2BCEED0.png'
,
''
],
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
''
],
[
'2000031600004233000013706A5EA1C8.wmf'
,
'Python Logo'
],
[
'2000031600004233000013702113A0E70B910778.wmf'
,
'Python Logo'
],
[
'10000201000000C80000004EE2BCEED0.png'
,
[
'10000201000000C80000004EF26C99A54A61B987.png'
,
'Again TioLive Logo'
]],
'Again TioLive Logo'
]],
image_list
)
image_list
)
def
testGetImageFromOdt
(
self
):
def
testGetImageFromOdt
(
self
):
"""Test if getImage can get a image from odt file after zip"""
"""Test if getImage can get a image from odt file after zip"""
...
@@ -516,7 +514,7 @@ class TestServer(TestCase):
...
@@ -516,7 +514,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
=
'10000000000000C80000009C
76245A92
.jpg'
image_id
=
'10000000000000C80000009C
BF079A6E41EE290C
.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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment