Commit 63d6df4c authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team
Browse files

fuse_server.py, models/task.py: use PORT_FUSE_SERVER defined in modules/defs.py

parent 09f7cb72
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
from subprocess import *
from web2py.applications.vidjil.modules import defs
def fuse(cmd, output_dir, filename):
import time, datetime, sys, os.path, random
from subprocess import Popen, PIPE, STDOUT, os
......@@ -16,7 +18,7 @@ def fuse(cmd, output_dir, filename):
return fuse_filepath
def main():
server = SimpleXMLRPCServer(("localhost", 12345))
server = SimpleXMLRPCServer(("localhost", defs.PORT_FUSE_SERVER))
server.register_function(fuse, "fuse")
while True:
server.handle_request()
......
......@@ -300,7 +300,7 @@ def custom_fuse(file_list):
files += defs.DIR_RESULTS + db.results_file[id].data_file + " "
cmd = "python "+ os.path.abspath(defs.DIR_FUSE) +"/fuse.py -o "+output_file+" -t 100 "+files
proc_srvr = xmlrpclib.ServerProxy("http://localhost:12345")
proc_srvr = xmlrpclib.ServerProxy("http://localhost:%d" % defs.PORT_FUSE_SERVER)
fuse_filepath = proc_srvr.fuse(cmd, out_folder, output_filename)
try:
......
......@@ -17,3 +17,7 @@ DIR_OUT_VIDJIL_ID = '/mnt/result/tmp/out-%06d/'
### relative path start from server/web2py
DIR_VIDJIL = '../../'
DIR_FUSE = '../'
### Port on which to run the fuse server
### Used in models/task.py and in /server/fuseserver.py
PORT_FUSE_SERVER = 12789
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment