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
Kirill Smelkov
cloudooo
Commits
b91e43a3
Commit
b91e43a3
authored
Feb 05, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ooo_disable_filter_list option, a list of filters by Name which are disabled.
parent
939f117a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
cloudooo/handler/ooo/handler.py
cloudooo/handler/ooo/handler.py
+1
-0
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+8
-1
cloudooo/paster_application.py
cloudooo/paster_application.py
+7
-0
cloudooo/sample/sample.conf
cloudooo/sample/sample.conf
+7
-1
No files found.
cloudooo/handler/ooo/handler.py
View file @
b91e43a3
...
@@ -250,6 +250,7 @@ def bootstrapHandler(configuration_dict):
...
@@ -250,6 +250,7 @@ def bootstrapHandler(configuration_dict):
kw
=
dict
(
uno_path
=
configuration_dict
.
get
(
'uno_path'
),
kw
=
dict
(
uno_path
=
configuration_dict
.
get
(
'uno_path'
),
office_binary_path
=
configuration_dict
.
get
(
'office_binary_path'
),
office_binary_path
=
configuration_dict
.
get
(
'office_binary_path'
),
timeout
=
timeout_response
,
timeout
=
timeout_response
,
ooo_disable_filter_list
=
configuration_dict
.
get
(
'ooo_disable_filter_list'
),
ooo_disable_filter_name_list
=
configuration_dict
.
get
(
'ooo_disable_filter_name_list'
))
ooo_disable_filter_name_list
=
configuration_dict
.
get
(
'ooo_disable_filter_name_list'
))
# Load all filters
# Load all filters
...
...
cloudooo/handler/ooo/mimemapper.py
View file @
b91e43a3
...
@@ -95,7 +95,8 @@ class MimeMapper(object):
...
@@ -95,7 +95,8 @@ class MimeMapper(object):
**kw:
**kw:
uno_path -- full path to uno library
uno_path -- full path to uno library
office_binary_path -- full path to openoffice binary
office_binary_path -- full path to openoffice binary
ooo_disable_filter_name_list -- a list of filter names which are disabled
ooo_disable_filter_list -- a list of filters by Name which are disabled
ooo_disable_filter_name_list -- a list of filters by UI Name which are disabled
"""
"""
alternative_extension_dict
=
{
alternative_extension_dict
=
{
'Microsoft Excel 2007 XML'
:
'ms.xlsx'
,
'Microsoft Excel 2007 XML'
:
'ms.xlsx'
,
...
@@ -133,11 +134,17 @@ class MimeMapper(object):
...
@@ -133,11 +134,17 @@ class MimeMapper(object):
raise
ValueError
(
stdout
)
raise
ValueError
(
stdout
)
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
[]
+
[
'writer_jpg_Export'
,
# Seems not working from cloudooo in Libre Office 4.2.0.4.
'writer_png_Export'
,
# Seems not working from cloudooo in Libre Office 4.2.0.4.
]
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 Encoded' instead
'Text'
,
# Use 'Text Encoded' instead
'Text (StarWriter/Web)'
,
# Use 'Text Encoded (Writer/Web)' instead
'Text (StarWriter/Web)'
,
# Use 'Text Encoded (Writer/Web)' instead
]
]
for
filter_name
,
value
in
filter_dict
.
iteritems
():
for
filter_name
,
value
in
filter_dict
.
iteritems
():
if
filter_name
in
ooo_disable_filter_list
:
continue
ui_name
=
value
.
get
(
'UIName'
)
ui_name
=
value
.
get
(
'UIName'
)
filter_type
=
value
.
get
(
'Type'
)
filter_type
=
value
.
get
(
'Type'
)
filter_type_dict
=
type_dict
.
get
(
filter_type
)
filter_type_dict
=
type_dict
.
get
(
filter_type
)
...
...
cloudooo/paster_application.py
View file @
b91e43a3
...
@@ -80,6 +80,13 @@ def application(global_config, **local_config):
...
@@ -80,6 +80,13 @@ def application(global_config, **local_config):
local_config
[
"mimetype_registry"
]
=
handler_mapping_list
=
\
local_config
[
"mimetype_registry"
]
=
handler_mapping_list
=
\
filter
(
None
,
mimetype_registry
.
split
(
"
\
n
"
))
filter
(
None
,
mimetype_registry
.
split
(
"
\
n
"
))
ooo_disable_filter_list
=
[]
for
filter_name
in
local_config
.
get
(
"ooo_disable_filter_list"
,
""
).
split
(
"
\
n
"
):
filter_name
=
filter_name
.
strip
()
if
filter_name
and
not
filter_name
in
ooo_disable_filter_list
:
ooo_disable_filter_list
.
append
(
filter_name
)
local_config
[
"ooo_disable_filter_list"
]
=
ooo_disable_filter_list
ooo_disable_filter_name_list
=
[]
ooo_disable_filter_name_list
=
[]
for
filter_name
in
local_config
.
get
(
"ooo_disable_filter_name_list"
,
""
).
split
(
"
\
n
"
):
for
filter_name
in
local_config
.
get
(
"ooo_disable_filter_name_list"
,
""
).
split
(
"
\
n
"
):
filter_name
=
filter_name
.
strip
()
filter_name
=
filter_name
.
strip
()
...
...
cloudooo/sample/sample.conf
View file @
b91e43a3
...
@@ -55,13 +55,19 @@ mimetype_registry =
...
@@ -55,13 +55,19 @@ mimetype_registry =
*
application
/
vnd
.
oasis
.
opendocument
*
ooo
*
application
/
vnd
.
oasis
.
opendocument
*
ooo
# This is used to disable ooo filters
# This is used to disable ooo filters
# Below is an example list of spreadsheet filter names.
#
# Below is an example list of spreadsheet filters by UI Name.
# http://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
# http://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
#ooo_disable_filter_name_list =
#ooo_disable_filter_name_list =
# Microsoft Excel 5.0
# Microsoft Excel 5.0
# Microsoft Excel 95
# Microsoft Excel 95
# Microsoft Word 6.0
# Microsoft Word 6.0
# Microsoft Word 95
# Microsoft Word 95
#
# Below is an example list of some filters by Name.
#ooo_disable_filter_list =
# writer_jpg_Export
# writer_png_Export
[
server
:
main
]
[
server
:
main
]
use
=
egg
:
PasteScript
#wsgiutils
use
=
egg
:
PasteScript
#wsgiutils
...
...
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