timer.py 413 B

12345678910111213141516171819202122
  1. from threading import Thread
  2. from valeurs import *
  3. class Timer(Thread):
  4. def __init__(self, valeur,verrou):
  5. Thread.__init__(self)
  6. def run(self):
  7. i=0
  8. while 1:
  9. #~ with verrou:
  10. if valeur[i].tempsRestant() < 30:
  11. if valeur[i].getNewTaux() > 0:
  12. valeur[i].MiseEnVente()
  13. else:
  14. valeur[i].MiseEnAnnulation()
  15. time.sleep(0.4)
  16. i=i+1
  17. if i<39:
  18. i=0