@@ -26,13 +26,13 def index(request): | |||||
26 | siteName, siteList = madWebObj.getSiteInfo() |
|
26 | siteName, siteList = madWebObj.getSiteInfo() | |
27 | err = False |
|
27 | err = False | |
28 | if request.method == 'POST': |
|
28 | if request.method == 'POST': | |
29 | for root, folders, tmp_files in os.walk('/tmp/'): |
|
29 | for root, folders, tmp_files in os.walk('/madrigal/experiments/tmp/'): | |
30 | for f in tmp_files: |
|
30 | for f in tmp_files: | |
31 | os.remove(os.path.join(root, f)) |
|
31 | os.remove(os.path.join(root, f)) | |
32 |
|
32 | |||
33 | form = UpdataForm(request.POST, request.FILES) |
|
33 | form = UpdataForm(request.POST, request.FILES) | |
34 |
files = |
|
34 | files = request.FILES.getlist('file') | |
35 | files.sort() |
|
35 | # files.sort() | |
36 | filenames = [] |
|
36 | filenames = [] | |
37 |
|
37 | |||
38 | choose = request.POST.get('choose') |
|
38 | choose = request.POST.get('choose') | |
@@ -51,9 +51,9 def index(request): | |||||
51 | first = True |
|
51 | first = True | |
52 |
|
52 | |||
53 | if len(files) == 1: |
|
53 | if len(files) == 1: | |
54 | fs = FileSystemStorage(location='/tmp') |
|
54 | fs = FileSystemStorage(location='/madrigal/experiments/tmp') | |
55 | fs.save(files[0].name, files[0]) |
|
55 | fs.save(files[0].name, files[0]) | |
56 | filename = os.path.join('/tmp', files[0].name) |
|
56 | filename = os.path.join('/madrigal/experiments/tmp', files[0].name) | |
57 | fileInfo = madrigal.data.MadrigalFile(filename, madDB) |
|
57 | fileInfo = madrigal.data.MadrigalFile(filename, madDB) | |
58 | sTime = fileInfo.getEarliestTime() |
|
58 | sTime = fileInfo.getEarliestTime() | |
59 | startTime = datetime.datetime(sTime[0],sTime[1],sTime[2],sTime[3],sTime[4],sTime[5]) |
|
59 | startTime = datetime.datetime(sTime[0],sTime[1],sTime[2],sTime[3],sTime[4],sTime[5]) | |
@@ -71,8 +71,8 def index(request): | |||||
71 | 'An error occur adding file {}: {}'.format(filename.split('/')[-1], e) |
|
71 | 'An error occur adding file {}: {}'.format(filename.split('/')[-1], e) | |
72 | ) |
|
72 | ) | |
73 | else: |
|
73 | else: | |
74 | if os.path.exists(os.path.join('/tmp', 'overview', files[0].name + '.summary')): |
|
74 | if os.path.exists(os.path.join('/madrigal/experiments/tmp', 'overview', files[0].name + '.summary')): | |
75 | os.remove(os.path.join('/tmp', 'overview', files[0].name + '.summary')) |
|
75 | os.remove(os.path.join('/madrigal/experiments/tmp', 'overview', files[0].name + '.summary')) | |
76 | ext = filename.split('.')[-1] |
|
76 | ext = filename.split('.')[-1] | |
77 | if ext not in ('hdf5', 'h5'): |
|
77 | if ext not in ('hdf5', 'h5'): | |
78 | convert = True |
|
78 | convert = True | |
@@ -89,9 +89,9 def index(request): | |||||
89 | filenames.append(filename.split('/')[-1]) |
|
89 | filenames.append(filename.split('/')[-1]) | |
90 | else: |
|
90 | else: | |
91 | for f in files: |
|
91 | for f in files: | |
92 | fs = FileSystemStorage(location='/tmp') |
|
92 | fs = FileSystemStorage(location='/madrigal/experiments/tmp') | |
93 | fs.save(f.name, f) |
|
93 | fs.save(f.name, f) | |
94 | filename = os.path.join('/tmp', f.name) |
|
94 | filename = os.path.join('/madrigal/experiments/tmp', f.name) | |
95 | ext = filename.split('.')[-1] |
|
95 | ext = filename.split('.')[-1] | |
96 | if ext not in ('hdf5', 'h5'): |
|
96 | if ext not in ('hdf5', 'h5'): | |
97 | convert = True |
|
97 | convert = True |
General Comments 0
You need to be logged in to leave comments.
Login now