瀏覽代碼

fix compatibility

latapp 10 月之前
父節點
當前提交
a0fc3d992e
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 2
      fudo/fudo.py
  2. 1 1
      main.py
  3. 2 1
      requirements.txt

+ 1 - 2
fudo/fudo.py

@@ -1,6 +1,5 @@
 import math
 import requests
-from rich import print
 import os
 api_token = os.getenv('FUDO_API_KEY')
 api_secret = os.getenv('FUDO_API_SECRET')
@@ -187,7 +186,7 @@ def create_sale(table_id:int):
         return None
     return r.json()["data"]
 
-def create_item(product_id:int, quantity:int, sale_id:int, comment:str|None = None):
+def create_item(product_id:int, quantity:int, sale_id:int, comment = None):
     url = 'https://api.fu.do/v1alpha1/items'
     token = get_token()
     headers = {

+ 1 - 1
main.py

@@ -59,7 +59,7 @@ app.add_middleware(
 BG_DATA_PATH = os.path.join(os.path.dirname(__file__), 'data.json')
 PRODUCTS_PATH = os.path.join(os.path.dirname(__file__), 'products.json')
 
-def add_product_to_fudo(product_id: int, quantity: int, table_number:int, comment: str | None = None):
+def add_product_to_fudo(product_id: int, quantity: int, table_number:int, comment = None):
     table = fd.get_table(table_number)
     if not table:
         print(f"Error: Table {table_number} not found.")

+ 2 - 1
requirements.txt

@@ -6,4 +6,5 @@ starlette
 itsdangerous
 tabulate
 python-escpos[usb]
-gunicorn
+gunicorn
+requests