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
1c3f3819
Commit
1c3f3819
authored
Feb 05, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support Apache OpenOffice 4.
parent
74b11d36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
cloudooo/handler/ooo/helper/unoconverter.py
cloudooo/handler/ooo/helper/unoconverter.py
+5
-5
cloudooo/handler/ooo/helper/unomimemapper.py
cloudooo/handler/ooo/helper/unomimemapper.py
+6
-1
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+4
-0
No files found.
cloudooo/handler/ooo/helper/unoconverter.py
View file @
1c3f3819
...
@@ -35,9 +35,9 @@ from base64 import decodestring, encodestring
...
@@ -35,9 +35,9 @@ from base64 import decodestring, encodestring
from
getopt
import
getopt
,
GetoptError
from
getopt
import
getopt
,
GetoptError
try
:
try
:
unicode
basestring
except
NameError
:
except
NameError
:
unicode
=
str
basestring
=
str
__doc__
=
"""
__doc__
=
"""
...
@@ -196,9 +196,9 @@ class UnoConverter(object):
...
@@ -196,9 +196,9 @@ class UnoConverter(object):
continue
continue
property_value
=
getattr
(
container
,
property_name
,
''
)
property_value
=
getattr
(
container
,
property_name
,
''
)
if
property_value
:
if
property_value
:
if
isinstance
(
property_value
,
unicode
):
if
isinstance
(
property_value
,
basestring
):
metadata
[
property_name
]
=
property_value
metadata
[
property_name
]
=
property_value
elif
isinstance
(
property_value
,
tuple
)
and
isinstance
(
property_value
[
0
],
unicode
):
elif
isinstance
(
property_value
,
tuple
)
and
isinstance
(
property_value
[
0
],
basestring
):
metadata
[
property_name
]
=
property_value
metadata
[
property_name
]
=
property_value
else
:
else
:
try
:
try
:
...
@@ -241,7 +241,7 @@ class UnoConverter(object):
...
@@ -241,7 +241,7 @@ class UnoConverter(object):
else
:
else
:
new_properties
.
append
([
prop
,
value
])
new_properties
.
append
([
prop
,
value
])
for
prop
,
value
in
new_properties
:
for
prop
,
value
in
new_properties
:
if
isinstance
(
value
,
unicode
):
if
isinstance
(
value
,
basestring
):
user_defined_properties
.
addProperty
(
prop
,
0
,
''
)
user_defined_properties
.
addProperty
(
prop
,
0
,
''
)
user_defined_properties
.
setPropertyValue
(
prop
,
value
)
user_defined_properties
.
setPropertyValue
(
prop
,
value
)
self
.
document_loaded
.
store
()
self
.
document_loaded
.
store
()
...
...
cloudooo/handler/ooo/helper/unomimemapper.py
View file @
1c3f3819
...
@@ -35,6 +35,11 @@ except ImportError:
...
@@ -35,6 +35,11 @@ except ImportError:
import
helper_util
import
helper_util
from
getopt
import
getopt
,
GetoptError
from
getopt
import
getopt
,
GetoptError
try
:
basestring
except
NameError
:
basestring
=
str
__doc__
=
"""
__doc__
=
"""
usage: unomimemapper [options]
usage: unomimemapper [options]
...
@@ -71,7 +76,7 @@ class UnoMimemapper(object):
...
@@ -71,7 +76,7 @@ class UnoMimemapper(object):
for
obj
in
iter
(
element_list
):
for
obj
in
iter
(
element_list
):
if
obj
.
Name
in
ignore_name_list
:
if
obj
.
Name
in
ignore_name_list
:
continue
continue
if
not
isinstance
(
obj
.
Value
,
(
bool
,
int
,
str
,
tuple
)):
if
not
isinstance
(
obj
.
Value
,
(
bool
,
int
,
basestring
,
tuple
)):
continue
continue
element_dict
[
obj
.
Name
]
=
obj
.
Value
element_dict
[
obj
.
Name
]
=
obj
.
Value
service_dict
[
name
]
=
element_dict
service_dict
[
name
]
=
element_dict
...
...
cloudooo/handler/ooo/mimemapper.py
View file @
1c3f3819
...
@@ -98,14 +98,18 @@ class MimeMapper(object):
...
@@ -98,14 +98,18 @@ class MimeMapper(object):
ooo_disable_filter_name_list -- a list of filter names which are disabled
ooo_disable_filter_name_list -- a list of filter names which are disabled
"""
"""
alternative_extension_dict
=
{
alternative_extension_dict
=
{
'Microsoft Excel 2007 XML'
:
'ms.xlsx'
,
'Microsoft Excel 2007/2010 XML'
:
'ms.xlsx'
,
'Microsoft Excel 2007/2010 XML'
:
'ms.xlsx'
,
'Microsoft Excel 2007/2010/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/2010 XML AutoPlay'
:
'ms.ppsx'
,
'Microsoft PowerPoint 2007/2010 XML AutoPlay'
:
'ms.ppsx'
,
'Microsoft PowerPoint 2007/2010/2013 XML AutoPlay'
:
'ms.ppsx'
,
'Microsoft PowerPoint 2007/2010/2013 XML AutoPlay'
:
'ms.ppsx'
,
'Microsoft PowerPoint 2007 XML'
:
'ms.pptx'
,
'Microsoft PowerPoint 2007/2010 XML'
:
'ms.pptx'
,
'Microsoft PowerPoint 2007/2010 XML'
:
'ms.pptx'
,
'Microsoft PowerPoint 2007/2010/2013 XML'
:
'ms.pptx'
,
'Microsoft PowerPoint 2007/2010/2013 XML'
:
'ms.pptx'
,
'Microsoft Word 2007 XML'
:
'ms.docx'
,
'Microsoft Word 2007/2010 XML'
:
'ms.docx'
,
'Microsoft Word 2007/2010 XML'
:
'ms.docx'
,
'Microsoft Word 2007/2010/2013 XML'
:
'ms.docx'
,
'Microsoft Word 2007/2010/2013 XML'
:
'ms.docx'
,
'Microsoft Word 6.0'
:
'6.doc'
,
'Microsoft Word 6.0'
:
'6.doc'
,
...
...
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