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
59a04869
Commit
59a04869
authored
8 years ago
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 fixes
parent
6999afe9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
cloudooo/handler/ooo/handler.py
cloudooo/handler/ooo/handler.py
+1
-1
cloudooo/handler/ooo/helper/unoconverter.py
cloudooo/handler/ooo/helper/unoconverter.py
+4
-4
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+1
-1
No files found.
cloudooo/handler/ooo/handler.py
View file @
59a04869
...
...
@@ -89,7 +89,7 @@ class Handler(object):
kw
[
'hostname'
]
=
hostname
kw
[
'port'
]
=
port
python
=
path
.
join
(
self
.
office_binary_path
,
"python"
)
command_list
=
[
path
.
exists
(
python
)
and
python
or
"python"
,
command_list
=
[
path
.
exists
(
python
)
and
python
or
"python
3
"
,
pkg_resources
.
resource_filename
(
__name__
,
path
.
join
(
"helper"
,
"unoconverter.py"
)),
"--uno_path=%s"
%
self
.
uno_path
,
...
...
This diff is collapsed.
Click to expand it.
cloudooo/handler/ooo/helper/unoconverter.py
View file @
59a04869
...
...
@@ -35,7 +35,7 @@ import codecs
import
helper_util
from
os.path
import
dirname
,
splitext
from
tempfile
import
mktemp
from
base64
import
decodestring
,
encodestring
from
base64
import
b64encode
,
b64decode
from
getopt
import
getopt
,
GetoptError
try
:
...
...
@@ -342,7 +342,7 @@ def main():
elif
opt
==
'--refresh'
:
refresh
=
json
.
loads
(
arg
)
elif
opt
==
'--metadata'
:
arg
=
decodestring
(
arg
.
encode
(
'ascii'
)
).
decode
(
'utf-8'
)
arg
=
b64decode
(
arg
).
decode
(
'utf-8'
)
metadata
=
json
.
loads
(
arg
)
elif
opt
==
'--mimemapper'
:
mimemapper
=
json
.
loads
(
arg
)
...
...
@@ -357,7 +357,7 @@ def main():
output
=
unoconverter
.
convert
(
destination_format
)
elif
'--getmetadata'
in
param_list
and
not
'--convert'
in
param_list
:
metadata_dict
=
unoconverter
.
getMetadata
()
output
=
encodestring
(
json
.
dumps
(
metadata_dict
).
encode
(
'utf-8'
)).
decode
(
'utf-8'
)
output
=
b64encode
(
json
.
dumps
(
metadata_dict
).
encode
(
'utf-8'
)).
decode
(
)
elif
'--getmetadata'
in
param_list
and
'--convert'
in
param_list
:
document_url
=
unoconverter
.
convert
()
# Instanciate new UnoConverter instance with new url
...
...
@@ -365,7 +365,7 @@ def main():
uno_path
,
office_binary_path
,
refresh
)
metadata_dict
=
unoconverter
.
getMetadata
()
metadata_dict
[
'document_url'
]
=
document_url
output
=
encodestring
(
json
.
dumps
(
metadata_dict
).
encode
(
'utf-8'
)).
decode
(
'utf-8'
)
output
=
b64encode
(
json
.
dumps
(
metadata_dict
).
encode
(
'utf-8'
)).
decode
(
)
elif
'--setmetadata'
in
param_list
:
unoconverter
.
setMetadata
(
metadata
)
output
=
document_url
...
...
This diff is collapsed.
Click to expand it.
cloudooo/handler/ooo/mimemapper.py
View file @
59a04869
...
...
@@ -118,7 +118,7 @@ class MimeMapper(object):
office_binary_path
=
kw
.
get
(
"office_binary_path"
,
environ
.
get
(
'office_binary_path'
))
python
=
path
.
join
(
office_binary_path
,
"python"
)
command
=
[
path
.
exists
(
python
)
and
python
or
"python"
,
command
=
[
path
.
exists
(
python
)
and
python
or
"python
3
"
,
pkg_resources
.
resource_filename
(
__name__
,
path
.
join
(
"helper"
,
"unomimemapper.py"
)),
"--uno_path=%s"
%
uno_path
,
...
...
This diff is collapsed.
Click to expand it.
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