%PDF- %PDF-
Direktori : /usr/share/hplip/base/__pycache__/ |
Current File : //usr/share/hplip/base/__pycache__/utils.cpython-312.pyc |
� = f�@ � � � d dl Z d dlZd dlmZmZ d dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlZd dl Z d dlZd dlZd dlZd dlZd dlZddl� d dlZddlmZmZmZmZ ddlmZmZmZmZmZm Z mZ ddl!m"Z" d dl#Z# d dl$m%c m&Z& dZ' d dl)Z)dZ* d dl+Z+d d l+m,Z,m-Z-m.Z. dZ/ d dl0Z0d� Z1ddl� ddl3� dd l!m4Z4 d Z5dZ6dZ7dZ8dZ9dZ:dZ;dZ<d Z=dZ>dZ?dZ@e j� d ZBe j� d ZCe4j� e4j� ddddddddddd d!gZFg ZGeFD ]1 ZH ej� eHej� � ZKeGj� eK� �3 d"� ZNd#� ZOd$� ZPd�d%�ZQ ed&� ed&� ed&� dfd'�ZRd(� ZSd�d)�ZTd�d*�ZUd�d+�ZVd,� ZW G d-� d.� ZX G d/� d0� ZY G d1� d2� ZZ G d3� d4eZ� Z[ G d5� d6� Z\ G d7� d8� Z]d9� Z^d:� Z_d�d;�Z` ej� Zbd�d=�Zd G d>� d?ee� Zfd@� ZgdA� ZhdB� ZidC� ZjdD� Zk d dElmlZl dL� Zper>eqj� dMdM� Zsesj� esej� j� dN� � Zwn/ ej� d&d&� Zsesj� esej� � ZwdO� ZudP� fdQ�ZxdR� fdS�Zyg dT�ZzdUd&d&dVd&dT�Z{dW� Z|d�dX�Z}dY� Z~d�dZ�Zd�d[�Z� G d\� d]� Z� G d^� d_� Z� G d`� da� Z�db� Z�e �j dck rd�dd�Z�d�de�Z�df� Z�d�dg�Z�n'e��j Z�e��j Z�e��j Z�dh� Z�di� Z�dj� Z�d�dk�Z�dl� Z�dm� Z�d�dn�Z�d�do�Z�dp� Z�dq� Z� G dr� dsee� Z�dt� Z�duZ�dvZ�dwZ�dxZ�dyZ�dzZ�d{Z�d|Z�d}Z�d~Z�dZ�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�e��jg d�d�d�� d�k( rd�Z�d�Z�d�Z�n;e��jg d�d�d�� d�k( rd�Z�d�Z�d�Z�ne��jg d�d�d�� d�k( rd�Z�d�Z�d�Z�d�� Z�d�d��Z�d�d��Z�d�d��Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�e�fd��Z�d�d��Z� G d�� d�� Z�d�d��Z�d�� Z�d�� Z�d�� Z�d�� Z�d�d��Z�d�d��Z�d�� Z�e;e<fd��Z�d�d��Z�d�� Z�d�d��Z�d�� Z�d�d��Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�d��Z�d�� Z�y# e($ r d Z'Y ���w xY w# e($ r d Z*Y ���w xY w# e($ r d Z/Y ���w xY w# e($ r d dl2Z2d� Z1Y ���w xY w# eM$ r eGj� eH� Y ���w xY w# ec$ r d�d<�ZbY ���w xY w# e($ r# G dF� dG� Zm G dH� dIen� Zo G dJ� dK� ZlY ���w xY w)�� N)�Popen�PIPE� )�*)� html_entities�urllib2_request� urllib2_parse� urllib2_error)�PY3� to_unicode� to_bytes_utf8�to_string_utf8�BytesIO�StringIO� subprocess)�os_utilsTF)� SystemBus�lowlevel� SessionBusc �H � t j | � j � S �N)�hashlib�sha1� hexdigest��ss �/usr/share/hplip/base/utils.py�get_checksumr H s � ��|�|�A��(�(�*�*� c �H � t j | � j � S r )�sha�newr r s r r r N s � ��w�w�q�z�#�#�%�%r )�pexpectzrm -rfzrm -fzcom.hplip.StatusServicez/http://hplipopensource.com/hplip-web/index.htmlzhttp://www.hp.comz www.hp.com� � z Continue?zpasswor[dt]:�kennwortzpassword forzmot de passeu contraseñaz palavra passeu 口令� wachtwoord�heslou 密码u Lösenordc �b � g } t d� } t j dj � � d j dd� j d� } d| v r| j d� |j! � | S # t $ r� dt j t j d� j � j k7 r?t j t j d� j � j gcY S n# t $ r | cY cY S w xY wY �� w xY w# t $ r | cY S w xY w)Nz/etc/cups/cupsd.conf�rootzSystemGroup [\w* ]*r zSystemGroup � � )�open�IOError�grp�getgrgid�os�stat�st_gid�gr_name�OSError�re�findall�read�replace�split� IndexError�remove�close)�lis�fps r �get_cups_systemgroup_listr@ � s � � �C���&�'���� � �1�"�'�'�)�<�a�@�H�H��XZ�[�b�b�cf�g�� ��}�� � �6���H�H�J��J�� � � �����b�g�g�.D�&E�&L�&L�M�U�U�U����R�W�W�-C�%D�%K�%K�L�T�T�U�U� V��� ��J� �� V��� � �� ��sN �A= �AD �= D�A;D�D�D�D�D�D�D�D� D.�-D.c �> � t j d| j z � t j | j � t j t j z � y# t t f$ r% t j d| j z � Y yw xY w)NzLocking: %sTzFailed to unlock %s.F) �log�debug�name�fcntl�flock�fileno�LOCK_EX�LOCK_NBr. r5 ��fs r �lockrL � sm � ��I�I�m�a�f�f�$�%�� ���A�H�H�J�� � �� � � =�>����W�� �� � �(�1�6�6�1�2���s �AA( �(1B�Bc � � | �ut j d| j z � t j | j � t j � t j | j � y y # t t f$ r Y y w xY w)Nz Unlocking: %s)rB rC rD rE rF rG �LOCK_UNr1 r<