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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Jérome Perrin
cloudooo
Commits
5e41f4c1
Commit
5e41f4c1
authored
Oct 25, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If subprocess command fails, then exit immediately and display error message
parent
b678eb79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+5
-3
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
5e41f4c1
...
...
@@ -29,6 +29,7 @@
import
pkg_resources
from
re
import
findall
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
STDOUT
from
zope.interface
import
implements
from
filter
import
Filter
from
os
import
environ
,
path
...
...
@@ -107,9 +108,10 @@ class MimeMapper(object):
"--hostname=%s"
%
hostname
,
"--port=%s"
%
port
]
stdout
,
stderr
=
Popen
(
command
,
stdout
=
PIPE
,
close_fds
=
True
).
communicate
()
process
=
Popen
(
command
,
stdout
=
PIPE
,
stderr
=
STDOUT
,
close_fds
=
True
)
stdout
,
stderr
=
process
.
communicate
()
if
process
.
returncode
:
raise
ValueError
(
stdout
)
filter_dict
,
type_dict
=
json
.
loads
(
stdout
)
for
filter_name
,
value
in
filter_dict
.
iteritems
():
flag
=
value
.
get
(
"Flags"
)
...
...
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