From a5de5f9e35e5a8bc0246653c56b638e5f6fb5e98 Mon Sep 17 00:00:00 2001 From: janko Date: Mon, 31 Oct 2022 18:22:26 +0100 Subject: [PATCH] cleanup --- get_files.py | 8 ++------ get_public_links.py | 2 -- settings.py | 7 ------- share.py | 5 +---- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/get_files.py b/get_files.py index 56e8f60..26c7218 100644 --- a/get_files.py +++ b/get_files.py @@ -12,16 +12,12 @@ options = { } client = Client(options) -print(dir(client)) def get_file_list(): return client.list("/GIA CLOUD") for file in get_file_list(): - link = client.get_url(file) - print(link) - + link = client.get_url(file) -info = client.info("/GIA CLOUD") - +info = client.info("/GIA CLOUD") \ No newline at end of file diff --git a/get_public_links.py b/get_public_links.py index 9e9ab5d..8f19a64 100644 --- a/get_public_links.py +++ b/get_public_links.py @@ -14,8 +14,6 @@ name = seznam[0].get_name() public_share = nc.share_file_with_link("/GIA CLOUD/"+name) public_link= public_share.get_link()+"/download/"+name -print(public_link) - def test_file(): return public_link diff --git a/settings.py b/settings.py index 4f0c424..7d45ca1 100644 --- a/settings.py +++ b/settings.py @@ -13,9 +13,7 @@ def get_settings(user_id): #tu rešujejo none user bug, ki se pojavi, ko na novo reg user, ni zazznan v querryju # zdaj imamo problem clasha med globalno in lokalno spremenljivko "dbsession" if user == None: - print("user je bil none") user = dbsession.query(User).get(user_id) - print("User je: ", user) settings_db = user.settings if settings_db == "": @@ -29,7 +27,6 @@ def get_settings(user_id): settings_dict = json.loads(settings_db) dbsession.close() - print("this is it: ", settings_dict) return settings_dict @@ -47,8 +44,6 @@ def save_settings(): return render_template("settings.html", username=username, settings=settings_old) if request.method == "POST": - print('this is the form ', request.form) - #request form stuff settings_dict = { "max_new" : request.form.get('max_new', False), @@ -56,9 +51,7 @@ def save_settings(): "max_shared" : request.form.get('max_shared', False), } - print('this is the dict: ', settings_dict) settings_json = json.dumps(settings_dict) - print('this is the json: ', settings_json) user = dbsession.query(User).get(user_id) user.settings = settings_json diff --git a/share.py b/share.py index 5e25d3b..ab138e8 100644 --- a/share.py +++ b/share.py @@ -23,7 +23,6 @@ def share(card, user_id): #skip če že ima ta card v db. existing = dbsession.query(Card).filter(Card.title == card.title, Card.owner_id==user.id).all() if existing == []: - print("sharing to, ", user.id) new_card = card = Card(title=card.title, interest_rate=-1.0, owner_id=user.id, item_location=card.item_location, last_review=None, share_id=h) dbsession.add(new_card) dbsession.commit() @@ -31,7 +30,6 @@ def share(card, user_id): def get_all_shared(user_id): """adds all existing shared cards to this users collection""" - print("DODAJAMO VSE KARTE TEMU NOVEMU USERJU") dbsession = get_session() #get all cards with a shared id but make suer they are unique. add them to collection of user @@ -41,5 +39,4 @@ def get_all_shared(user_id): for c in all_shared_cards: new_card = Card(title= c.title, interest_rate=-1.0, owner_id=user_id, item_location=c.item_location, last_review=None, share_id=c.share_id) dbsession.add(new_card) - dbsession.commit() - print(c.title, c.share_id, c.item_location) \ No newline at end of file + dbsession.commit() \ No newline at end of file