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
b8b001d6
Commit
b8b001d6
authored
Feb 14, 2017
by
Boris Kocherov
Committed by
Romain Courteaud
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging improve
parent
c212b9b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
cloudooo/handler/ooo/handler.py
cloudooo/handler/ooo/handler.py
+7
-4
cloudooo/manager.py
cloudooo/manager.py
+8
-5
No files found.
cloudooo/handler/ooo/handler.py
View file @
b8b001d6
...
@@ -119,15 +119,18 @@ class Handler(object):
...
@@ -119,15 +119,18 @@ class Handler(object):
openoffice
.
start
()
openoffice
.
start
()
command_list
=
self
.
_getCommand
(
*
feature_list
,
**
kw
)
command_list
=
self
.
_getCommand
(
*
feature_list
,
**
kw
)
stdout
,
stderr
=
self
.
_subprocess
(
command_list
)
stdout
,
stderr
=
self
.
_subprocess
(
command_list
)
if
not
stdout
and
len
(
re
.
findall
(
"
\
w*E
xce
ption|
\
w*E
r
ror"
,
stderr
))
>=
1
:
if
not
stdout
and
stderr
:
logger
.
debug
(
stderr
)
first_error
=
stderr
logger
.
error
(
stderr
)
self
.
document
.
restoreOriginal
()
self
.
document
.
restoreOriginal
()
openoffice
.
restart
()
openoffice
.
restart
()
kw
[
'document_url'
]
=
self
.
document
.
getUrl
()
kw
[
'document_url'
]
=
self
.
document
.
getUrl
()
command
=
self
.
_getCommand
(
*
feature_list
,
**
kw
)
command
=
self
.
_getCommand
(
*
feature_list
,
**
kw
)
stdout
,
stderr
=
self
.
_subprocess
(
command
)
stdout
,
stderr
=
self
.
_subprocess
(
command
)
if
stderr
!=
""
:
if
not
stdout
and
stderr
:
raise
Exception
(
stderr
)
second_error
=
"
\
n
error of the second run: "
+
stderr
logger
.
error
(
second_error
)
raise
Exception
(
first_error
+
second_error
)
return
stdout
,
stderr
return
stdout
,
stderr
...
...
cloudooo/manager.py
View file @
b8b001d6
...
@@ -271,8 +271,8 @@ class Manager(object):
...
@@ -271,8 +271,8 @@ class Manager(object):
del
response_dict
[
'meta'
][
'Data'
]
del
response_dict
[
'meta'
][
'Data'
]
return
(
200
,
response_dict
,
""
)
return
(
200
,
response_dict
,
""
)
except
Exception
,
e
:
except
Exception
,
e
:
import
traceback
;
traceback
.
print_exc
()
import
traceback
;
logger
.
error
(
e
)
logger
.
error
(
traceback
.
format_exc
()
)
return
(
402
,
{},
e
.
args
[
0
])
return
(
402
,
{},
e
.
args
[
0
])
def
run_setmetadata
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
def
run_setmetadata
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
...
@@ -288,7 +288,8 @@ class Manager(object):
...
@@ -288,7 +288,8 @@ class Manager(object):
response_dict
[
'data'
]
=
self
.
updateFileMetadata
(
data
,
extension
,
meta
)
response_dict
[
'data'
]
=
self
.
updateFileMetadata
(
data
,
extension
,
meta
)
return
(
200
,
response_dict
,
''
)
return
(
200
,
response_dict
,
''
)
except
Exception
,
e
:
except
Exception
,
e
:
logger
.
error
(
e
)
import
traceback
;
logger
.
error
(
traceback
.
format_exc
())
return
(
402
,
{},
e
.
args
[
0
])
return
(
402
,
{},
e
.
args
[
0
])
def
run_getmetadata
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
def
run_getmetadata
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
...
@@ -307,7 +308,8 @@ class Manager(object):
...
@@ -307,7 +308,8 @@ class Manager(object):
response_dict
[
'meta'
][
'title'
]
=
response_dict
[
'meta'
][
'Title'
]
response_dict
[
'meta'
][
'title'
]
=
response_dict
[
'meta'
][
'Title'
]
return
(
200
,
response_dict
,
''
)
return
(
200
,
response_dict
,
''
)
except
Exception
,
e
:
except
Exception
,
e
:
logger
.
error
(
e
)
import
traceback
;
logger
.
error
(
'run_getmetadata: '
+
traceback
.
format_exc
())
return
(
402
,
{},
e
.
args
[
0
])
return
(
402
,
{},
e
.
args
[
0
])
def
run_generate
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
extension
=
None
,
def
run_generate
(
self
,
filename
=
''
,
data
=
None
,
meta
=
None
,
extension
=
None
,
...
@@ -348,7 +350,8 @@ class Manager(object):
...
@@ -348,7 +350,8 @@ class Manager(object):
mimetypes
.
types_map
.
get
(
'.%s'
%
extension
.
split
(
'.'
)[
-
1
]))
mimetypes
.
types_map
.
get
(
'.%s'
%
extension
.
split
(
'.'
)[
-
1
]))
return
(
200
,
response_dict
,
""
)
return
(
200
,
response_dict
,
""
)
except
Exception
,
e
:
except
Exception
,
e
:
logger
.
error
(
e
)
import
traceback
;
logger
.
error
(
traceback
.
format_exc
())
return
(
402
,
response_dict
,
str
(
e
))
return
(
402
,
response_dict
,
str
(
e
))
def
getAllowedTargetItemList
(
self
,
content_type
):
def
getAllowedTargetItemList
(
self
,
content_type
):
...
...
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