diff --git a/.gitignore b/.gitignore index 73cd739..b860013 100644 --- a/.gitignore +++ b/.gitignore @@ -150,4 +150,4 @@ htmlcov/ dist/ build/ temp/ -*.egg-info/ \ No newline at end of file +*.egg-info/ diff --git a/app.py b/app.py index 39fb84b..9f76a44 100644 --- a/app.py +++ b/app.py @@ -162,4 +162,4 @@ def create_app(test_config=None): app = create_app() -app.run(debug=True, host="0.0.0.0") \ No newline at end of file +app.run(debug=True, host="0.0.0.0") diff --git a/menu.py b/menu.py index e7ca3e1..d5a9381 100644 --- a/menu.py +++ b/menu.py @@ -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 print(action) 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 deck = probabilistic_deck_generator(user_id, 5, 5) diff --git a/requirements.txt b/requirements.txt index 049395b..d493a3b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,44 +1,5 @@ -Package Version -------------------------- --------- -altgraph 0.17.2 -async-generator 1.10 -attrs 21.4.0 -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 +Flask==2.1.1 +PyMySQL==1.0.2 +pyncclient==0.7 +SQLAlchemy==1.4.35 +numpy==1.21.6 diff --git a/upload.py b/upload.py index d66e195..94b648e 100644 --- a/upload.py +++ b/upload.py @@ -22,7 +22,8 @@ dbsession = dbsessionmaker() 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"]) @@ -42,7 +43,7 @@ def upload_file(): filename = secure_filename(upload.filename) 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 @@ -50,8 +51,8 @@ def upload_file(): fp.write(upload.stream.read()) path = fp.name fp.close() - nc.put_file("/GIA CLOUD/" + filename, "temp\\" + path.split("\\")[-1]) - os.remove(fp.name) + nc.put_file("/GIA CLOUD/" + filename, path) + os.remove(path) #get public link 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.commit() - return render_template("menu/upload.html", message=message, user_id=user_id, username=username) \ No newline at end of file + return render_template("menu/upload.html", message=message, user_id=user_id, username=username)