From cd9b4484c86a0be062a68fce8e92ebde13bff5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Thu, 10 Jul 2025 16:54:45 +0200 Subject: [PATCH] Shop.py: python <3.6 compatibility --- brmbar3/brmbar/Shop.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/brmbar3/brmbar/Shop.py b/brmbar3/brmbar/Shop.py index e7dbc6c..dd762c1 100644 --- a/brmbar3/brmbar/Shop.py +++ b/brmbar3/brmbar/Shop.py @@ -28,7 +28,8 @@ class Shop: # Call the stored procedure for the sale cost = self.db.execute_and_fetch( "SELECT public.sell_item(%s, %s, %s, %s, %s)", - [item.id, amount, user.id, self.currency.id, f"BrmBar sale of {amount}x {item.name} to {user.name}"] + [item.id, amount, user.id, self.currency.id, + "BrmBar sale of {0}x {1} to {2}".format(amount, item.name, user.name)] )[0]#[0] self.db.commit() @@ -48,7 +49,8 @@ class Shop: def sell_for_cash(self, item, amount = 1): cost = self.db.execute_and_fetch( "SELECT public.sell_item_for_cash(%s, %s, %s, %s, %s)", - [item.id, amount, user.id, self.currency.id, f"BrmBar sale of {amount}x {item.name} for cash"] + [item.id, amount, user.id, self.currency.id, + "BrmBar sale of {0}x {1} for cash".format(amount, item.name)] )[0]#[0] self.db.commit() @@ -79,7 +81,7 @@ class Shop: # Call the stored procedure for undoing a sale cost = self.db.execute_and_fetch( "SELECT public.undo_sale_of_item(%s, %s, %s, %s)", - [item.id, amount, user.id, user.currency.id, f"BrmBar sale UNDO of {amount}x {item.name} to {user.name}"] + [item.id, amount, user.id, user.currency.id, "BrmBar sale UNDO of {0}x {1} to {2}".format(amount, item.name, user.name)] )[0]#[0] self.db.commit()