Commit 70f3cb19 authored by Mathieu Giraud's avatar Mathieu Giraud

server/*.py: remove unused imports

Thanks to landscape.io.
parent e325ed6e
......@@ -4,9 +4,9 @@ from subprocess import *
import sys
sys.path.insert(0, './web2py/applications/vidjil/modules')
import defs
import os.path
def fuse(cmd, output_dir, filename):
import time, datetime, os.path
from subprocess import Popen, PIPE, STDOUT, os
fuse_log_file = open(output_dir+'/'+filename+'.fuse.log', 'w')
......
......@@ -59,8 +59,6 @@ def edit():
def edit_form():
import shutil, os.path
error =""
required_fields = ['id', 'config_name', 'config_command', 'config_fuse_command', 'config_program']
......@@ -92,8 +90,6 @@ def confirm():
return dict(message=T('confirm config deletion'))
def delete():
import shutil, os.path
#delete results_file using this config
db(db.results_file.config_id==request.vars["id"]).delete()
......
......@@ -232,8 +232,6 @@ def get_data():
#########################################################################
def get_custom_data():
import time
import vidjil_utils
from subprocess import Popen, PIPE, STDOUT
if not auth.user :
res = {"redirect" : URL('default', 'user', args='login', scheme=True, host=True)} #TODO _next
......@@ -478,7 +476,6 @@ def impersonate() :
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def stop_impersonate() :
import time
if auth.is_impersonating() :
log.debug({"success" : "true", "message" : "impersonate << stop"})
auth.impersonate(0)
......
......@@ -3,6 +3,8 @@ import gluon.contrib.simplejson
import defs
import vidjil_utils
import os
import os.path
import datetime
from controller_utils import error_message
if request.env.http_origin:
......@@ -31,7 +33,6 @@ def add():
#TODO check data
def add_form():
import shutil, os.path, datetime
error = ""
if request.vars['sampling_date'] != '' :
......@@ -83,7 +84,6 @@ def edit():
#TODO check data
def edit_form():
import shutil, os.path, datetime
error = ""
if request.vars['id'] == None :
......@@ -174,7 +174,6 @@ def delete_sequence_file(seq_id):
return error_message('you need admin permission to delete this file')
def delete():
import shutil, os.path
patient_id = db.sequence_file[request.vars["id"]].patient_id
delete_results = ('delete_results' in request.vars and request.vars['delete_results'] == 'True')
......
......@@ -18,7 +18,6 @@ def add():
## redirect to group list if success
## return a flash error message if error
def add_form():
import gluon.contrib.simplejson, datetime
error = ""
if request.vars["group_name"] == "" :
......
......@@ -562,7 +562,6 @@ def confirm():
#
def delete():
if (auth.can_modify_patient(request.vars["id"]) ):
import os.path
#delete data file
query = db( (db.sequence_file.patient_id==request.vars["id"])).select()
for row in query :
......
......@@ -4,11 +4,13 @@ import sys
import defs
import re
import os.path
import time
import sys
import datetime
TASK_TIMEOUT = 60 * 60
def schedule_run(id_sequence, id_config):
import time, datetime, os.path
from subprocess import Popen, PIPE, STDOUT, os
id_patient = db.sequence_file[id_sequence].patient_id
......@@ -64,7 +66,6 @@ def schedule_run(id_sequence, id_config):
def run_vidjil(id_file, id_config, id_data, id_fuse, clean_before=False, clean_after=False):
import time, datetime, os.path
from subprocess import Popen, PIPE, STDOUT, os
## les chemins d'acces a vidjil / aux fichiers de sequences
......@@ -176,7 +177,6 @@ def run_vidjil(id_file, id_config, id_data, id_fuse, clean_before=False, clean_a
def run_copy(id_file, id_config, id_data, id_fuse, clean_before=False, clean_after=False):
import time, datetime, sys, os.path
from subprocess import Popen, PIPE, STDOUT, os
## les chemins d'acces a vidjil / aux fichiers de sequences
......@@ -238,7 +238,6 @@ def run_copy(id_file, id_config, id_data, id_fuse, clean_before=False, clean_aft
def run_fuse(id_file, id_config, id_data, id_fuse, clean_before=True, clean_after=False):
import time, datetime, sys, os.path
from subprocess import Popen, PIPE, STDOUT, os
out_folder = defs.DIR_OUT_VIDJIL_ID % id_data
......@@ -316,8 +315,6 @@ def run_fuse(id_file, id_config, id_data, id_fuse, clean_before=True, clean_afte
return "SUCCESS"
def custom_fuse(file_list):
import time, datetime, sys, os.path, random, xmlrpclib
from subprocess import Popen, PIPE, STDOUT, os
if defs.PORT_FUSE_SERVER is None:
raise IOError('This server cannot fuse custom data')
......
import defs
import datetime
patient_id = 10
......
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