Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
4b2484f8
Commit
4b2484f8
authored
Jan 27, 2015
by
Marc Duez
Browse files
fuse_server.py : simple xml-rpc server to handle custom_fuse request
parent
7658c786
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/fuse_server.py
0 → 100644
View file @
4b2484f8
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
,
SimpleXMLRPCRequestHandler
from
subprocess
import
*
def
fuse
(
cmd
,
output_dir
,
filename
):
import
time
,
datetime
,
sys
,
os
.
path
,
random
from
subprocess
import
Popen
,
PIPE
,
STDOUT
,
os
fuse_log_file
=
open
(
output_dir
+
'/'
+
filename
+
'.fuse.log'
,
'w'
)
output_file
=
output_dir
+
'/'
+
filename
+
'.fused'
## fuse.py
p
=
Popen
(
cmd
,
shell
=
True
,
stdin
=
PIPE
,
stdout
=
fuse_log_file
,
stderr
=
STDOUT
,
close_fds
=
True
)
(
stdoutdata
,
stderrdata
)
=
p
.
communicate
()
fuse_filepath
=
os
.
path
.
abspath
(
output_file
)
p
.
wait
()
return
fuse_filepath
def
main
():
server
=
SimpleXMLRPCServer
((
"localhost"
,
12345
))
server
.
register_function
(
fuse
,
"fuse"
)
while
True
:
server
.
handle_request
()
if
__name__
==
"__main__"
:
main
()
\ No newline at end of file
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