Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pdfAnalyzer/app.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# third-party modules
# third-party modules to be imported

try:
from flask import Flask, render_template, url_for, redirect, request
from werkzeug.utils import secure_filename
from flask import send_from_directory

except ImportError as ie:
print(f"Please install the required packages in the requirements.txt file: {ie}")
print(f"Please install the required packages in the requirements.txt file first: {ie}")

# built-in modules
import os

# our modules
# custom modules
from helper import allowed_files
from text_conversion import txt_converter
from file_downloader import downloader
Expand All @@ -26,7 +26,7 @@
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.secret_key = 'secret key'

# redirect to local-host
# redirecting to local-host
@app.route('/', methods = ['POST', 'GET'])
def home():
'''
Expand Down Expand Up @@ -116,4 +116,4 @@ def analyze_pdf_page(filename):
return render_template('./home/analyzer.html', title = "PDF Analysis", output_data = output_data)

if __name__ == '__main__':
app.run(debug = True)
app.run(debug = True)