Make Python script compatible with GraalPy expectations

This commit is contained in:
Artem Bilan
2024-10-04 16:11:05 -04:00
parent 580f19f025
commit ce670e1798
2 changed files with 11 additions and 15 deletions

View File

@@ -1,8 +1,10 @@
from org.springframework.integration.samples.cafe import Drink
import time
import java
Drink = java.type("org.springframework.integration.samples.cafe.Drink")
def prepareDrink(orderItem):
print("python: preparing %s for order %s" % (orderItem,orderItem.order.number))
print("python: preparing %s for order %s" % (orderItem,orderItem.getOrder().getNumber()))
time.sleep(eval(timeToPrepare))
return Drink(orderItem.getOrder().getNumber(), orderItem.getDrinkType(), orderItem.isIced(),
orderItem.getShots())