Python PyQt5.QtCore.QThread.__init__() Examples

The following are 30 code examples of PyQt5.QtCore.QThread.__init__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore.QThread , or try the search function .
Example #1
Source File: main.py    From raspiblitz with MIT License 6 votes vote down vote up
def create_new_invoice(self, memo="Pay to RaspiBlitz", amt=0):
        if IS_DEV_ENV:
            # Fake an invoice for dev
            class FakeAddInvoiceResponse(object):
                def __init__(self):
                    self.add_index = 145
                    self.payment_request = "lnbc47110n1pwmfqcdpp5k55n5erv60mg6u4c8s3qggnw3dsn267e80ypjxxp6gj593" \
                                           "p3c25sdq9vehk7cqzpgprn0ytv6ukxc2vclgag38nmsmlyggmd4zand9qay2l3gc5at" \
                                           "ecxjynydyzhvxsysam9d46y5lgezh2nkufvn23403t3tz3lyhd070dgq625xp0"
                    self.r_hash = b'\xf9\xe3(\xf5\x84\xdad\x88\xe4%\xa7\x1c\x95\xbe\x8baJ\x1c\xc1\xad*\xed\xc8' \
                                  b'\x158\x13\xdf\xffF\x9c\x95\x84'

            new_invoice = FakeAddInvoiceResponse()

        else:
            with InvoiceStub(network=self.rb_cfg.network, chain=self.rb_cfg.chain) as stub_invoice:
                new_invoice = create_invoice(stub_invoice, memo, amt)

        log.info("#{}: {}".format(new_invoice.add_index, new_invoice.payment_request))

        invoice_r_hash_hex_str = convert_r_hash_hex_bytes(new_invoice.r_hash)
        self.invoice_to_check = invoice_r_hash_hex_str
        log.info("noting down for checking: {}".format(invoice_r_hash_hex_str))

        return new_invoice 
Example #2
Source File: proxy.py    From guppy-proxy with MIT License 6 votes vote down vote up
def __init__(self, kind="", addr=""):
        self.connid = ProxyConnection.next_id
        ProxyConnection.next_id += 1
        self.sbuf = None
        self.buf = bytes()
        self.parent_client = None
        self.debug = False
        self.is_interactive = False
        self.closed = True
        self.message_lock = threading.Lock()
        self.kind = None
        self.addr = None
        self.int_thread = None

        if kind.lower() == "tcp":
            tcpaddr, port = addr.rsplit(":", 1)
            self.connect_tcp(tcpaddr, int(port))
        elif kind.lower() == "unix":
            self.connect_unix(addr) 
Example #3
Source File: dashd_intf.py    From dash-masternode-tool with MIT License 6 votes vote down vote up
def __init__(self):
        AttrsProtected.__init__(self)
        self.ident = None
        self.status = None
        self.payee = None
        self.lastseen = None
        self.activeseconds = None
        self.lastpaidtime = None
        self.lastpaidblock = None
        self.ip = None
        self.protx_hash: Optional[str] = None
        self.registered_height: Optional[int] = None
        self.db_id = None
        self.marker = None
        self.modified = False
        self.monitor_changes = False
        self.queue_position = None
        self.set_attr_protection() 
Example #4
Source File: proxy.py    From guppy-proxy with MIT License 6 votes vote down vote up
def __init__(self, status_code=200, reason="OK", proto_major=1, proto_minor=1,
                 headers=None, body=bytes(), db_id="", headers_only=False, storage_id=0):
        self.status_code = status_code
        self.reason = reason
        self.proto_major = proto_major
        self.proto_minor = proto_minor

        self.headers = Headers()
        if headers is not None:
            for k, vs in headers.items():
                for v in vs:
                    self.headers.add(k, v)

        self.headers_only = headers_only
        self._body = bytes()
        if not headers_only:
            self.body = body

        self.unmangled = None
        self.db_id = db_id
        self.storage = storage_id 
Example #5
Source File: query.py    From dunya-desktop with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        QThread.__init__(self, parent)
        self.stopped = False

        self.mid = None
        self.uid = None
        self.fid = None
        self.cmbid = None
        self.ambid = None
        self.iid = None

        self.parent = self.parent()
        self.fetching_completed.connect(self.parent.work_received)
        self.combobox_results.connect(self.parent.change_combobox_backgrounds)
        self.progress_number.connect(self.parent.set_progress_number)
        self.query_completed.connect(self.parent.query_finished) 
