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.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

run_server.py 888B

123456789101112131415161718192021222324252627282930313233343536
  1. from listeningthread 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 project_reader import ProjectReader
  15. reader = ProjectReader()
  16. projects = {sc.get_project_label(): sc for sc in reader.get_project_classes()}
  17. print('Available projects: %s' % list(projects.keys()))
  18. print('')
  19. # Execute
  20. print("Executing...")
  21. do_main_program(projects)
  22. print("Done ! And now, listening...")
  23. import signal
  24. signal.signal(signal.SIGINT, program_cleanup)
  25. signal.signal(signal.SIGTERM, program_cleanup)
  26. # Wait
  27. import time
  28. while not stop:
  29. time.sleep(1)