本文整理汇总了Python中PyQt5.Qt.QThread.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QThread.__init__方法的具体用法?Python QThread.__init__怎么用?Python QThread.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QThread
的用法示例。
在下文中一共展示了QThread.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent, lrf_stream, logger, opts):
QThread.__init__(self, parent)
self.stream, self.logger, self.opts = lrf_stream, logger, opts
self.aborted = False
self.lrf = None
self.document = None
self.exception = None
示例2: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent, db, root, single, tdir=None):
QThread.__init__(self, parent)
self.db = db
self.path = root
self.tdir = tdir
self.single_book_per_directory = single
self.canceled = False
示例3: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self,
party_1,
party_2,
number_of_pairs,
random_source,
cancellation_event,
key_manager,
console_signal,
key_directory,
parent,
key_length=1000000):
QThread.__init__(self, parent)
self._party_1 = party_1
self._party_2 = party_2
self._number_of_pairs = int(number_of_pairs)
self._random_source = random_source
# Select appropriate random function.
if self._random_source == '/dev/random (slow!)':
self._random_function = self._dev_random
else:
self._random_function = self._os_urandom
# Attach cancel button signal to cancel function.
self._cancellation_event = cancellation_event
self._km = key_manager
self._cs = console_signal
self._key_directory = key_directory
self._parent = parent
self._key_length = key_length
self._VERSION = self._km.VERSION
示例4: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, plugin_id, address, socket):
QThread.__init__(self)
self.plugin_id = plugin_id
self.address = address
self.udp_socket = socket
self.finished.connect(self.quit)
self.wait = QWaitCondition()
self.mutex = QMutex()
示例5: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self,
import_path,
key_manager,
console_signal,
key_directory,
parent):
QThread.__init__(self, parent)
self._import_path = import_path
self._km = key_manager
self._console_signal = console_signal
self._key_directory = key_directory
self._parent = parent
self._total_key_count = 0
self._successful_key_count = 0
self._unsuccessful_key_count = 0
示例6: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent, db, device, annotation_map, done_callback):
QThread.__init__(self, parent)
self.errors = {}
self.db = db
self.keep_going = True
self.pd = ProgressDialog(_('Merging user annotations into database'), '',
0, len(annotation_map), parent=parent)
self.device = device
self.annotation_map = annotation_map
self.done_callback = done_callback
self.pd.canceled_signal.connect(self.canceled)
self.pd.setModal(True)
self.pd.show()
self.update_progress.connect(self.pd.set_value,
type=Qt.QueuedConnection)
self.update_done.connect(self.pd.hide, type=Qt.QueuedConnection)
示例7: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self,
party_1,
party_2,
all_keys,
console_signal,
key_directory,
main_export_directory,
parent):
QThread.__init__(self, parent)
self._party_1 = party_1
self._party_2 = party_2
self._parent = parent
self._keys = all_keys
self._console_signal = console_signal
self._main_export_directory = main_export_directory
self._key_directory = key_directory
self._timestamp = '{0:.7f}'.format(time.time())
self._export_package_dir = os.path.join(self._main_export_directory,
self._timestamp)
os.makedirs(self._export_package_dir)
self._keys_to_copy = []
self._keys_copied_count = 0
self._keys_missed_count = 0
示例8: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent):
QThread.__init__(self, parent)
self.keep_going = True
self.current_command = None
self.out_queue = Queue()
self.address = arbitrary_address('AF_PIPE' if iswindows else 'AF_UNIX')
self.auth_key = os.urandom(32)
if iswindows and self.address[1] == ':':
self.address = self.address[2:]
self.listener = Listener(address=self.address,
authkey=self.auth_key, backlog=4)
self.env = {
'CALIBRE_SIMPLE_WORKER':
'calibre.utils.pyconsole.interpreter:main',
'CALIBRE_WORKER_ADDRESS':
hexlify(cPickle.dumps(self.listener.address, -1)),
'CALIBRE_WORKER_KEY': hexlify(self.auth_key)
}
self.process = Process(self.env)
self.output_file_buf = self.process(redirect_output=False)
self.conn = self.listener.accept()
self.start()
示例9: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent):
QThread.__init__(self, parent)
示例10: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent):
QThread.__init__(self, parent)
self.cdb = parent.opts.gui.current_db
self.title_map = None
self.uuid_map = None
示例11: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, host="0.0.0.0", port=9919):
QThread.__init__(self)
self.host = host
self.port = port
示例12: __init__
# 需要导入模块: from PyQt5.Qt import QThread [as 别名]
# 或者: from PyQt5.Qt.QThread import __init__ [as 别名]
def __init__(self, parent=None):
QThread.__init__(self, parent)
self.canceled = False
self.cancel_callback = lambda : self.canceled
self.folders = set([])
self.books = []