Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

run_server.py 878B

4 år sedan
4 år sedan
1234567891011121314151617181920212223242526272829303132333435
  1. from .servicethread import ListeningThread
  2. from .executorthread import ExecutorThread
  3. def do_main_program(projects):
  4. global thread, stop
  5. thread = ListeningThread('localhost', 5000, ExecutorThread, projects=projects)
  6. thread.start()
  7. def program_cleanup(signum, frame):
  8. global thread, stop
  9. thread.stop()
  10. stop = True
  11. thread = None
  12. stop = False
  13. # Information
  14. from .manage import search_simulations
  15. projects = {sc.get_project_label(): sc for sc in search_simulations_in_module().values()}
  16. print('Available module projects: %s' % list(projects.keys()))
  17. print('')
  18. # Execute
  19. print("Executing...")
  20. do_main_program(projects)
  21. print("Done ! And now, listening...")
  22. import signal
  23. signal.signal(signal.SIGINT, program_cleanup)
  24. signal.signal(signal.SIGTERM, program_cleanup)
  25. # Wait
  26. import time
  27. while not stop:
  28. time.sleep(1)