Exemplo n.º 1
0
def process_files():
	global allFiles
	allFilesTransformed = transform_allFiles(allFiles)
	if request.method == 'POST':
		results = runProcess(allFilesTransformed)
		# print(convertToJsonArray(results))
		return json.dumps({"success":True, "missing":results['missing'], "data": convertToJsonArray(results['items'])}), 200, {"ContentType":"application/json"}
Exemplo n.º 2
0
def get_categories():
    categories = getFile('categories')
    return json.dumps({
        "success": True,
        "data": convertToJsonArray(categories)
    }), 200, {
        "ContentType": "application/json"
    }
Exemplo n.º 3
0
def get_subcategories():
    file = request.headers.get("source")
    if (file == 'subCategories' or file == 'maps'):
        df = getFile(file)
        return json.dumps({
            "success": True,
            "data": convertToJsonArray(df)
        }), 200, {
            "ContentType": "application/json"
        }
    return json.dumps({
        "success": False,
        "data": "unknownFile"
    }), 200, {
        "ContentType": "application/json"
    }