Example #6
Source File: proxy.py    From guppy-proxy with MIT License 6 votes vote down vote up
def __init__(self, url):
        parsed = urlparse(url)
        if url is not None:
            parsed = urlparse(url)
            self.scheme = parsed.scheme
            self.netloc = parsed.netloc
            self.path = parsed.path
            self.params = parsed.params
            self.query = parsed.query
            self.fragment = parsed.fragment
        else:
            self.scheme = ""
            self.netloc = ""
            self.path = "/"
            self.params = ""
            self.query = ""
            self.fragment = "" 
Example #7
Source File: DroneVisionGUI.py    From pyparrot with MIT License 6 votes vote down vote up
def __init__(self, vlc_player, drone_gui):
        """
        Create a UI window for the VLC player
        :param vlc_player: the VLC player (created outside the function)
        """
        QMainWindow.__init__(self)
        self.setWindowTitle("VLC Drone Video Player")

        # save the media player
        self.mediaplayer = vlc_player

        # need a reference to the main drone vision class
        self.drone_vision = drone_gui

        # create the GUI
        self.createUI() 
Example #8
Source File: main_win.py    From BlindWatermark with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self,parameter,my_file_path):

        watermark.__init__(self, random_seed_wm = parameter['random_seed_wm'],
                                        random_seed_dct = parameter['random_seed_dct'],
                                        mod = parameter['mod'],
                                        mod2 = parameter.get('mod2') if parameter.get('mod2')>0.1 else None,
                                        wm_shape = parameter.get('wm_shape',None),
                                        block_shape = parameter['block_shape'],
                                        dwt_deep = parameter['dwt_deep']
                                        )
        self.ori_img_path = parameter['ori_img']
        self.wm_path = parameter['wm']
        self.out_file_path = my_file_path 
Example #9
Source File: BlindWatermark copy.py    From BlindWatermark with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self,random_seed_wm=None,random_seed_dct=None,mod=None,mod2=None,wm_shape=None,block_shape=(4,4),color_mod = 'YUV',dwt_deep=1):
        #just for pyqt
        QThread.__init__(self)
        # self.wm_per_block = 1
        self.block_shape = block_shape  #2^n
        self.random_seed_wm = random_seed_wm
        self.random_seed_dct = random_seed_dct
        self.mod = mod
        self.mod2 = mod2
        self.wm_shape = wm_shape
        self.color_mod = color_mod
        self.dwt_deep = dwt_deep 
