Popravljeni requirements, upload fix, nekaj drugih popravkov

master
Jan Kostanjevec 2022-06-12 20:06:24 +02:00
parent 5893cca01c
commit 1068f1acee
5 changed files with 14 additions and 52 deletions

2
.gitignore vendored
View File

@ -150,4 +150,4 @@ htmlcov/
dist/ dist/
build/ build/
temp/ temp/
*.egg-info/ *.egg-info/

2
app.py
View File

@ -162,4 +162,4 @@ def create_app(test_config=None):
app = create_app() app = create_app()
app.run(debug=True, host="0.0.0.0") app.run(debug=True, host="0.0.0.0")

View File

@ -28,7 +28,7 @@ def index():
action = request.form.get("menu", False) #internetna rešitev, nevem kako, ampak dela, tj. dobi info iz meni buttonov action = request.form.get("menu", False) #internetna rešitev, nevem kako, ampak dela, tj. dobi info iz meni buttonov
print(action) print(action)
if action == "new_session": if action == "new_session":
#tu bi moral preveriti če je kak unfinished deck, potem bi pisalo continiue, namesto new # @TODO tu bi moral preveriti če je kak unfinished deck, potem bi pisalo continiue, namesto new
#ustvari novi vnos v Deck #ustvari novi vnos v Deck
deck = probabilistic_deck_generator(user_id, 5, 5) deck = probabilistic_deck_generator(user_id, 5, 5)

View File

@ -1,44 +1,5 @@
Package Version Flask==2.1.1
------------------------- --------- PyMySQL==1.0.2
altgraph 0.17.2 pyncclient==0.7
async-generator 1.10 SQLAlchemy==1.4.35
attrs 21.4.0 numpy==1.21.6
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.12
click 8.1.2
colorama 0.4.4
cryptography 36.0.1
Flask 2.1.1
future 0.18.2
greenlet 1.1.2
h11 0.12.0
idna 3.3
importlib-metadata 4.11.3
itsdangerous 2.1.2
Jinja2 3.1.1
MarkupSafe 2.1.1
numpy 1.22.3
outcome 1.1.0
pefile 2021.9.3
pip 21.1.1
pycparser 2.21
pyinstaller 4.8
pyinstaller-hooks-contrib 2021.5
PyMySQL 1.0.2
pyncclient 0.7
pyOpenSSL 21.0.0
pywin32-ctypes 0.2.0
requests 2.27.1
selenium 4.1.0
setuptools 56.0.0
six 1.16.0
sniffio 1.2.0
sortedcontainers 2.4.0
SQLAlchemy 1.4.35
trio 0.19.0
trio-websocket 0.9.2
urllib3 1.26.7
Werkzeug 2.1.1
wsproto 1.0.0
zipp 3.8.0

View File

@ -22,7 +22,8 @@ dbsession = dbsessionmaker()
nc = nextcloud_client.Client('https://obzorje.kompot.si') nc = nextcloud_client.Client('https://obzorje.kompot.si')
nc.login('gia', 'gia0000!') #print("Loggin in", CONFIG['NC_USER'], CONFIG['NC_PASSWORD'])
nc.login(CONFIG['NC_USER'],CONFIG['NC_PASSWORD'])
@bp.route("/", methods=["GET", "POST"]) @bp.route("/", methods=["GET", "POST"])
@ -42,7 +43,7 @@ def upload_file():
filename = secure_filename(upload.filename) filename = secure_filename(upload.filename)
script_path = os.path.dirname(os.path.abspath(__file__)) script_path = os.path.dirname(os.path.abspath(__file__))
temp_path = script_path + "\\temp\\" temp_path = os.path.join(script_path, "temp")
#a lot of stuff can wrong here and nobody may know #a lot of stuff can wrong here and nobody may know
@ -50,8 +51,8 @@ def upload_file():
fp.write(upload.stream.read()) fp.write(upload.stream.read())
path = fp.name path = fp.name
fp.close() fp.close()
nc.put_file("/GIA CLOUD/" + filename, "temp\\" + path.split("\\")[-1]) nc.put_file("/GIA CLOUD/" + filename, path)
os.remove(fp.name) os.remove(path)
#get public link #get public link
public_link = nc.share_file_with_link("/GIA CLOUD/" + filename).get_link()+"/download/"+filename public_link = nc.share_file_with_link("/GIA CLOUD/" + filename).get_link()+"/download/"+filename
@ -61,4 +62,4 @@ def upload_file():
dbsession.add(card) dbsession.add(card)
dbsession.commit() dbsession.commit()
return render_template("menu/upload.html", message=message, user_id=user_id, username=username) return render_template("menu/upload.html", message=message, user_id=user_id, username=username)