Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
cloudooo
Commits
98055878
Commit
98055878
authored
Apr 23, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manager: report wrong client usage regarding encoding of parameters
parent
72da57bf
Pipeline
#28117
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
cloudooo/manager.py
cloudooo/manager.py
+8
-0
No files found.
cloudooo/manager.py
View file @
98055878
...
@@ -109,6 +109,10 @@ class Manager(object):
...
@@ -109,6 +109,10 @@ class Manager(object):
self
.
mimetype_registry
=
kw
.
pop
(
"mimetype_registry"
)
self
.
mimetype_registry
=
kw
.
pop
(
"mimetype_registry"
)
self
.
handler_dict
=
kw
.
pop
(
"handler_dict"
)
self
.
handler_dict
=
kw
.
pop
(
"handler_dict"
)
def
_check_file_type
(
self
,
file
):
if
isinstance
(
file
,
xmlrpc
.
client
.
Binary
):
raise
TypeError
(
'`file` must be provided as a string with the file content encoded as base64'
)
def
convertFile
(
self
,
file
:
str
,
source_format
:
str
,
destination_format
:
str
,
zip
=
False
,
def
convertFile
(
self
,
file
:
str
,
source_format
:
str
,
destination_format
:
str
,
zip
=
False
,
refresh
=
False
,
conversion_kw
=
{})
->
str
:
refresh
=
False
,
conversion_kw
=
{})
->
str
:
"""Returns the converted file in the given format.
"""Returns the converted file in the given format.
...
@@ -119,6 +123,8 @@ class Manager(object):
...
@@ -119,6 +123,8 @@ class Manager(object):
zip -- Boolean Attribute. If true, returns the file in the form of a
zip -- Boolean Attribute. If true, returns the file in the form of a
zip archive
zip archive
"""
"""
self
.
_check_file_type
(
file
)
kw
=
self
.
kw
.
copy
()
kw
=
self
.
kw
.
copy
()
kw
.
update
(
zip
=
zip
,
refresh
=
refresh
)
kw
.
update
(
zip
=
zip
,
refresh
=
refresh
)
# XXX Force the use of wkhtmltopdf handler if converting from html to pdf
# XXX Force the use of wkhtmltopdf handler if converting from html to pdf
...
@@ -153,6 +159,7 @@ class Manager(object):
...
@@ -153,6 +159,7 @@ class Manager(object):
{"title":"abc","description":...})
{"title":"abc","description":...})
return encodebytes(document_with_metadata)
return encodebytes(document_with_metadata)
"""
"""
self
.
_check_file_type
(
file
)
handler_class
=
getHandlerClass
(
source_format
,
handler_class
=
getHandlerClass
(
source_format
,
None
,
None
,
self
.
mimetype_registry
,
self
.
mimetype_registry
,
...
@@ -180,6 +187,7 @@ class Manager(object):
...
@@ -180,6 +187,7 @@ class Manager(object):
Note that all keys of the dictionary have the first word in uppercase.
Note that all keys of the dictionary have the first word in uppercase.
"""
"""
self
.
_check_file_type
(
file
)
handler_class
=
getHandlerClass
(
source_format
,
handler_class
=
getHandlerClass
(
source_format
,
None
,
None
,
self
.
mimetype_registry
,
self
.
mimetype_registry
,
...
...
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