setlocalip.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. from .LogerinTxt import app_logger
  2. from Functions.QtFunctions import ipcall
  3. from PyQt6.QtCore import QObject
  4. from PyQt6 import QtCore
  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()