How to use the escpos.config.retry function in escpos

To help you get started, we’ve selected a few escpos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github base4sistemas / pyescpos / escpos / conn / bt.py View on Github external
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def read(self):
        try:
            return self.socket.recv()
        except:
            logger.exception('read error')
            return ''
github base4sistemas / pyescpos / escpos / conn / bt.py View on Github external
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def release(self):
        if self.socket is not None:
            self.socket.shutdown(socket.SHUT_RDWR)
            self.socket.close()
            self.socket = None
github base4sistemas / pyescpos / escpos / conn / bt.py View on Github external
            max_tries=config.retry.max_tries,
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def read(self):
        try:
            return self.socket.recv()
        except:
            logger.exception('read error')
            return ''
github base4sistemas / pyescpos / escpos / conn / bt.py View on Github external
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def read(self):
        try:
            return self.socket.recv()
        except:
            logger.exception('read error')
            return ''
github base4sistemas / pyescpos / escpos / conn / network.py View on Github external
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def release(self):
        return self._raw_release()
github base4sistemas / pyescpos / escpos / conn / bt.py View on Github external
            max_tries=config.retry.max_tries,
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def catch(self):
        self.socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
        self.socket.connect((self.address, self.port))
github base4sistemas / pyescpos / escpos / conn / network.py View on Github external
            max_tries=config.retry.max_tries,
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def write(self, data):
        return self._raw_write(data)
github base4sistemas / pyescpos / escpos / conn / network.py View on Github external
            delay=config.retry.delay,
            factor=config.retry.factor,
            exceptions=_RETRY_EXCEPTIONS)
    def read(self):
        return self._raw_read()