convert_mp.py 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import os
  2. import sys
  3. from flask import Flask
  4. sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
  5. from multiprocessing import Process,Queue
  6. from format_convert.convert import _convert
  7. from format_convert.utils import get_ip_port
  8. ip_port_dict = get_ip_port()
  9. ip = "http://127.0.0.1"
  10. convert_port_list = ip_port_dict.get(ip).get("convert")
  11. ocr_port_list = ip_port_dict.get(ip).get("ocr")
  12. otr_port_list = ip_port_dict.get(ip).get("otr")
  13. attachment_queue = Queue()
  14. class A:
  15. def __init__(self):
  16. print(A)
  17. a = A()
  18. def convert_start_mp():
  19. pass
  20. app = Flask(__name__)
  21. @app.route('/test', methods=['POST'])
  22. def test():
  23. print(str(attachment_queue))
  24. print(str(a))
  25. attachment_queue.put(1)
  26. print(attachment_queue.qsize())
  27. if __name__ == '__main__':
  28. # app.run(host='0.0.0.0', port=15011, processes=3, threaded=False, debug=False)
  29. app.run()