Example #10
Source File: main_win.py    From BlindWatermark with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget
        @type QWidget
        """
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
        self.my_bwm_parameter = {}
        self.my_recovery_parameter = {}
        self.init_listVIew() 
Example #11
Source File: event.py    From deepin-remote-assistance with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        QThread.__init__(self) 
Example #12
Source File: event.py    From deepin-remote-assistance with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        QObject.__init__(self) 
Example #13
Source File: DroneVisionGUI.py    From pyparrot with MIT License 5 votes vote down vote up
def __init__(self, user_vision_function, user_args, drone_vision):
        """
        :param user_vision_function: user callback function to handle vision
        :param user_args: optional arguments to the user callback function
        """
        QThread.__init__(self)
        self.user_vision_function = user_vision_function
        self.user_args = user_args
        self.drone_vision = drone_vision 
Example #14
Source File: DroneVisionGUI.py    From pyparrot with MIT License 5 votes vote down vote up
def __init__(self, user_draw_function, drone_vision):
        """
        :param user_draw_function: user drawing function that should return an image
        """
        QThread.__init__(self)
        self.user_draw_function = user_draw_function
        self.drone_vision = drone_vision 
Example #15
Source File: DroneVisionGUI.py    From pyparrot with MIT License 5 votes vote down vote up
def __init__(self, user_function, user_args, drone_vision):
        """
        :param user_function: user code to run (presumably flies the drone)
        :param user_args: optional arguments to the user function
        """
        QThread.__init__(self)
        self.user_vision_function = user_function
        self.user_args = user_args
        self.drone_vision = drone_vision 
Example #16
Source File: SolveThread.py    From Zolver with MIT License 5 votes vote down vote up
def __init__(self, path, viewer, green_screen=False):
        QThread.__init__(self)
        self.path = path
        self.viewer = viewer
        self.green_screen = green_screen 
Example #17
Source File: file_watcher.py    From raspiblitz with MIT License 5 votes vote down vote up
def __init__(self, dir_names, file_names, *args, **kwargs):
        QThread.__init__(self, *args, **kwargs)
        self.dir_names = dir_names
        self.file_names = file_names 
Example #18
Source File: inputconfigdialogue.py    From crazyflie-clients-python with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, input):
        QThread.__init__(self)

        self._input = input
        self._read_timer = QTimer()
        self._read_timer.setInterval(25)

        self._read_timer.timeout.connect(self._read_input) 
Example #19
Source File: main_win.py    From BlindWatermark with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self,parameter,my_file_path):

        watermark.__init__(self, random_seed_wm = parameter['random_seed_wm'],
                                        random_seed_dct = parameter['random_seed_dct'],
                                        mod = parameter['mod'],
                                        mod2 = parameter.get('mod2') if parameter.get('mod2')>0.1 else None,
                                        wm_shape = parameter.get('wm_shape',None),
                                        block_shape = parameter['block_shape'],
                                        dwt_deep = parameter['dwt_deep']
                                        )
        self.ori_img_path = parameter['ori_img']
        self.out_file_path = my_file_path 
Example #20
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, headers=None):
        self.headers = {}
        if headers is not None:
            if isinstance(headers, Headers):
                for _, pairs in headers.headers.items():
                    for k, v in pairs:
                        self.add(k, v)
            else:
                for k, vs in headers.items():
                    for v in vs:
                        self.add(k, v) 
Example #21
Source File: logcat.py    From android_application_analyzer with MIT License 5 votes vote down vote up
def __init__(self, mainWin, device):
        self.mainWin = mainWin
        self.device=device
        QThread.__init__(self) 
Example #22
Source File: logcat.py    From android_application_analyzer with MIT License 5 votes vote down vote up
def __init__(self, fd, queueobj):
        assert isinstance(queueobj, queue.Queue)
        assert callable(fd.readline)
        QThread.__init__(self) 
        self._fd = fd
        self._queue = queueobj 
Example #23
Source File: load_briar_menu.py    From BriarIDS with MIT License 5 votes vote down vote up
def __init__(self, url):
        QThread.__init__(self)
        self.url = url 
Example #24
Source File: __init__.py    From binja_dynamics with Apache License 2.0 5 votes vote down vote up
def __init__(self, message_q):
        QThread.__init__(self)
        self.messages = message_q
        # Only the inferior process need use the slave file descriptor
        self.master, self.slave = pty.openpty()
        self.tty = os.ttyname(self.slave) 
Example #25
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, is_binary=True, message=bytes(), to_server=True,
                 timestamp=None, db_id="", storage_id=0):
        self.is_binary = is_binary
        self.message = message
        self.to_server = to_server
        self.timestamp = timestamp or datetime.datetime(1970, 1, 1)

        self.unmangled = None
        self.db_id = db_id
        self.storage = storage_id 
Example #26
Source File: load_briar_menu.py    From BriarIDS with MIT License 5 votes vote down vote up
def __init__(self, url):
        QThread.__init__(self)
        self.url = url 
Example #27
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, method="GET", path="/", proto_major=1, proto_minor=1,
                 headers=None, body=bytes(), dest_host="", dest_port=80,
                 use_tls=False, time_start=None, time_end=None, db_id="",
                 tags=None, headers_only=False, storage_id=0):
        # http info
        self.method = method
        self.url = URL(path)
        self.proto_major = proto_major
        self.proto_minor = proto_minor

        self.headers = Headers(headers)

        self.headers_only = headers_only
        self._body = bytes()
        if not headers_only:
            self.body = body

        # metadata
        self.dest_host = dest_host
        self.dest_port = dest_port
        self.use_tls = use_tls
        self.time_start = time_start
        self.time_end = time_end

        self.response = None
        self.unmangled = None
        self.ws_messages = []

        self.db_id = db_id
        self.storage_id = storage_id
        if tags is not None:
            self.tags = set(tags)
        else:
            self.tags = set() 
Example #28
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, sock):
        self.buf = []  # a list of chunks of strings
        self.s = sock
        self.closed = False 
Example #29
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, target=None, args=tuple()):
        global mainWidg
        QThread.__init__(self)
        self.f = target
        self.args = args
        self.tid = next(ProxyThread.tiditer)
        ProxyThread.threads[self.tid] = self
        self.finished.connect(clean_thread(self.tid)) 
Example #30
Source File: proxy.py    From guppy-proxy with MIT License 5 votes vote down vote up
def __init__(self, client, query=None):
        self._current_query = []
        self.client = client
        if query is not None:
            self._current_query = query