reportes de mario y oscar en demo

parent 72ad25cd
......@@ -109,14 +109,25 @@ def Reports(request):
folders = []
zip = ""
if(request.user.username == "demo"):
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds',
'search__startDate', 'search__endDate', 'search__process_id__name',
'search__search_name', 'is_public','name','description', 'user__email'
).filter(
user_id__in=[request.user.id, 37, 2],
purchased=1
)
else:
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds',
'search__startDate', 'search__endDate', 'search__process_id__name',
'search__search_name', 'is_public','name','description', 'user__email'
).filter(
user_id=request.user.id,
purchased=1
)
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds', 'search__startDate',
'search__endDate', 'search__process_id__name', 'search__search_name',
'is_public','name','description').filter(
user_id=request.user.id, purchased=1)
for producto in product_list:
log_info = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log"
log_info = USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log"
#####################################################
# progress bar #
......@@ -150,7 +161,7 @@ def Reports(request):
initial_folder = "."
absolute_path = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/"
absolute_path = USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/"
if not os.path.exists(absolute_path):
print("folder out noes not exists")
else:
......@@ -168,12 +179,12 @@ def Reports(request):
zip_path = USERS_PATH + request.user.email + "/" + str(producto['id'])
zip_path = USERS_PATH + producto['user__email'] + "/" + str(producto['id'])
# print(zip_path)
# "../ static / reports / tmpImages / repsat_test_dev / umorales @ centrogeo.edu.mx / "+str(producto['id']) / myzip.zip"
wkt = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/findProducts.json"
wkt = USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/findProducts.json"
with open(wkt, 'r') as jsonfile:
polygon = json.load(jsonfile)
......@@ -229,10 +240,10 @@ def wsProcessProgress(request):
else:
if 'Starting Process...' in open(log_info).read():
progress = 10
progress_text = 'Processing...'
progress_text = 'Processing...'
if 'Creating Shape file...' in open(log_info).read():
progress = 20
progress_text = 'Creating Shape file...'
progress_text = 'Creating Shape file...'
if 'Linking Products...' in open(log_info).read():
progress = 30
progress_text = 'Linking Products...'
......@@ -247,10 +258,10 @@ def wsProcessProgress(request):
progress_text = 'Extracting SCL information...'
if 'Spliting SCL image...' in open(log_info).read():
progress = 70
progress_text = 'Spliting SCL image...'
progress_text = 'Spliting SCL image...'
if 'Creating Tiles...' in open(log_info).read():
progress = 90
progress_text = 'Creating Tiles...'
progress_text = 'Creating Tiles...'
if 'Finalizing...' in open(log_info).read():
progress = 100
progress_text = 'Finalizing...'
......
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