setlocalip.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from PyQt6 import QtCore
  2. from PyQt6.QtCore import QObject
  3. from Functions.QtFunctions import ipcall
  4. from .LogerinTxt import app_logger
  5. class setlocalip(QObject):
  6. localipupdate = QtCore.pyqtSignal(str)
  7. def __init__(self, ip, thread):
  8. super().__init__()
  9. self.ip = ip
  10. self.thread = thread
  11. def run(self):
  12. # print("jjingruy1")
  13. try:
  14. if self.ip != None:
  15. try:
  16. localcalltry = ipcall.searchinfo()
  17. self.localtoken = localcalltry.start(self.ip)
  18. # print("本地测试print(self.localtoken)")
  19. # print(self.localtoken)
  20. except Exception as e:
  21. self.localtoken = None
  22. self.localtoken = None
  23. app_logger.log_error(e)
  24. else:
  25. self.localtoken = None
  26. self.localipupdate.emit(self.localtoken)
  27. self.thread.quit()
  28. except Exception as e:
  29. app_logger.log_error(e)
  30. self.thread.quit()