12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @文件 :log_signal.py
- @时间 :2022/02/17 15:37:11
- @作者 :None
- @版本 :1.0
- @说明 : 日志打印实例/单例模式
- '''
- from utils.qt import Signal, QObject
- class LogSignal(QObject):
- instance = None
- signal = Signal(str)
- @classmethod
- def print_log_signal(cls):
- if cls.instance:
- return cls.instance
- else:
- obj = cls()
- cls.instance = obj
- return cls.instance
- def log_emit(self, data):
- self.signal.emit(data)
|