From 018da50c11707443b02f096ba79cdd3619348ec6 Mon Sep 17 00:00:00 2001 From: Lucas Nunes <64300982+kilerhg@users.noreply.github.com> Date: Thu, 9 Sep 2021 20:03:59 -0300 Subject: [PATCH] Revert "Merge pull request #15 from kilerhg/lna/refactor" This reverts commit f30ada5e1eeb402434118842dc8e1b3f31be76d4. --- Procfile | 2 +- app/__pycache__/funcoes.cpython-39.pyc | Bin 1709 -> 0 bytes app/__pycache__/main.cpython-39.pyc | Bin 1774 -> 0 bytes app/main.py | 45 ------------------ app/funcoes.py => funcoes.py | 0 main.py | 44 +++++++++++++++++ app/parameters.py => parameters.py | 0 .../bootstrap/css/bootstrap.min.css | 0 .../bootstrap/js/bootstrap.min.js | 0 {app/static => static}/fonts/FontAwesome.otf | Bin .../fonts/font-awesome.min.css | 0 .../fonts/fontawesome-webfont.eot | Bin .../fonts/fontawesome-webfont.svg | 0 .../fonts/fontawesome-webfont.ttf | Bin .../fonts/fontawesome-webfont.woff | Bin .../fonts/fontawesome-webfont.woff2 | Bin .../img/background_livro.jpg | Bin .../img/background_livro_2.jpg | Bin {app/static => static}/img/downloads-bg.jpg | Bin {app/static => static}/img/intro-bg.jpg | Bin .../img/pexels-wendy-van-zyl-1112048.jpg | Bin {app/static => static}/js/grayscale.js | 0 {app/static => static}/style/style.css | 0 .../assets/bootstrap/css/bootstrap.min.css | 0 .../assets/bootstrap/js/bootstrap.min.js | 0 .../assets/fonts/FontAwesome.otf | Bin .../assets/fonts/font-awesome.min.css | 0 .../assets/fonts/fontawesome-webfont.eot | Bin .../assets/fonts/fontawesome-webfont.svg | 0 .../assets/fonts/fontawesome-webfont.ttf | Bin .../assets/fonts/fontawesome-webfont.woff | Bin .../assets/fonts/fontawesome-webfont.woff2 | Bin .../assets/img/background_livro.jpg | Bin .../assets/img/background_livro_2.jpg | Bin .../assets/img/downloads-bg.jpg | Bin .../assets/img/intro-bg.jpg | Bin .../img/pexels-wendy-van-zyl-1112048.jpg | Bin .../assets/js/grayscale.js | 0 {app/templates => templates}/home_page.html | 0 {app/templates => templates}/index.html | 0 {app/templates => templates}/library.html | 0 {app/templates => templates}/search.html | 0 42 files changed, 45 insertions(+), 46 deletions(-) delete mode 100644 app/__pycache__/funcoes.cpython-39.pyc delete mode 100644 app/__pycache__/main.cpython-39.pyc delete mode 100644 app/main.py rename app/funcoes.py => funcoes.py (100%) create mode 100644 main.py rename app/parameters.py => parameters.py (100%) rename {app/static => static}/bootstrap/css/bootstrap.min.css (100%) rename {app/static => static}/bootstrap/js/bootstrap.min.js (100%) rename {app/static => static}/fonts/FontAwesome.otf (100%) rename {app/static => static}/fonts/font-awesome.min.css (100%) rename {app/static => static}/fonts/fontawesome-webfont.eot (100%) rename {app/static => static}/fonts/fontawesome-webfont.svg (100%) rename {app/static => static}/fonts/fontawesome-webfont.ttf (100%) rename {app/static => static}/fonts/fontawesome-webfont.woff (100%) rename {app/static => static}/fonts/fontawesome-webfont.woff2 (100%) rename {app/static => static}/img/background_livro.jpg (100%) rename {app/static => static}/img/background_livro_2.jpg (100%) rename {app/static => static}/img/downloads-bg.jpg (100%) rename {app/static => static}/img/intro-bg.jpg (100%) rename {app/static => static}/img/pexels-wendy-van-zyl-1112048.jpg (100%) rename {app/static => static}/js/grayscale.js (100%) rename {app/static => static}/style/style.css (100%) rename {app/templates => templates}/assets/bootstrap/css/bootstrap.min.css (100%) rename {app/templates => templates}/assets/bootstrap/js/bootstrap.min.js (100%) rename {app/templates => templates}/assets/fonts/FontAwesome.otf (100%) rename {app/templates => templates}/assets/fonts/font-awesome.min.css (100%) rename {app/templates => templates}/assets/fonts/fontawesome-webfont.eot (100%) rename {app/templates => templates}/assets/fonts/fontawesome-webfont.svg (100%) rename {app/templates => templates}/assets/fonts/fontawesome-webfont.ttf (100%) rename {app/templates => templates}/assets/fonts/fontawesome-webfont.woff (100%) rename {app/templates => templates}/assets/fonts/fontawesome-webfont.woff2 (100%) rename {app/templates => templates}/assets/img/background_livro.jpg (100%) rename {app/templates => templates}/assets/img/background_livro_2.jpg (100%) rename {app/templates => templates}/assets/img/downloads-bg.jpg (100%) rename {app/templates => templates}/assets/img/intro-bg.jpg (100%) rename {app/templates => templates}/assets/img/pexels-wendy-van-zyl-1112048.jpg (100%) rename {app/templates => templates}/assets/js/grayscale.js (100%) rename {app/templates => templates}/home_page.html (100%) rename {app/templates => templates}/index.html (100%) rename {app/templates => templates}/library.html (100%) rename {app/templates => templates}/search.html (100%) diff --git a/Procfile b/Procfile index 42b486c..8001d1a 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn app.main:create_app +web: gunicorn app:app \ No newline at end of file diff --git a/app/__pycache__/funcoes.cpython-39.pyc b/app/__pycache__/funcoes.cpython-39.pyc deleted file mode 100644 index 1365b54ec54b3f15aa7276028c2a9fc25bbcb477..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1709 zcmZ`(&2Jnv6t_K}`;jFiZRsLZMF=6S1ld;HLiuVcq)3oM8-cI_D`z~}bu(j6Y)?X> z*%RT2gg8eiIr6`7<}e44;6ncdIPpBQi`pVQ^82vgy!ZV4{9`LCT?FH|@3+{WJ%s*n z%Co}*T$xo3q*b1=K&8dFb#ObV^|5(h<7eA@ABS-Ph*ZB zqtVJ!@Pu{~;@D!iC_c<>nC49&7FFmQJa-%e#};3a3glPNHNNt$(VSESeBs@ZUwg*t zI@alNnHpHL|&-Ipd~I=?axxiM<5wjHiTEP z9sp0U(-yPFSXN?KjH8{I0$UcS^e=hkRY8h7L^5vTScw<_D6A3^H(g z`T3)nwT0Olk2O2poC-TD;YFkx8rwoHn~BQDMSvnvmTP4Ot$kbyBcOV%_1ka^^A-?9 zLfpsU^7||7$DsG|Z8u4u#F5k2NSDOE9)kS{>j>C$UGF;HEjC^M6$sqH2lNd93Yim& zD*}MxP0`%1Jm}`Fc~Ax1y~*%=U`Z8n?>jt?K1XsDBlmHC9({o%xr?eu->Lj7uZpf+ z&w>mc7o3M1pMJEnyK%m`tn%q8R9UHMmI7j!ro0CLEM|OiZ+xP%GEdD1$M4Z@EAK#~ z!9i|As(@w#S#+9MHhCvMhAL@Q40NL7t8rof4Sos7x zw3Qn(y3#6EGYdXmM3tUNnNDUCm+fZ|$-D{#5ubE%OnirUgx~?(PZ#@e6Z$pSh1C0w zb+p498Wv1)W@=J!9l*j1=g|)JoBy7P?Z8+!uomCX6)&^&eP?EzUx%{sojB_H@#r5) C{-rMf diff --git a/app/__pycache__/main.cpython-39.pyc b/app/__pycache__/main.cpython-39.pyc deleted file mode 100644 index f3cc8be715dc2216ec1fc51e0aec9f4ef278b3dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1774 zcma)7&2Aev5GJ|5T1&N?f2Bc@6hVQ#SUDSp(Kcv%a|_s~g@G-#r0unLwJJ%q&B8u8 zS6}i3?a{Ba*PikUIdx_v+e)ecrm#cqaAx@No0*jy3=#%o_-;%7<}>y$zAO&`FW2x(@Hws#YU^r=)!f;%vAYdW4g%b-)Gvo-S-@Qc^4hdCPkxdfw8Vf z3=6={Uc+PGfpE<63x3Yd*xy3&f4CCLd&@w>&)A7jKH@qOD!LRZRz2DgWSfBPn(C9r zBh3IbU#NA`_@vnY&6nyPX#&#R2h9WZkTfA_9)aeudP17$jKS@PyC3-IBh-MCA-j9< zSiFJ*b}u;CirqFTft$ZJk6m3|apS@66*Frvk@)c9_13|kjXAYbS?GiPMm0Y)&FO)h zP7i8XPBy1+x_~0|FgTvVL^~{u2A*@U+T5<1LRNNXldRfsG@jW)cHYlF?sxvLzwGTJ z*R^)Xjry2tjD=hi>Q}HhV&{PTge!h3%u84aC5G&rJMY9lAb7a*6x$$~@tUm!$OhX%{Q1Sl|81{tP51KTm`e)3xaaNA1pcHO91rFXEREIL2q IG4Ff-0Xj5_Bme*a diff --git a/app/main.py b/app/main.py deleted file mode 100644 index e29d760..0000000 --- a/app/main.py +++ /dev/null @@ -1,45 +0,0 @@ -from flask import Flask, render_template, redirect, url_for, request -import requests -from . import funcoes - - -def create_app(): - app = Flask(__name__) - - @app.route("/") - def index(): - return render_template('index.html') - - @app.route("/busca", methods=["GET", "POST"]) - def search(): - lista_livros = [] - if request.method == "POST": - livro = request.form["book_name"] - lista_livros = funcoes.search_book(busca=livro) - return render_template('search.html', books=lista_livros) - - @app.route("/biblioteca") - def library(): - return render_template('library.html') - - @app.route("/biblioteca/") - def add_book_library(isbn): - print(isbn) - return render_template('library.html') - - @app.route("/cadastrar") - def register(): - return "Aba cadastrar" - - @app.route("/login") - def login(): - return "Aba login" - - @app.route("/logout") - def log_out(): - return "Aba logout" - return app - -# if __name__ == "__main__": -# app.run(debug=True) - diff --git a/app/funcoes.py b/funcoes.py similarity index 100% rename from app/funcoes.py rename to funcoes.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..e980f24 --- /dev/null +++ b/main.py @@ -0,0 +1,44 @@ +from flask import Flask, render_template, redirect, url_for, request +import requests + +import funcoes + +app = Flask(__name__) + +@app.route("/") +def index(): + return render_template('index.html') + +@app.route("/busca", methods=["GET", "POST"]) +def search(): + lista_livros = [] + if request.method == "POST": + livro = request.form["book_name"] + lista_livros = funcoes.search_book(busca=livro) + return render_template('search.html', books=lista_livros) + +@app.route("/biblioteca") +def library(): + return render_template('library.html') + +@app.route("/biblioteca/") +def add_book_library(isbn): + print(isbn) + return render_template('library.html') + +@app.route("/cadastrar") +def register(): + return "Aba cadastrar" + +@app.route("/login") +def login(): + return "Aba login" + +@app.route("/logout") +def log_out(): + return "Aba logout" + + +if __name__ == "__main__": + app.run(debug=True) + diff --git a/app/parameters.py b/parameters.py similarity index 100% rename from app/parameters.py rename to parameters.py diff --git a/app/static/bootstrap/css/bootstrap.min.css b/static/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/static/bootstrap/css/bootstrap.min.css rename to static/bootstrap/css/bootstrap.min.css diff --git a/app/static/bootstrap/js/bootstrap.min.js b/static/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/static/bootstrap/js/bootstrap.min.js rename to static/bootstrap/js/bootstrap.min.js diff --git a/app/static/fonts/FontAwesome.otf b/static/fonts/FontAwesome.otf similarity index 100% rename from app/static/fonts/FontAwesome.otf rename to static/fonts/FontAwesome.otf diff --git a/app/static/fonts/font-awesome.min.css b/static/fonts/font-awesome.min.css similarity index 100% rename from app/static/fonts/font-awesome.min.css rename to static/fonts/font-awesome.min.css diff --git a/app/static/fonts/fontawesome-webfont.eot b/static/fonts/fontawesome-webfont.eot similarity index 100% rename from app/static/fonts/fontawesome-webfont.eot rename to static/fonts/fontawesome-webfont.eot diff --git a/app/static/fonts/fontawesome-webfont.svg b/static/fonts/fontawesome-webfont.svg similarity index 100% rename from app/static/fonts/fontawesome-webfont.svg rename to static/fonts/fontawesome-webfont.svg diff --git a/app/static/fonts/fontawesome-webfont.ttf b/static/fonts/fontawesome-webfont.ttf similarity index 100% rename from app/static/fonts/fontawesome-webfont.ttf rename to static/fonts/fontawesome-webfont.ttf diff --git a/app/static/fonts/fontawesome-webfont.woff b/static/fonts/fontawesome-webfont.woff similarity index 100% rename from app/static/fonts/fontawesome-webfont.woff rename to static/fonts/fontawesome-webfont.woff diff --git a/app/static/fonts/fontawesome-webfont.woff2 b/static/fonts/fontawesome-webfont.woff2 similarity index 100% rename from app/static/fonts/fontawesome-webfont.woff2 rename to static/fonts/fontawesome-webfont.woff2 diff --git a/app/static/img/background_livro.jpg b/static/img/background_livro.jpg similarity index 100% rename from app/static/img/background_livro.jpg rename to static/img/background_livro.jpg diff --git a/app/static/img/background_livro_2.jpg b/static/img/background_livro_2.jpg similarity index 100% rename from app/static/img/background_livro_2.jpg rename to static/img/background_livro_2.jpg diff --git a/app/static/img/downloads-bg.jpg b/static/img/downloads-bg.jpg similarity index 100% rename from app/static/img/downloads-bg.jpg rename to static/img/downloads-bg.jpg diff --git a/app/static/img/intro-bg.jpg b/static/img/intro-bg.jpg similarity index 100% rename from app/static/img/intro-bg.jpg rename to static/img/intro-bg.jpg diff --git a/app/static/img/pexels-wendy-van-zyl-1112048.jpg b/static/img/pexels-wendy-van-zyl-1112048.jpg similarity index 100% rename from app/static/img/pexels-wendy-van-zyl-1112048.jpg rename to static/img/pexels-wendy-van-zyl-1112048.jpg diff --git a/app/static/js/grayscale.js b/static/js/grayscale.js similarity index 100% rename from app/static/js/grayscale.js rename to static/js/grayscale.js diff --git a/app/static/style/style.css b/static/style/style.css similarity index 100% rename from app/static/style/style.css rename to static/style/style.css diff --git a/app/templates/assets/bootstrap/css/bootstrap.min.css b/templates/assets/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/templates/assets/bootstrap/css/bootstrap.min.css rename to templates/assets/bootstrap/css/bootstrap.min.css diff --git a/app/templates/assets/bootstrap/js/bootstrap.min.js b/templates/assets/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/templates/assets/bootstrap/js/bootstrap.min.js rename to templates/assets/bootstrap/js/bootstrap.min.js diff --git a/app/templates/assets/fonts/FontAwesome.otf b/templates/assets/fonts/FontAwesome.otf similarity index 100% rename from app/templates/assets/fonts/FontAwesome.otf rename to templates/assets/fonts/FontAwesome.otf diff --git a/app/templates/assets/fonts/font-awesome.min.css b/templates/assets/fonts/font-awesome.min.css similarity index 100% rename from app/templates/assets/fonts/font-awesome.min.css rename to templates/assets/fonts/font-awesome.min.css diff --git a/app/templates/assets/fonts/fontawesome-webfont.eot b/templates/assets/fonts/fontawesome-webfont.eot similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.eot rename to templates/assets/fonts/fontawesome-webfont.eot diff --git a/app/templates/assets/fonts/fontawesome-webfont.svg b/templates/assets/fonts/fontawesome-webfont.svg similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.svg rename to templates/assets/fonts/fontawesome-webfont.svg diff --git a/app/templates/assets/fonts/fontawesome-webfont.ttf b/templates/assets/fonts/fontawesome-webfont.ttf similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.ttf rename to templates/assets/fonts/fontawesome-webfont.ttf diff --git a/app/templates/assets/fonts/fontawesome-webfont.woff b/templates/assets/fonts/fontawesome-webfont.woff similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.woff rename to templates/assets/fonts/fontawesome-webfont.woff diff --git a/app/templates/assets/fonts/fontawesome-webfont.woff2 b/templates/assets/fonts/fontawesome-webfont.woff2 similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.woff2 rename to templates/assets/fonts/fontawesome-webfont.woff2 diff --git a/app/templates/assets/img/background_livro.jpg b/templates/assets/img/background_livro.jpg similarity index 100% rename from app/templates/assets/img/background_livro.jpg rename to templates/assets/img/background_livro.jpg diff --git a/app/templates/assets/img/background_livro_2.jpg b/templates/assets/img/background_livro_2.jpg similarity index 100% rename from app/templates/assets/img/background_livro_2.jpg rename to templates/assets/img/background_livro_2.jpg diff --git a/app/templates/assets/img/downloads-bg.jpg b/templates/assets/img/downloads-bg.jpg similarity index 100% rename from app/templates/assets/img/downloads-bg.jpg rename to templates/assets/img/downloads-bg.jpg diff --git a/app/templates/assets/img/intro-bg.jpg b/templates/assets/img/intro-bg.jpg similarity index 100% rename from app/templates/assets/img/intro-bg.jpg rename to templates/assets/img/intro-bg.jpg diff --git a/app/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg b/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg similarity index 100% rename from app/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg rename to templates/assets/img/pexels-wendy-van-zyl-1112048.jpg diff --git a/app/templates/assets/js/grayscale.js b/templates/assets/js/grayscale.js similarity index 100% rename from app/templates/assets/js/grayscale.js rename to templates/assets/js/grayscale.js diff --git a/app/templates/home_page.html b/templates/home_page.html similarity index 100% rename from app/templates/home_page.html rename to templates/home_page.html diff --git a/app/templates/index.html b/templates/index.html similarity index 100% rename from app/templates/index.html rename to templates/index.html diff --git a/app/templates/library.html b/templates/library.html similarity index 100% rename from app/templates/library.html rename to templates/library.html diff --git a/app/templates/search.html b/templates/search.html similarity index 100% rename from app/templates/search.html rename to templates/search.html