check if empty

main
alex 2024-05-27 17:45:24 +02:00
parent 64342af5c8
commit e154dd3b78
4 changed files with 52 additions and 5 deletions

View File

@ -11,6 +11,14 @@
"scriptPath": "empty.py",
"parameters": []
},
{
"name": "Einkaufswagenchip einpacken",
"onFinish": "pause",
"undoPossible": false,
"repeatPossible": true,
"scriptPath": "empty.py",
"parameters": []
},
{
"name": "Produktschilder ausdrucken",
"onFinish": "pause",
@ -46,12 +54,16 @@
"#43356 Flamara der Drache, Farbe, Schwarz",
"#32974 Finn der Sad Hamster, Stil, Standard",
"#60798 Finn der Sad Hamster, Stil, Schlüsselanhänger",
"#30563 Finn der Sad Hamster, Größe, Groß",
"#30563 Finn der Sad Hamster, Stil, Groß",
"#93047 Mia das Kätzchen, Farbe, Grau",
"#86423 Mia das Kätzchen, Farbe, Weiß",
"#56083 Hoppel das Häschen, Farbe, Grau",
"#78693 Elias der Corgi, Farbe, Braun/Weiß",
"#37335 Axel der Axolotl, Farbe, Pink",
"#26822 Dilo der Delfin, Farbe, Blau/Weiß"
"#26822 Dilo der Delfin, Farbe, Blau/Weiß",
"#51665 Einhorn, Farbe, ",
"#35717 Phoenix, Farbe, Sonderanfertigung Rosa/Weiß",
"#74943 Brain der Fuchs, Stil, Standard"
]
}
]

View File

@ -7,6 +7,10 @@ def add_underscore_at_position(text, position):
# Split the string into a list of words
words = text.split()
# Check if the text contains less than two words
if len(words) < 2:
return text
# Check if the position is valid
if position < 0 or position >= len(words) - 1:
raise ValueError("Invalid position for underscore")
@ -62,6 +66,9 @@ def google_sheets_products():
products = []
for row in data[2:]:
if row[0] == "":
continue
products.append({
"id": row[0],
"name": add_underscore_at_position(row[1], int(row[24])),

View File

@ -38,12 +38,16 @@
"#43356 Flamara der Drache, Farbe, Schwarz",
"#32974 Finn der Sad Hamster, Stil, Standard",
"#60798 Finn der Sad Hamster, Stil, Schlüsselanhänger",
"#30563 Finn der Sad Hamster, Größe, Groß",
"#30563 Finn der Sad Hamster, Stil, Groß",
"#93047 Mia das Kätzchen, Farbe, Grau",
"#86423 Mia das Kätzchen, Farbe, Weiß",
"#56083 Hoppel das Häschen, Farbe, Grau",
"#78693 Elias der Corgi, Farbe, Braun/Weiß",
"#37335 Axel der Axolotl, Farbe, Pink",
"#26822 Dilo der Delfin, Farbe, Blau/Weiß"
"#26822 Dilo der Delfin, Farbe, Blau/Weiß",
"#51665 Einhorn, Farbe, ",
"#35717 Phoenix, Farbe, Sonderanfertigung Rosa/Weiß",
"#74943 Brain der Fuchs, Stil, Standard"
],
"global": false
}

View File

@ -111,7 +111,7 @@
{
"id": "30563",
"name": "Finn der_Sad Hamster",
"product_variant": "Größe",
"product_variant": "Stil",
"product_color": "Groß"
},
{
@ -120,6 +120,12 @@
"product_variant": "Farbe",
"product_color": "Grau"
},
{
"id": "86423",
"name": "Mia_das Kätzchen",
"product_variant": "Farbe",
"product_color": "Weiß"
},
{
"id": "56083",
"name": "Hoppel_das Häschen",
@ -143,6 +149,24 @@
"name": "Dilo_der Delfin",
"product_variant": "Farbe",
"product_color": "Blau/Weiß"
},
{
"id": "51665",
"name": "Einhorn",
"product_variant": "Farbe",
"product_color": ""
},
{
"id": "35717",
"name": "Phoenix",
"product_variant": "Farbe",
"product_color": "Sonderanfertigung Rosa/Weiß"
},
{
"id": "74943",
"name": "Brain_der Fuchs",
"product_variant": "Stil",
"product_color": "Standard"
}
]
}