%PDF- %PDF-
Direktori : /usr/share/hplip/fax/__pycache__/ |
Current File : //usr/share/hplip/fax/__pycache__/cdmfax.cpython-312.pyc |
� = f�L � �� � d dl mZ d dlmZ d dlZd dlZd dlZd dlZd dlm Z m Z mZ d dlZd dl Z d dlZd dlZd dlmc mZ d dl� d dl� d dl� d dlmZmZmZmZmZ d dlm Z ddl� d dlZd dlZd dlZd dlZd dl� d dl Z d dl!Z!d d lmZmZ d d lm"Z"m Z mZm#Z#m$Z$m%Z% d dl&m'Z' d dl Z d dl!Z!d dlZd dlZd dl(m)Z) d Z*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3 G d� de4� Z5 G d� de6� Z7y)� )�division)�NONEN)�BytesIO� to_bytes_utf8� to_unicode)�*)�device�utils�codes�dime�status)r � )r r )�PY3r r �to_string_latin�to_string_utf8� xStringIO)�http_client)�cupsz/cdm/oauth2/v1/tokenz/cdm/faxModem/v1/configurationz�%s %s HTTP/1.1 Content-Type: application/json User-Agent: hplip Accept: */* Cache-Control: no-cache Host:%s Connection: keep-alive Content-Length: %s z�%s %s HTTP/1.1 Content-Type: application/json User-Agent: hplip Accept: */* Cache-Control: no-cache Host:%s Connection: keep-alive Content-Length: %s Authorization: Bearer %s i� �� �� �� i� i� c � � e Zd Zdddedfd�Zd� Zd� Zdd�Zd� Zdd�Z dd �Z d � Zd� Z e ee� Zd� Zd � Z e ee� Zd� Z dd�Zy)�CDMFaxDeviceNFc �� � t j | |||||� d| _ d | _ d | _ || _ || _ | j dk( r| j | _ y d| _ y )N� �net� localhost) � FaxDevice�__init__�token�send_fax_thread�upload_log_thread� device_uri�printer_name�bus�host� http_host)�selfr# r$ �callback�fax_type�disable_dbuss �/usr/share/hplip/fax/cdmfax.pyr zCDMFaxDevice.__init__R sg � � ���4��'�#�X�'� )� �� �#���!%���$���(����8�8�u��!�Y�Y�D�N�(�D�N� c �2 � | j d t k( ryy)Nzwifi-configTF)�mq�WIFI_CONFIG_CDM_AUTH)r( s r, �isAuthRequiredzCDMFaxDevice.isAuthRequirede s � ��7�7�=�!�%9�9��r- c � � t j � } | j | j |d� | j � y # t $ r t j d� Y �1w xY w# | j � w xY w)Nr zUnable to read LEDM Channel)�ior �readLEDMAllData�readEWS_LEDM�Error�log�debug� closeLEDM)r( �responses r, �__flushThePortzCDMFaxDevice.__flushThePortk sa � ��:�:�<�� �� � ��!2�!2�H�a�@� �N�N��� � 5��I�I�3�4� 5�� �N�N��s# �A �A%�"A( �$A%�%A( �(A:c � � |d k( rt |� }nt |� }|dk( r2| j t ||| j || j fz � n&| j t ||| j |fz � |d k7 r| j |� t � } | j | j |� |j d� t j |� }|j � |j � }|j � } || fS # t $ r( | j! � t"