%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/installer/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/installer/__pycache__/core_install.cpython-312.pyc

�

=	f�~��X�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z		ddl
Z
d�Zddl�ddl�ddlmZmZmZmZmZddl�dZdZdZdZdZdZdZd	Zd
ZdZ dZ!d	Z"dZ#dZ$idd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d�d!d�Z%gd"�Z&gd#�Z'gd$�Z(gd%�Z)gd&�Z*gd'�Z+gd(�Z,d)gZ-gd*�Z.idd+�dd,�d	d-�d
d.�d/d0�d1d2�d3d4�d5d6�d7d8�d9d:�d;d<�d=d>�d?d@�dAdB�dCdD�dEdF�dGdH�dIdJi�Z/dZ0dZ1d	Z2d
Z3d/Z4dKZ5dLZ6dMZ7dNZ8dOZ9dPZ:dQZ;dRZ<dSZ=dTZ>dUZ?dVZ@dWZAdXZBdYZCdZZDd[ZEd\ZFd]ZGd^ZHd_ZId`ZJdaZKdbZLdcZMddZNdeZOdfZPdgZQdhZRdiZSdjZTdkZUdlZVdmZWdnZXdoZYdpZZdqZ[drZ\dsZ]dtZ^duZ_dvZ`dwZadxZbdyZcdzZdd{Zed|Zfeed}d~gfefdgfd��Zg	dd�lhmiZid��ZjGd��d�ek�Zly#e$rddl
Z
d�ZY��iwxYw#e$rd��ZjY�)wxYw)��Nc�H�tj|�j�S�N)�hashlib�sha1�	hexdigest��ss �*/usr/share/hplip/installer/core_install.py�get_checksumr%s���|�|�A��(�(�*�*�c�H�tj|�j�Sr)�sha�newrrs r
rr+s���w�w�q�z�#�#�%�%r)�*)�utils�tui�password�services�os_utils��0.0���z+(?is)<TITLE>.*?(404|403).*?ERROR.*?</TITLE>gffffff�?z+(?is)<TITLE>.*?ERROR.*?(404|403).*?</TITLE>z(?is)<TITLE>ERROR</TITLE>g333333�?z(?is)<TITLE>.*?ERROR.*?</TITLE>g�������?z#(?is)<META .*?(404|403).*?ERROR.*?>g�������?z#(?is)<META .*?ERROR.*?(404|403).*?>z((?is)<TITLE>.*?File Not Found.*?</TITLE>z#(?is)<TITLE>.*?Not Found.*?</TITLE>g�������?z(?is)<BODY.*(404|403).*</BODY>z(?is)<H1>.*?(404|403).*?</H1>g333333�?z(?is)<BODY.*not found.*</BODY>z(?is)<H1>.*?not found.*?</H1>z&(?is)<BODY.*the requested URL.*</BODY>z+(?is)<BODY.*the page you requested.*</BODY>z+(?is)<BODY.*page.{1,50}unavailable.*</BODY>z.(?is)<BODY.*request.{1,50}unavailable.*</BODY>z(?i)does not exist)(�hpijszhp-alignzhp-colorcalzhp-faxsetupzhp-linefeedcalzhp-pkservicezhp-printsettingsz
hp-sendfaxzhp-timedatezhp-checkzhp-devicesettingszhp-firmwarez
hp-makecopiesz	hp-pluginzhp-probezhp-setup�
hp-toolboxzhp-check-pluginzhp-diagnose_pluginzhp-infoz
hp-makeuriz	hp-pqdiagzhp-query�
hp-systrayz	hp-unloadzhp-cleanzhp-fabz	hp-levelszhp-printzhp-scanzhp-testpagez
hp-wificonfigz
hp-upgradez
hplip-infozhp-check-upgradezhp-config_usb_printerzhp-diagnose_queueszhp-devicesetupz	hp-doctorz
hp-logcapture)
z
libhpmud.*z	libhpip.*zsane/libsane-hpaio.*zcups/backend/hpzcups/backend/hpfaxzcups/filter/hpcaczsane/libsane-hp2000S1*zlibjpeg*zcups/filter/hppszcups/filter/pstotiffzcups/filter/hpcupszcups/filter/hpcupsfaxzcups/filter/hplipjs)z
cupsext.soz
cupsext.laz
scanext.soz
scanext.lazhpmudext.sozhpmudext.lazpcardext.sozpcardext.la)	z/usr/share/cups/drv/hp/z/usr/local/share/ppd/HP/z/usr/local/share/cups/drv/hp/z%/usr/share/applications/hplip.desktopz)/usr/share/applications/hp-uiscan.desktopz(/etc/xdg/autostart/hplip-systray.desktopz/etc/hp/hplip.confz/usr/share/doc/hplip-*z./usr/lib/systemd/system/hplip-printer*.service)
z56-hpmud.rulesz56-hpmud_sysfs.rulesz40-hplip.rulesz56-hpmud_support.rulesz56-hpmud_support_sysfs.rulesz55-hpmud.ruleszS99-2000S1.rulesz55-hpmud_sysfs.rulesz56-hpmud_add_printer.rulesz 56-hpmud_add_printer_sysfs.rulesz86-hpmud-hp_*.rulesz86-hpmud_plugin.rulesz86-hpmud_plugin_sysfs.rules)z*.pyz*.pyc�base�copier�data�	installer�pcard�ui4�uizfax/*.pyz	fax/*.pyczfax/pstotiff.convszfax/pstotiff.typeszfax/pstotiffz	prnt/*.pyz
prnt/*.pycz	scan/*.pyz
scan/*.pyc)zfax/plugins/z
prnt/plugins/z
scan/plugins/z/var/lib/hp/hplip.state)zadept-notifier�adept_notifierzyum-updatesdzGeneral/unknown errorzlibusb not foundzcups-devel not foundzlibnetsnmp not found�znetsnmp-devel not found�zpython-devel not found�zpthread-devel not found�zppdev-devel not found�	zlibcups not found�
zlibm not found�zlibusb-devel not found�zsane-backends-devel not found�
zlibdbus not found�zdbus-devel not found�zfax requires dbus support�fzlibjpeg not found�gzjpeg-devel not found�hzlibdi not foundzlibjpeg - JPEG libraryz+libtool - Library building support servicesz"CUPS - Common Unix Printing Systemz9CUPS devel- Common Unix Printing System development filesz)CUPS image - CUPS image development filesz$gcc - GNU Project C and C++ Compilerz6make - GNU make utility to maintain groups of programsz"libpthread - POSIX threads libraryzCGhostScript - PostScript and PDF language interpreter and previewerzlibusb - USB libraryz&CUPS DDK - CUPS driver development kitzSANE - Scanning libraryz)SANE - Scanning library development filesz+xsane - Graphical scanner frontend for SANEz"scanimage - Shell scanning programzDBus - Message bus systemz+PolicyKit - Administrative policy frameworkz<libnetsnmp-devel - SNMP networking library development filesz)libcrypto - OpenSSL cryptographic libraryz
network -wget�avahi-utilsz3Python 2.2 or greater - Python programming languagezJPython libnotify - Python bindings for the libnotify Desktop notificationsz$PyQt 4 DBus - DBus Support for PyQt4z4PyQt 4- Qt interface for Python (for Qt version 4.x)z$PyQt 5 DBus - DBus Support for PyQt5z4PyQt 5- Qt interface for Python (for Qt version 4.x)z&Python DBus - Python bindings for DBuszPython XML librariesz'Python devel - Python development fileszMPIL - Python Imaging Library (required for commandline scanning with hp-scan)z!PIP - preferred installer programz(Tesseract - Tesseract library for pythonzFTesserocr - Optical-character-recognition tesseract library for pythonz6Imutils - A series of basic image processing functionsz"Opencv - opencv library for pythonzZBAR -zbar library for pythonz(leptonica - leptonica library for pythonzpypdf2 - pdf library for pythonz"Reportlab - PDF library for PythonzCUPS-ExtensionzIO-ExtensionzHPLIP-SANE-BackendzScan-SANE-Extensionz	Python-QtzBuild Debian PackagezBuild Driver�libavahi-devz/etc/apparmor.dz$/etc/selinux/targeted/policy/policy*z/etc/apparmor.d/usr.share.hplipz"/etc/apparmor.d/abstractions/hplipz5/etc/selinux/targeted/modules/active/modules/hplip.pp)�AppArmor�SELinux��update_wrapperc�&���fd�}t|��S)Nc�d��tjd�j�d|�d|����|i|��S�NzTRACE: func=z	(), args=z	, kwargs=��log�debug�__name__��args�kw�fs  �r
�newfztrace.<locals>.newf��-����I�I��z�z�4��-�
.��d�>�b�>�!rr8�rDrEs` r
�tracerH�s���	"��d�A�&�&rc�����fd�}�j|_|jj�j��j|_�j|_|S)Nc�d��tjd�j�d|�d|����|i|��Sr<r=rAs  �r
rEztrace.<locals>.newf�rFr)r@�__dict__�update�__doc__�
__module__rGs` r
rHrH�sF���	"��
�
��
��
�
���Q�Z�Z�(��y�y����,�,����rc��eZdZeedfd�Zdbd�Zdcd�Zdbd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�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,d+�Z-d,�Z.d-�Z/d.�Z0	d/�Z1d0�Z2d1�Z3d2�Z4d3�Z5d4�Z6d5�Z7d6�Z8d7�Z9d8�Z:d9�Z;d:�Z<d;�Z=d<�Z>d=�Z?d>�Z@ddd?�ZAdbd@�ZBdddA�ZCdbdB�ZDdC�ZEdD�ZFdE�ZGdF�ZHdG�ZIdH�ZJdI�ZKdJ�ZLdK�ZMdL�ZN	dddM�ZOdddN�ZPdddO�ZQdddP�ZRdddQ�ZSdbdR�ZTdddS�ZUdddT�ZVdbdU�ZWdV�ZXdbdW�ZYdX�ZZdY�Z[dZ�Z\d[�Z]e^fd\�Z_edfd]�Z`efd^�Zaefd_�Zbefd`�Zcegggfda�Zdy)e�CoreInstall�qt4c���tjd�||_||_t	j
|�|_d\|_|_|_	d|_
tj|_
tdtc|_|_|_d|_d|_d|_i|_d|_d|_d|_i|_||_d|_d|_d|_d|_idt@�d	tB�d
t@�dtD�dt@�d
tF�dtD�dt@�dtD�dt@�dt@�dt@�dt@�dt@�dtD�dtD�dtD�idtD�dtF�dtD�dtD�dtF�dtD�dtF�d tD�d!t@�d"t@�d#tD�d$tF�d%tF�d&tF�d'tF�d(tF�d)tF��tDtFtDtFtFtFtFtFt@t@tDtDd*��|_$d+d,gd-�fi|_%d+|_&dd.gfdd/gfdd0gfdd1gfdd2gfdd3gfdd4gfdd5gfdd6gfdd7gfdd8gfdd9gfd:�|_'ddddddddddddddd;�|_(id<dd=gtR|jTtVd>dtXf�d?dd=gtZ|j\tVd>dtXf�d@ddAd=gt^|j`tVd>dtXf�dBddAd=gtb|jdtfd>dCthf�dDddAd=gtj|jltndEdFtpf�dGddAd=gtr|jttfd>dFtXf�dHddAd=gtv|jxtfd>dFtXf�dIddAd=gtz|j|tfd>dJthf�dKddAd=gt~|j�tfdLdMthf�dNddAd=gt�|j�tVd>dOtXf�dPddAd=gt�|j�tndQdRtpf�dSddAgt�|j�tVd>dTtXf�dUddAd=gt�|j�tnd>dtXf�dVddWgt�|j�tnd>dXtXf�dYddWgt�|j�tfd>dXtXf�dZddWgt�|j�tVd>d[tXf�d\ddWgt�|j�tnd]d^tpf�ddWgt�|j�tnd_d`tpfddagt�|j�tVd>dbtpfddcddgt�|j�tnd>detpfddfgt�|j�tVdgdhtXfddfgt�|j�tVd>ditXfddfgt�|j�tnd>djtpfddfgt�|j�tnd>dktpfdl��|__ddAgt�|j�tVdmdntXfddddcgt�|j�tnd>dotXfddcgt�|j�tndpdqtXfddcgt�|j�tndpdqtXfdddgt�|j�tndrdstXfdddgt�|j�tndrdstXfddagt�|j�tndtdutXfddAgt�|j�tnd>dvtXfddAgt�|j�tfdmdntXfddWgt�|j�tnd>dwtXfddagt�|j�tndxdytXfdz�}ddAgt�|j�tVdmd{tXfddddcgt�|j�tnd>dotXfddcgt�|j�tndpdqtXfddcgt�|j�tndpdqtXfdddgt�|j�tndrdstXfdddgt�|j�tndrdstXfddagt�|j�tndtdutXfddAgt�|j�tnd>dvtXfddAgt�|j�tfdmd{tXfddWgt�|j�tnd>dwtXfddagt�|j�tndxdytXfd|�}d}d~lvmw}|r|j�j�|�n|j�j�|�ddAgt�|j�tVd>dt�fddAgt�|j�tVd>dt�fddWgt�|j�tVd>d�tfddWg�t|�jtVd>d�tfdd�g�t|�jtVd�d�tXfd��|_��t�t�t�t�t�t�t�t�t�t�t d��|_�|jND]U}�t%�|j�D]9}||j�|d�vs�|jN|d��j'|��;�W|�j)�i|_�|j4D]"}||�j*|j4|d	<�$y)�N���rUrU� rUFz/usrT�distros�index�versions�display_name�	alt_names�display�notes�package_mgrs�package_mgr_cmd�pre_install_cmd�pre_depend_cmd�post_depend_cmd�scanjet_depend_cmd�scanjet_py3_depend_cmd�hpoj_remove_cmd�hplip_remove_cmd�su_sudo�ppd_install�
udev_mode_fix�ppd_dir�drv_dir�fix_ppd_symlink�	code_name�	supported�release_date�packages�commands�same_as_version�scan_supported�
fax_supported�pcard_supported�network_supported�parallel_supported�
usb_supported)�packaged_version�cups_path_with_bitness�
ui_toolkit�	policykit�libusb01�udev_sysfs_rule�native_cups�package_available�package_arch�open_mdns_port�libdir_path�hp_libs_remove_cmd�hplipz$HP Linux Imaging and Printing System)�prntr�network�gui_qt4�gui_qt5�fax�scan�docszPrint Component z1Required HPLIP base components (including hpcups)zNetwork/JetDirect I/OzGraphical User Interfaces (Qt4)zGraphical User Interfaces (Qt5)zGraphical User Interfaces (Qt)zPC Send Fax supportzScanning supportzHPLIP documentation (HTML)zAdministrative policy framework�
libusb-1.0r~)r�rr�r�r��gui_qtr�r�r�r|r}r~)r�rr�r�r�r�r�r�r�r|r}r~r�class-driver�epmr��-�automake�libjpegr�libtool�libtool --version�cupsz1.1�	lpstat -rz
cups-develz
cups-image�gcc�
gcc --version�makez3.0�make --version�
libpthread�FUNC#get_libpthread_version�gsz7.05zgs --version�libusb�FUNC#get_libusb_versionzcups-ddk�saner�zsane-config --versionz
sane-develr5zFUNC#check_libavahi_dev�xsane�0.9�FUNC#get_xsane_versionz1.0�scanimage --versionr�zdbus-daemon --versionr�r�zpkexec --versionr�z5.0.9znet-snmp-config --versionzopenssl versionzwget --versionzavahi-browse --version)�	scanimage�dbusr|zlibnetsnmp-devel�	libcryptor�r4z2.2zpython --versionzpython-notify --versionz4.0�FUNC#get_pyQt4_version�5.0�FUNC#get_pyQt5_versionz0.80.0�FUNC#get_python_dbus_ver�FUNC#get_python_xml_version�FUNC#get_pil_version�2.0�FUNC#get_reportlab_version)�python2Xz
python-notifyz
pyqt4-dbus�pyqt4z
pyqt5-dbus�pyqt5�python-dbusz
python-xmlzpython-devel�pil�	reportlabzpython3 --version)�python3Xzpython3-notify2zpython3-pyqt4-dbusz
python3-pyqt4zpython3-pyqt5-dbusz
python3-pyqt5�python3-dbuszpython3-xmlz
python3-develzpython3-pilzpython3-reportlabr��PY3�FUNC#get_HPLIP_versionr�z2.3�FUNC#get_pyQt_version)�cupsext�hpmudext�hpaio�scanext�pyqt)r�r�r�r�r�r�r�r�r�r�r�rr)��os�umask�mode�ui_moder�Password�passwordObj�version_description�version_public�version_internal�bitnessr�
LITTLE_ENDIAN�endian�DISTRO_UNKNOWN�DISTRO_VER_UNKNOWN�distro�distro_name�distro_version�distro_version_supported�install_location�
hplip_present�have_dependenciesrrjrkrWr{�enable�disable�reload_dbus�security_package�	TYPE_LIST�TYPE_INT�TYPE_STRING�	TYPE_BOOL�FIELD_TYPES�
components�selected_component�options�selected_options�EPM_STR�	check_epm�DEPENDENCY_RUN_AND_COMPILE_TIME�
GENERALDEP�AUTOMAKE_STR�check_automake�JPEG_STR�
check_libjpeg�LIBTOOL_STR�
check_libtool�DEPENDENCY_COMPILE_TIME�
COMPILEDEP�CUPS_STR�
check_cups�DEPENDENCY_RUN_TIME�EXTERNALDEP�CUPS_DEV_STR�check_cups_devel�CUPS_IMG_STR�check_cups_image�GCC_STR�	check_gcc�MAKE_STR�
check_make�
THREAD_STR�check_libpthread�GS_STR�check_gs�USB_STR�check_libusb�CUPS_DDK_STR�
check_cupsddk�SANE_STR�
check_sane�SANE_DEV_STR�check_sane_devel�	LIB_AVAHI�check_libavahi_dev�	XSANE_STR�check_xsane�
SCANIMAGE_STR�check_scanimage�DBUS_STR�
check_dbus�
POLKIT_STR�check_policykit�SNMP_DEV_STR�check_libnetsnmp�
CRYPTO_STR�check_libcrypto�NETWORK_STR�
check_wget�	AVAHI_STR�check_avahi_utils�dependencies�
PYTHON_STR�check_python�	PYNTF_STR�check_pynotify�QT4DBUS_STR�check_pyqt4_dbus�QT4_STR�check_pyqt4�QT5DBUS_STR�check_pyqt5_dbus�QT5_STR�check_pyqt5�
PYDBUS_STR�check_python_dbus�	PYXML_STR�check_python_xml�
PY_DEV_STR�check_python_devel�PIL_STR�	check_pil�
REPORTLAB_STR�check_reportlab�base.sixextr�rL�CUPSEXT_STR�
check_cupsext�PYEXT�HPMUDEXT_STR�check_hpmudext�	HPAIO_STR�check_hpaio�SCANCONF�SCANEXT_STR�
check_scanext�QT_STR�
check_pyqt�hplip_dependencies�get_python_dbus_ver�get_pyQt5_version�get_pyQt4_version�get_pyQt_version�get_reportlab_version�get_xsane_version�get_pil_version�get_libpthread_version�get_python_xml_version�get_HPLIP_version�get_libusb_version�version_func�update_spinner�append�load_distros�
distros_index)	�selfr�r�r{�python2_dep�python3_depr��opt�ds	         r
�__init__zCoreInstall.__init__�s�
��
�������	����#�,�,�W�5���OY�L�� �$�"5�t�7L�����)�)���=K�R�Qc�:���T�%�t�':�(-��%� &���"���!#���������������$��������� ��� "���/
��y�/
��X�/
�
�	�/
�
�K�	/
�

��/
�
�y�
/
�
�[�/
�
�I�/
�
�{�/
�
�y�/
�
�i�/
�
�y�/
�
!�)�/
�
%�i�/
�
�{�/
� 
��!/
�"
�{�#/
�$
�;�%/
�&
�Y�'/
�(
�{�)/
�*
�{�+/
�,
�y�-/
�.
��//
�0
��1/
�2
�K�3/
�4
�	�5/
�6
�	�7/
�8
�{�9/
�:
�i�;/
�<
�Y�=/
�>
�y�?/
�@
 ��A/
�B
!�)�C/
�D
�Y�E/
�F!,�&/�%�"�!�(�$�!*�%�'�&�"-�]/
���h
�<�?a�b�
���
#*����1�2�6�� S�UW�X��6��;��@�"�E��@�"�E��>��C��4�b�9�� 2�B�7�� <�b�A��!B�B�G���b�1� %�'8�"�=�
���&!��� � � ���� ��$� �!�!
���*.
�����'�4�>�>�Kj�lo�qu�xB�!C�.
�
���x��t�?R�?R�Ts�ux�z~�AK�!L�.
�
����(8�(�D�DV�DV�Xw�y|�C�EO�!P�	.
�

����(8�+�t�GY�GY�[r�tw�zM�OY�!Z�.
�
����'7��4�?�?�Tg�in�p{�~I� J�
.
�
����(8�,��H]�H]�_v�x{�~I�KU�!V�.
�
����(8�,��H]�H]�_v�x{�~I�KU�!V�.
�
����'7��$�.�.�Ri�kn�p�BL� M�.
�
����'7��4�?�?�Tk�mr�uE�GQ� R�.
�
����'7��T�EZ�EZ�\{�~A�C`�bl� m�.
�
����(8�&�$�-�-�Qd�fl�n|�J�!K�.
�
����'�4�;L�;L�Nm�or�uN�PZ�![�.
�"
�%�&�&�)9�<��I[�I[�]p�ru�w{�~H�"I�#.
�*
���x��4�?�?�L_�ad�f}�@J� K�+.
�,
���x��t�?T�?T�Vm�or�uL�NX� Y�-.
�.
���x��D�<S�<S�Ut�vy�|U�Wa� b�/.
�<
����)�T�=M�=M�Ob�di�lD�FQ�!R�=.
�>"'���-��AU�AU�Wj�lq�tI�KV�!W�"&����4�?�?�Lk�mp�sJ�LW�!X�
"'��I�(>�
�D�L`�L`�bu�wz�}O�Q\�!]�"&���\�4�CX�CX�Zy�|C�E`�bl�!m�!%���Z��AU�AU�Wv�x{�~O�Q[�!\�$�y�k�;����Qd�fi�k{�~I�J�#(�9�+�y�$�BX�BX�Zm�or�uM�OZ�#[�[.
���b"&���*�d�>O�>O�Qp�rw�zL�NX�!Y�!&�	�9�'=�y�$�J]�J]�_r�tw�zS�U_� `� $�	�{�K��AV�AV�Xk�mr�uM�OY� Z�!%���W�d�>N�>N�Pc�ej�mE�GQ�!R� %���[�$�BW�BW�Yl�ns�vN�PZ� [�!%���W�d�>N�>N�Pc�ej�mE�GQ�!R�!%����T�=S�=S�Uh�jr�uO�Q[�!\�#�v�h�	�4�;P�;P�Re�gj�mJ�LV�W� $��x��T�=T�=T�Vm�ot�wI�KU� V�!&���'�4�>�>�K^�`c�e{�~H�!I�"'�����@T�@T�Vi�kp�sO�Q[�!\�+
��6$(�6�(�J��@Q�@Q�Sr�ty�|O�Q[�#\�#(�)�Y�)?��D�L_�L_�at�vy�|U�Wa�"b�#(�9�+�{�D�DY�DY�[n�pu�xP�R\�#]�#'�9�+�w��@P�@P�Re�gl�oG�IS�#T�#(�9�+�{�D�DY�DY�[n�pu�xP�R\�#]�#'�9�+�w��@P�@P�Re�gl�oG�IS�#T�#'�5�'�:�t�?U�?U�Wj�lt�wQ�S]�#^�!%���)�T�=R�=R�Tg�il�oL�NX�!Y�"&�&��:�t�?V�?V�Xo�qv�yL�NX�"Y�#(�6�(�G�T�^�^�M`�be�g}�@J�#K�$)�5�'�=�$�BV�BV�Xk�mr�uQ�S]�#^�)
��0	$�����$�$�[�1����$�$�[�1�!%��x��d�>P�>P�Rq�sv�yQ�SX� Y� $��x��t�?R�?R�Ts�ux�{S�UZ� [� $��x��D�<L�<L�Nm�or�uM�OW� X�"&�&��;��@R�@R�Ts�ux�{S�U]�"^� $��z�6�4�?�?�Lk�mr�uL�NX� Y�#
���)<�&7�&7�%5�*?�&7�$3�+A�+A�&7�'9�
����<�<�	3�C����&�&�
3���$�+�+�A�.�q�1�1��L�L��%�a�(�/�/��2�
3�	3�	
����������	=�A�;<�D���t�|�|�A��w�7�8�	=rNc�	�|�|d�t�g|_|jD]]}t�|j|jdg�D]/}|s�||jvs�|jj	|��1�_|j�\|_|_|_tjd|j�d|j�d|j���|jD]}t�d|j|<�|j�|j|j|_|j#�|�|d|jz�|j%|�|jD]S}t�tjd|�d	|j|���|��8|d
|�d	|j|�d���Ut'j(|j�\}}|rtjd|�d
|�d��t'j*�|_tjd|j,z�t�t'j.�|_tjd|j0z�t�|j3dd�|_tjd|j�d|j �d|j|j d�d|j6�d|j4��
�t�|j9�|_tjd|j:z�t'j<d|j>�\}}|jA�|_!tjd|jBz�|j dk(rd|_"tjd|jDz�t'j<d|j>�\}|_#|jFjIdd�|_#tj|jF�tJjMd d!tOjPd"tOjR���tJjMd d#|j�|�	|d$�yy)%NzInit...
r^zHPLIP Description=z Public version=z Internal version = FzDistro: %s
�have � = zResult: �
zRunning package manager: z (�)zBitness = %dzEndian = %drnz	Distro = z Distro Name = z Display Name= rZz Version = z
 Supported = zHPLIP (prev install) = %szcups-config --versionzCUPS version = %s�ubuntuTz&DBUS configuration reload possible? %szuname -arU�installation�	date_timez%x %H:%M:%S�version�Done)*rKr^rW�getrL�get_hplip_versionr�r�r�r>r?rr��
get_distrorNr�r��distro_changed�check_dependenciesr�
check_pkg_mgr�
getBitnessr��	getEndianr��get_distro_ver_datar�r��check_hplipr��runr��strip�cups_verr��sys_uname_info�replace�	user_conf�set�time�strftime�	localtime)rO�callbackrS�a�pid�cmdline�status�outputs        r
�initzCoreInstall.init�s������[�!���������	0�A����\�\�!�_�(�(���<�
0����$�"3�"3�3��%�%�,�,�Q�/�
0�	0�PT�Oe�Oe�Og�L�� �$�"5�t�7L��	�	��+�+�T�-@�-@�$�BW�BW�Y�	Z��"�"�	.�A���(-�D�"�"�1�%�	.�	
�����-�-�d�k�k�:����������^�d�k�k�1�2�����)��"�"�	O�A����I�I��4�+A�+A�!�+D�E�F��#���4�3I�3I�!�3L�M�N�
	O��*�*�4�+<�+<�=���W���I�I�G�S�I�J��'�'�)����	�	�.�4�<�<�/�0����o�o�'����	�	�-�$�+�+�-�.���(,�(@�(@���) ��%�	�	�	��;�;�� 0� 0�$�,�,�t�?O�?O�2P�Q_�2`��&�&��(E�(E�G�	H�	��!�-�-�/����	�	�-��0B�0B�B�C����#:�D�<L�<L�M���������
��	�	�%��
�
�5�6����x�'�#�D���	�	�:�T�=M�=M�M�N�&+�i�i�
�D�<L�<L�&M�#���#�"�1�1�9�9�$��C����	�	�$�%�%�&�	�
�
�n�k��m�m�M�4�>�>�3C�D�	F��
�
�n�i��1D�1D�E����V�� rc��||_||_	|j|d|_||_	|jD]}d|j|<�|jdd�dk(|_
|jd�|_|jd�|_d|_y#t$r0t
j
d|z�tjd�Y��wxYw)	NrXzInvalid distro name: %srTrh�ppdrjrk)r�r�rWr��KeyErrorr>�error�sys�exitr�rr�rg�enable_ppdsrjrkr�)rOr�r]r�rSs     r
�
init_for_docszCoreInstall.init_for_docsNs���&���%���	��,�,�{�3�G�<�D�K�
����"�"�	-�A�(,�D�"�"�1�%�	-� �3�3��5�"�%*�+����/�/�	�:����/�/�	�:���(,��%���	��I�I�/�+�=�>��H�H�Q�K�	�s�B�6C�Cc�D�t�|jD]}}t�tj	d|z�|�|d|z�|j|d�|j
|<tj	d|�d|j
|����t
�y)Nz Checking for dependency '%s'...
z
Checking: %s
rrVrW)�update_ld_outputrrKr>r?r��cleanup_spinner)rOrsrSs   r
rczCoreInstall.check_dependenciesds������"�"�		G�A����I�I�9�A�=�>��#��)�A�-�.�(?��(9�(9�!�(<�Q�(?�(A�D�"�"�1�%��I�I��4�+A�+A�!�+D�E�F�		G�	�rc��|jr|jS|jtk(rddl}|jd�Sy)NrzEnter password: rU)rr��INTERACTIVE_MODE�getpass)rOr�s  r
�
password_funczCoreInstall.password_functs6���=�=��=�=� �
�\�\�-�
-���?�?�#5�6�6�rc�L�tjd�d\}}d}ddl}|jd��}|d}|d}d}|�r�|j	�j�}tjd|z�|j
d	�d
kDs|j
d�d
kDrd}tjd
|z�|dk(r|ddk(r|ddk(rd}n|dk(r|ddk(r
|ddk(rd}d|vr|dd}d}d|j	�vr|jd�}|ddz|dz}d}|jD]�}|j
|�d
kDr|j|d|_d}nV|j|jdd�D]4}	|	s�|j
|	�d
kDs�|j|d|_d}n|s��n||_
||_n(tjd�tdc|_|_
tjd|j|jfz�y)NzDetermining distro...)rUrFr)�full_distribution_namerTzDistro name=%s�redhatenterprise����redhat�rhelzDistro version=%s�5�.r��6z6.0�MXrr&�mxlinux�manjarorXr[rUz%Failed to get the distro information.rzdistro=%d, distro_version=%s)r>r?r��linux_distribution�lowerrj�find�splitrWr_r�r��warnr�)
rO�name�ver�foundr��ldr]�
found_in_listrS�xs
          r
razCoreInstall.get_distro}s'���	�	�)�*��	��c����
�
&�
&�e�
&�
D���!�u����e������:�:�<�%�%�'�D��I�I�&��-�.��y�y�+�,�r�1�T�Y�Y�x�5H�2�5M����I�I�)�C�/�0��v�~�#�a�&�C�-�C��F�c�M������C��F�c�M�c�!�f��m����t�|��1�Q�i�� ���D�J�J�L�(��)�)�C�.���a�j�#�o�g�a�j�0��!�M��\�\�
���9�9�Q�<�"�$�"&�,�,�q�/�'�":�D�K�$(�M�!�\�\�!�_�0�0��b�A�"������1���!2�*.�,�,�q�/�'�*B�D�K�,0�M�!�	"�
!��
�#&�D��#�D���H�H�<�=�/=�u�,�D�K��,��	�	�0��;�;�� 3� 3�4�5�	6rc�:�|jdd�}|dvrtjd|z�|dk(|_tj	d|jz�|jd�|_|jd�|_|js.|js"tjd|jz�|jd	d
�|_|jdd�|jd
<|jdd�|jd<|jdd�|jd<|jdd
�|jd<|jdd
�|jd<|jdd
�|jd<|jdd
�|_	|jdd�j�}|dk(r,tj	d�d|_d|jd<n0|dk(r+tj	d�d|_d|jd<|j�sd|jvr,tj	d�d|_d|jd<n9d|jvr+tj	d�d|_d|jd<|j�gd|jvr%tj	d�d
|jd<yd|jvr%tj	d �d
|jd<yyy)!Nrhr{)r{�drvzInvalid ppd_install value: %sz"Enable PPD install: %s (False=drv)rjrkzInvalid drv_dir value: %srnFrtTr�rvr�rsr�r|r}r~rr{rQzDefault UI toolkit: Qt4r��qt5zDefault UI toolkit: Qt5r�zUser selected UI toolkit: Qt4zUser selected UI toolkit: Qt5zUser deselected UI toolkit: Qt4zUser deselected UI toolkit: Qt5)rgr>�warningr�r?rjrkr�r�rr�r{r�r�)rOrhr{s   r
rbzCoreInstall.distro_changed�s����.�.�}�e�D���n�,��K�K�7�+�E�F�'�5�0����	�	�6��9I�9I�I�J��/�/�	�:����/�/�	�:����������K�K�3�d�l�l�B�C�(,�(@�(@���) ��%�'+�'?�'?��T�(#����e�$�+/�+C�+C���,'����i�(�(,�(@�(@��d�)$����f�%�-1�-E�-E���. ����k�*��2�2�:�u�E�	
����	�37�3K�3K��u�4&����/�0��3�3�M�5�I����-�-�l�E�B�H�H�J�
�����I�I�/�0�#�D�O�/3�D�!�!�)�,�
�5�
 ��I�I�/�0�#�D�O�/3�D�!�!�)�,��;�;�"�����#��	�	�9�:�"'���37��%�%�i�0��$�+�+�%��	�	�9�:�"'���37��%�%�i�0��<�<�#�����$��	�	�;�<�38��%�%�i�0��$�,�,�&��	�	�;�<�38��%�%�i�0�'�	$rc��|jj|t�}|tk(rt	j
|�S|tk(r)t
d�t
|�k(r|j�S|S|tk(r	t|�S|tk(r"|jd�D�cgc]}|s�|��	c}Sy#t$rYywxYwcc}w)NrUr�,)
r�r_r�r�r�to_bool�typerjr��int�
ValueErrorr�r�)rO�keyr �
field_typer�s     r
�__fixup_datazCoreInstall.__fixup_data�s����%�%�)�)�#�{�;�
���"��=�=��&�&�
�;�
&��B�x�4��:�%��z�z�|�#���
�8�
#�
��4�y� ��9�
$�#�z�z�#��4�!�!�A�4�4�%���
��
��5s�;
B2�"C�*C�2	B>�=B>c��d}t|�}|jd|jdd��}tj	|�|D�]�}t�i}|j
|�stj	d|z��:|j|�D]'}|j||j||��||<�)||j|<|jd|j|d��}i|j|d<||j|d<|D�]h}d\}	}
i}|�d|��}|j
|�stjd|�d|�d	���@d
|j|�vrd}	|jd|j|d��}
|j|�D]'}|j||j||��||<�)||j|d|<i|j|d|d
<|	r��|jD]x}
i}|�d|�d|
��}|j
|�s|	s�#|j|�D]'}|j||j||��||<�)||j|d|d
|
<�z��k|j|d}|D�]C}|�d|��}d
|j|�vs�|jd
|j|d
��}	ddl}|j|j|d|�}||d
<||j|d|<|j|�D]'}|j||j||��||<�)i}|jD]t}
|�d|�d|
��}|j
|�s�|j|�D]'}|j||j||��||<�)||j|d|d
|
<�v��F���y#t$r tj	d|�d|�d��Y��swxYw)Nz&/usr/share/hplip/installer/distros.datrWz+Missing distro section in distros.dat: [%s]rY�
versions_list)FT�:z)Missing version section in distros.dat: [�]rrTrn�dependency_cmdsrz?Missing 'same_as_version=' version in distros.dat for section [z].)�
ConfigBase�_CoreInstall__fixup_datar_r>r?rK�has_section�keysrWr}r�copy�deepcopyr|)rO�distros_dat_file�distros_dat�distros_listr�rSr�rYr�rrrn�v�ver_section�dep�dd�dep_sectionr��vvs                  r
rMzCoreInstall.load_distross���C�� �!1�2���(�(��{���y�)�<�>���	�	�,��"�^	!�F����A��*�*�6�2��	�	�A�F�J�L��"�'�'��/�
N���*�*�3������0L�M��#��
N�$%�D�L�L�� ��(�(��K�O�O�F�J�?�A�H�/1�D�L�L�� ��,�4<�D�L�L�� ��1��)
:��-8�*�����)/��5��"�.�.�{�;��I�I�MS�UX�Y�[��$��(8�(8��(E�E�&*�O� �-�-������k�!J�L�	�'�+�+�K�8�@�C�!�.�.��[�_�_�[�#�>�@�A�c�F�@�9:����V�$�Z�0��5�KM����V�$�Z�0��5�6G�H�"���,�,�:�C��B�06��S�"A�K�&�2�2�;�?�� �
 +�/�/��<�D��"&�"3�"3������c�!B�#D��3��D�
8:��L�L��(��4���.�0�03�5�:�5)
:�V�|�|�F�+�J�7�H�� 
!��)/��5��$��(8�(8��(E�E��)�)�*;�[�_�_�#�%6�>8�9�A�!�#�!�]�]�4�<�<��+?�
�+K�A�+N�O��01��,�-�@B����V�,�Z�8��=�#.�#3�#3�K�#@�H�C�&*�&7�&7� #�[�_�_�[�#�%F�'H�B�s�G�H� ��#'�#4�#4�
B�C�8>��S�*I�K�#.�#:�#:�;�#G� (�'2�'7�'7��'D�L��*.�*;�*;�$'�����c�)J�+L��3��L�
@B�!�L�L��0��<� #�%�%6�8�8;�=�
B�# 
!�}^	!��v$�!��	�	�hn�pq�r�t� �!�s�DO�%P�Pc��yr��rOs r
�pre_installzCoreInstall.pre_installs���rc��yrr�r�s r
�
pre_dependzCoreInstall.pre_dependvr�rc�p�tj}|dd\}}tjd||fz�|dk\S)Nr�Python ver=%d.%d�r~�version_infor>r?�rO�py_ver�py_major_ver�py_minor_vers    r
rzCoreInstall.check_pythonys?���!�!��%+�B�Q�Z�"��l��	�	�$��l�'C�C�D��q� � rc�6�tdd�xrtdd�S)Nr�rz
g++ --version��
check_toolr�s r
r�zCoreInstall.check_gccs���/�1�-�P�*�_�a�2P�Prc��tdd�S)Nr�g@r�r�s r
r�zCoreInstall.check_make�s���*�C�0�0rc��|jdd�}|dk(r2td�sy|jdk7rtt	ddd��Sytd	�sy|jdk7rtt	d
dd��Sy)
Nr}FTr�r�zusb.h�/usr/include�usb_initr�zlibusb.hz/usr/include/libusb-1.0�libusb_init)rg�	check_libr��len�locate_file_contains)rO�Is_libusb01_enableds  r
rzCoreInstall.check_libusb�s���"�6�6�z�5�I���$�&��X�&�����6�)��/����T�U�U���\�*�����6�)��/�
�<U�Wd�e�f�f�rc��td�S)Nz
epm --versionr�r�s r
r�zCoreInstall.check_epm�s
���/�*�*rc��td�S)Nzautomake --versionr�r�s r
r�zCoreInstall.check_automake�s���.�/�/rc�2�td�xrtd�S)Nr�z	jpeglib.h�r��
check_filer�s r
r�zCoreInstall.check_libjpeg�s����#�?�
�;�(?�?rc�2�td�xrtd�S)Nr�zcrypto.hr�r�s r
rzCoreInstall.check_libcrypto�s����%�@�*�Z�*@�@rc�2�td�xrtd�S)Nr�z	pthread.hr�r�s r
r�zCoreInstall.check_libpthread�s����&�B�:�k�+B�Brc�2�td�xrtd�S)N�
libnetsnmpznet-snmp-config.hr�r�s r
rzCoreInstall.check_libnetsnmp�s����&�J�:�6I�+J�Jrc��	tjd�ddl}t|j�}tjd|z�|dk\rtjd�yy#t
$rtjd�YywxYw)	NzTrying to import 'reportlab'...rz
Version: %.1sr�zSuccess.TFzFailed.)r>r?r��str�Version�ImportError)rOr�r�s   r
r0zCoreInstall.check_reportlab�so��	��I�I�7�8���i�'�'�(�C��I�I�o��+�,��e�|��	�	�*�%�����	��I�I�i� ��	�s�A A$�$B�Bc�~�tj}|dd\}}tjd||fz�|dk\xr|dk\S)Nrr�rr�r�s    r
�check_python23zCoreInstall.check_python23�sI���!�!��%+�B�Q�Z�"��l��	�	�$��l�'C�C�D��q� �6�\�Q�%6�6rc�,�	ddl}y#t$rYywxYw�NrTF)�xml.parsers.expatr�)rO�xmls  r
r*zCoreInstall.check_python_xml�s#��	�$����	��	����	�c��td�S)N�libsane)r�r�s r
rzCoreInstall.check_sane�s
����#�#rc�.�ttddd��S)Nzsane.hr�zextern SANE_Status sane_init)r�r�r�s r
rzCoreInstall.check_sane_devel�s���'��.�B`�a�b�brc��tjd�rtt�d�St	tjd��S)N�DISPLAYr�r�)r��getenv�
check_versionrD�boolr�whichr�s r
rzCoreInstall.check_xsane�s5��
�9�9�Y�� �!2�!4�e�<�<�
����G�,�-�-rc��tdd�S)Nr�g�?r�r�s r
r
zCoreInstall.check_scanimage�s���/��5�5rc��tdd�S)Nzgs -vg333333@r�r�s r
r�zCoreInstall.check_gs�s���'�4�(�(rc�L�|jdk(r	ddl}yy#t$rYywxYw)NrQrTF)r{�PyQt4r�)rOr�s  r
r"zCoreInstall.check_pyqt4��2���?�?�e�#�
������
��
����	#�#c�L�|jdk(r	ddl}yy#t$rYywxYw)Nr�rTF)r{�PyQt5r�)rOrs  r
r&zCoreInstall.check_pyqt5�r�r�c�P�|jdk(r	ddlm}yy#t$rYywxYw)NrQr��DBusQtMainLoopTF)r{�dbus.mainloop.qtrr��rOrs  r
r zCoreInstall.check_pyqt4_dbus�s2���?�?�e�#�
�;�����
��
����	%�%c�P�|jdk(r	ddlm}yy#t$rYywxYw)Nr�rrTF)r{�dbus.mainloop.pyqt5rr�rs  r
r$zCoreInstall.check_pyqt5_dbuss2���?�?�e�#�
�>�����
��
�rc�L�|jdk(r	ddl}yy#t$rYywxYw)N�qt3rTF)r{�qtr�)rOrs  r
r=zCoreInstall.check_pyqts4���?�?�e�#�
�����
�
��
�r�c��tjdtjdz�}d}|D]}td|��s�d}|S|S)Nz/usr/include/python%d*rFzPython.h)�dirT)�globr~r�r�)rO�dir_list�Found�ps    r
r,zCoreInstall.check_python_develsS���9�9�5��8H�8H��8K�K�L�����	�A��*�!�,������	�
�rc�n�	ddl}y#ttf$r	ddl}Yy#ttf$rYYywxYwwxYw)NrFT)�notify2r��RuntimeError�pynotify)rOrrs   r
rzCoreInstall.check_pynotify"sK��	�����\�*�	�
���� ��.�
��
��	�s��4��0�4�0�4c��tjd�	ddl}	|j}tjddj	|jD�cgc]
}t|���c}�z�|dk\Scc}w#t$rl	|j}tjd|jz�tjd�Yy#t$rtjd�YYywxYwwxYw#t$rYywxYw)	Nz%Checking for python-dbus (>= 0.80)...rzVersion: %sr�)r�Prz#HPLIP requires dbus version > 0.80.Fz4Unknown version. HPLIP requires dbus version > 0.80.)	r>r?r�r]�joinr��AttributeError�__version__r�)rOr�r�r�s    r
r(zCoreInstall.check_python_dbus,s����	�	�9�:�	��
!��l�l���	�	�-�#�(�(�%)�\�\�2��S��V�2�+4�4�5��j�(�(��3��"�

!�	!��*�*�C��I�I�m�d�.>�.>�>�?��I�I�C�D� ��%�!��I�I�N�P� �!��

!���	��	�s_�C2�5A:�A5�#A:�5A:�:	C/�AC	�C2�	C+�'C/�(C2�*C+�+C/�/C2�2	C>�=C>c�,�	ddl}y#t$rYywxYwr�)�ctypesr�)rOrs  r
�check_python_ctypeszCoreInstall.check_python_ctypesEs��	�����	��	�r�c���tjd�|jj�dk(r|jdk\rytdg�xrt
tddd��S)	NzBChecking for dbus running and header files present (dbus-devel)...�fedora�30Tzdbus-daemonzdbus-message.hr��dbus_message_new_signal)r>r?r�r�r��check_psr�r�r�s r
rzCoreInstall.check_dbusLsg���	�	�V�W����"�"�$�h�.�T�5H�5H�$�5N���]�O�,�U��(�)9�)7�9R�T�U�
Urc�X�td�xrttjd��S)Nzcups.h�lpr)r�r�rr�r�s r
r�zCoreInstall.check_cups_develUs ���(�#�@��U�[�[��-?�(@�@rc��tjd|j�\}}|dkDsd|vrtj	d|z�ytj	d|z�y)Nr�rznot runningzCUPS is not running. %sFzCUPS is running. %s T)rrir�r>r?)rOrwrxs   r
r�zCoreInstall.check_cupsXsT�����;��0@�0@�A�����A�:��&�0��I�I�/�&�8�9���I�I�,�v�5�6�rc��tdd�S)Nzraster.hz/usr/include/cups)r�r�s r
r�zCoreInstall.check_cups_imageas���*�&9�:�:rc�D�tjd�tdd�S)NzChecking for HPLIP...z
hplip.confz/etc/hp)r>r?�locate_filesr�s r
rhzCoreInstall.check_hplipds���	�	�)�*��L�)�4�4rc�B�tjd�td�S)NzChecking for libtool...r�)r>r?r�r�s r
r�zCoreInstall.check_libtoolhs���	�	�+�,��-�.�.rc�Z�tjd�	ddlm}y#t$rYywxYw)NzChecking for PIL...r)�ImageTF)r>r?�PILr+r�)rOr+s  r
r.zCoreInstall.check_pil�s,���	�	�'�(�	�!����	��	�s��	*�*c�D�tjd�tdd�S)NzChecking for cups-ddk...z
media.defsz/usr/share/cups/ppdc/�r>r?r�r�s r
rzCoreInstall.check_cupsddk�s���	�	�,�-��,�(?�@�@rc�D�tjd�tdd�S)NzChecking for libavahi-devzclient.hz/usr/include/avahi-clientr.r�s r
r	zCoreInstall.check_libavahi_dev�s���	�	�-�.��*�&A�B�Brc��tjd�tdd�r
tdd�rytdd�r
td	d
�rytdd�rytd
d�rtdd�r
tdd�ryy)NzChecking for PolicyKit...zPolicyKit.confz/etc/PolicyKitz0org.gnome.PolicyKit.AuthorizationManager.servicez/usr/share/dbus-1/servicesTz50-localauthority.confz#/etc/polkit-1/localauthority.conf.dz"org.freedesktop.PolicyKit1.servicez!/usr/share/dbus-1/system-serviceszorg.freedesktop.PolicyKit1.confz/etc/dbus-1/system.d�polkitdz/usr/lib/polkit-1zpolkit-agent-helper-1zpolkit.confz/usr/lib/sysusers.dFr.r�s r
rzCoreInstall.check_policykit�s����	�	�-�.��&�(8�9�j�I{�~Z�?[��
�0�2W�
X�]g�iM�Or�^s��
�9�;Q�
R��
�	�#6�
7�J�G^�`s�<t�zD�ER�Ti�zj��rc��tjd�	tjd�y#t$rtjd�YywxYw)Nz$Checking 'cupsext' CUPS extension...r�TzeNOT FOUND OR FAILED TO LOAD! Please reinstall HPLIP and check for the proper installation of cupsext.F�r>r?r�
import_extr�r}r�s r
r3zCoreInstall.check_cupsext�sK���	�	�8�9�	����Y�'����	��I�I�w�
y��	���-�A�
Ac��tjd�	tjd�y#t$rtjd�YywxYw)Nz$Checking 'hpmudext' I/O extension...r�TzfNOT FOUND OR FAILED TO LOAD! Please reinstall HPLIP and check for the proper installation of hpmudext.Fr3r�s r
r6zCoreInstall.check_hpmudext�sK���	�	�8�9�	����Z�(����	��I�I�x�
z��	�r5c��tjd�	tjd�y#t$rtjd�YywxYw)Nz*Checking 'pcardext' Photocard extension...�pcardextTzfNOT FOUND OR FAILED TO LOAD! Please reinstall HPLIP and check for the proper installation of pcardext.Fr3r�s r
�check_pcardextzCoreInstall.check_pcardext�sK���	�	�>�?�	����Z�(����	��I�I�x�
z��	�r5c�\�d}dD]f}tjd|z�	t|d�}|D]5}tjdd|�}tj
d|�}|s�3d}n	|s�fn|stjd
�|S#t$rtjd	|z�Y�BwxYw)NF)�/etc/sane.d/dll.confz/etc/sane.d/dll.d/hpaioz/etc/sane.d/dll.d/hplipz'Checking for hpaio' in '%s'...�r�\srUr�Tz'%s' not found.z8'hpaio' not found in SANE conf files. Is SANE installed?)	r>r?�open�re�sub�match�IOError�infor})rOr��pathrD�line�lineNoSpace�hpaiomatcheds       r
r8zCoreInstall.check_hpaio�s�����b�	�D��I�I�7�$�>�?�

���s�O����D�"$�&�&���D�"9�K�#%�8�8�G�[�#A�L�#� $������	� ��I�I�P�Q�����
3����*�T�1�2�
3�s�B�!B+�*B+c�2�d}tjdd�}tjd�}d}|j	|����|j	|�jd�dz}tjj|dz��rptjd�	td	d
�}|D]5}tjdd|�}tjd
|�}	|	s�3d}n|j�|�st
j(d	�}|j j#�dz}
tjd|
z�t%j&|
|j �	td	d�}|j+d
�|j�|j,dz}d|z}
|j j#�|
z}
tjd|
z�t%j&|
|j �|S#t$rntjd�|j j#�dz}
tjd|
z�t%j&|
|j �Y��|wxYw#t$rtjd�Y��wxYw)NF�dirs�home�(\S.*)share\/hplipr�lib/zsane/libsane-hpaio.so.1z-'Updating hpaio' in '/etc/sane.d/dll.conf'...r;r<r=rUr�Tz8'/etc/sane.d/dll.conf' not found. Creating dll.conf fileztouch /etc/sane.d/dll.confzcmd=%szchmod 777 /etc/sane.d/dll.confza+i�zchmod %o /etc/sane.d/dll.conf)�sys_confr_r?�compilerA�groupr�rD�existsr>r?r>r@�closerBr}r��
getAuthCmdrri�stat�write�st_mode)
rOr��home_dir�pat�
usrbin_dir�
usrlib_dirrDrErFrG�cmd�st�actv_permissionss
             r
�update_hpaiozCoreInstall.update_hpaio�s-�����<�<���/���j�j�2�3���
��9�9�X��*����8�,�2�2�1�5��>�J��w�w�~�~�j�+D�D�E��	�	�I�J���3�S�9�A�!"�"��&(�f�f�U�B��&=��')�x�x���'E��'�$(�E�!�"��G�G�I�����!7�8�B��*�*�5�5�7�:Z�Z�C��I�I�h��n�-��I�I�c�4�#3�#3�4�"� �!7��>��
����(����	�')�z�z�E�'9�$�9�<L�L�C��*�*�5�5�7�#�=�C��I�I�h��n�-��I�I�c�4�#3�#3�4����C�5��I�I�R�T��*�*�5�5�7�:V�V�C��I�I�h��n�-��I�I�c�4�#3�#3�4�5��,#�X��	�	�V�X�X�s%�G:�"I4�:A3I1�0I1�4J�Jc��tjd�d}	tjd�d}|S#t$rtjd�Y|SwxYw)Nz-Checking 'scanext' SANE scanning extension...Fr�TzeNOT FOUND OR FAILED TO LOAD! Please reinstall HPLIP and check for the proper installation of scanext.r3)rOr�s  r
r;zCoreInstall.check_scanext#s]���	�	�A�B���	����Y�'�
�E�����	y��I�I�w�
y���	y�s�2�A�Ac���ddg}tj�D]Z}tjt|d�s�#||d<tt	tjt|d��|d<|cS|S)NrUFrr)�SEC_DICTr�r�all�map)rOr�r�s   r
�security_package_statusz#CoreInstall.security_package_status/sl���U����=�=�?�	�C��y�y��#��q�)�*���a���s�4�9�9�h�s�m�A�.>�?�@��a����	��rc���tj�}|dz}d|z}|jj�|z}tjd�t
j||j�\}}y)Nz/selinux/hplip.ppzsemodule -n -i zInstalling SELinux profile...)r��getcwdr�rRr>rCrri)rO�src_dir�profile_location�profile_cmdrZrwrxs       r
�selinux_installzCoreInstall.selinux_install;sd���)�)�+��"�%8�8��'�*:�:�����)�)�+�k�9�����0�1����3��(8�(8�9���rc��d\|_|_|_|jtk(r�tjdt
j�}	tdd�}|D]y}|jd�s�|j|�}|jd�|_|jd�|_|jd�|_|jd	�}n|j�d
k7rQtjd�n;	dt j#d
dd�t$j&	c|_|_|_|j|j|jfS#t$r=dt j#d
dd�t$j&	c|_|_|_Y�hwxYw#t($rd\|_|_|_Y��wxYw)NrTz:AC_INIT\(\[(.*?)\], *\[(.*?)\], *\[(.*?)\], *\[(.*?)\] *\)z./configure.inr<�AC_INITrrrrr�zInvalid archive!rU�	configurezinternal-tag�0.0.0)r�r�r�r��MODE_INSTALLERr?rN�
IGNORECASEr>�
startswith�searchrOrQr>r}rBrMr_�prop�installed_versionr|)rO�ac_init_pat�	config_in�c�	match_objr�s      r
r`zCoreInstall.get_hplip_versionCs���OY�L�� �$�"5�t�7L��9�9��&��*�*�Q�SU�S`�S`�b�K�
2� �!1�3�7�	�#��A��|�|�I�.�$/�$6�$6�q�$9�	�3<�?�?�1�3E��0�.7�o�o�a�.@��+�09����0B��-�(���q�1�������!��7�?��I�I�0�1�
b�����[�.�%,�.�/3�/E�/E�F�U��(�$�*=�t�?T��'�'��)<�)<�d�>S�>S�S�S��7�
F�����[�.�%,�.�/3�/E�/E�F�U��(�$�*=�t�?T�
F��0�
b�Wa�T��(�$�*=�t�?T�
b�s%�E!�:F*�!AF'�&F'�*G�
Gc��d}i}tr!|jdxr|jd}n |jdxr|jd}|jd|d<|rd|d<d|d	<d|d
<d|d<d|d<d
|d<nc|jd|d<|jdxr||d	<||d
<|jd|d<|jd|d<|jd|d<|jd|d<|jd|d<|jd|d<|jd|d<|jr6d
|d<d|d<d|d<d|d<|jrd
|d<d|d<n@d|d<d
|d<n5d|d<d
|d<d|d<d|d<|jrd
|d<d|d<n
d|d<d
|d<|j
�g|j
D]X}|dk(rd|d<d|d<d|d<�|dk(rd|d<d|d<d|d<�-|dk(rd|d<�8|dk(rd|d<�C|dk(rd|d<�N|dk(s�Td|d<�Z|j�g|jD]X}|dk(rd
|d<d|d<d|d<�|dk(rd
|d<d|d<d|d<�-|dk(rd
|d<�8|dk(rd
|d<�C|dk(rd
|d<�N|dk(s�Td
|d<�Z|j�|d |jzz
}|jd!d�}|r|jd"k(r	|d#|zz
}n|jd"k(r|d$z
}|d%|jzz
}|jd&d�r|jd"k(r|d'z
}|j
�|j
D]}d
||<�	|j�|jD]}d||<�	|D]}||r	|d(|zz
}�|d)|zz
}�|jd*k(r|d+z
}|jd,k(r|d-z
}d.tjvr$tjj!d/�r|d0z
}|S)1N�./configurer�r�r�r�z
network-buildFz
scan-buildz	fax-buildz
dbus-buildrQr�Tr�r�r�r�r�r�z	doc-buildr|r}�libusb01_buildr~�udev_sysfs_ruleszhpcups-installz
hpijs-installzfoomatic-ppd-installzfoomatic-drv-installzcups-ppd-installzcups-drv-install� --with-hpppddir=%sr��@� --libdir=%s� --libdir=/usr/lib64z --prefix=%srzzZ --with-cupsbackenddir=/usr/lib64/cups/backend --with-cupsfilterdir=/usr/lib64/cups/filterz --enable-%sz
 --disable-%sr6z --enable-apparmor_buildr7z --enable-selinux_buildz	.internalztestcommon/z --enable-hplip_testing_flag)r�r�r�rr�r�r�rjrgr�r�r�rrr]r�rDrP)rO�bClassDriver�
configure_cmd�
configuration�
dbus_availrvr�s       r
rlzCoreInstall.configureisp��%�
��
���/�/���C� �2�2�>�B�
��/�/���B� �2�2�=�A�
�)-�)>�)>�y�)I�
�o�&��*/�M�,�'�).�M�+�&�*/�M�,�'�#(�M�%� �#(�M�%� �,0�M�.�)�*.�*?�*?��*G�M�,�'�#�4�4�U�;�J�
�
��
�*4�M�,�'�#'�#8�#8��#C�M�%� �#'�#8�#8��#C�M�%� �,0�,A�,A��- �M�.�)�&*�%:�%:�6�%B�
�k�"�%)�%:�%:�;�%G�
�k�"�*.�*?�*?�
�*K�
�&�'�,0�,A�,A��-�
�(�)����.2�M�*�+�-2�M�/�*�49�M�0�1�49�M�0�1����48�
�0�1�49�
�0�1�49�
�0�1�48�
�0�1�/4�M�*�+�-1�M�/�*�05�M�,�-�05�M�,�-����8<�
�4�5�8=�
�4�5�8=�
�4�5�8<�
�4�5��;�;�"��[�[�
>���(�(�5:�M�/�2�<A�M�"8�9�<A�M�"8�9��/�)�6;�M�"2�3�8=�M�"4�5�8=�M�"4�5��0�0�<A�M�"8�9��0�0�<A�M�"8�9��,�,�8=�M�"4�5��,�,�8=�M�"4�5�!
>�$�<�<�#��\�\�
=���(�(�59�M�/�2�8=�M�"4�5�8=�M�"4�5��/�)�6:�M�"2�3�<A�M�"8�9�<A�M�"8�9��0�0�<@�M�"8�9��0�0�<@�M�"8�9��,�,�8<�M�"4�5��,�,�8<�M�"4�5�!
=�$�<�<�#��2�T�\�\�A�A�M��.�.�}�e�D���4�<�<�2�-��^�{�;�;�M�
�\�\�R�
��3�3�M���$�*?�*?�?�?�
��#�#�$<�e�D����Y[�I[��y�y�M��;�;�"��[�[�
(��#'�
�a� �
(��<�<�#��\�\�
)��#(�
�a� �
)��	5�A��Q����!�!3�3�
���1�!4�4�
�		5�� � �J�.��7�7�M�� � �I�-��6�6�M��$�,�,�&�2�7�7�>�>�-�+H��;�;�M��rc�L�d}|dz
}|d|jzz
}|jdd�}|r|jdk(r	|d|zz
}n|jdk(r|dz
}|jd	�|_|j�|jd
k(r|dz
}n|dz
}|jd
�|_|j�'|jdk(r|j
r|dz
}n|dz
}n|dz
}|jd�|_|j�|dz
}n|dz
}|jd�|_|j�|dz
}n|dz
}|jd�|_|j�|dz
}n|dz
}|jd�|_	|j�|jdk(r|dz
}n|dz
}|jd�|_
|j�|jdk(r|dz
}n|d z
}|jd!�|_|j�|jdk(r|d"z
}n|d#z
}|d$z
}|S)%Nryz --prefix=/usrr|r�Fr}r~rr{r
z --enable-qt3 --disable-qt4z
 --enable-qt4rrz� --enable-hpcups-install --disable-cups-drv-install --enable-cups-ppd-install --disable-hpijs-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-foomatic-rip-hplip-installz� --enable-hpcups-install --enable-cups-drv-install --disable-cups-ppd-install --disable-hpijs-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-foomatic-rip-hplip-installz� --disable-hpcups-install --disable-cups-drv-install --disable-cups-ppd-install --enable-hpijs-install --enable-foomatic-drv-install --enable-foomatic-ppd-install --enable-foomatic-rip-hplip-installrtz) --disable-fax-build --disable-dbus-buildz' --enable-fax-build --enable-dbus-buildrvz --disable-network-buildz --enable-network-buildrsz --disable-scan-buildz --enable-scan-buildr|z --enable-policykitz --disable-policykitr}z --enable-libusb01_buildz --disable-libusb01_buildr~z --enable-udev_sysfs_rulesz --disable-udev_sysfs_rulesz --enable-doc-build)rjrgr�r{rr�rtrvrsr|r}r~)rOr�r�s   r
�configure_htmlzCoreInstall.configure_html�s��%�
��)�)�
��.����=�=�
��.�.�}�e�D���4�<�<�2�-��^�{�;�;�M�
�\�\�R�
��3�3�M��2�2�<�@����?�?�&�4�?�?�e�+C��:�:�M��_�,�M��3�3�M�B������'�D�,<�,<��,A�����"l�l�
��"l�l�
��f�
f�M�!�5�5�o�F������%��H�H�M��F�F�M�!%�!9�!9�:M�!N����!�!�)��7�7�M��6�6�M�"�6�6�7G�H������&��4�4�M��3�3�M��1�1�+�>����>�>�%�$�.�.�A�*=��2�2�M��3�3�M��0�0��<��
��=�=�$����!�);��7�7�M��8�8�M�#�7�7�8I�J������+��0D�0D��0I��9�9�M��:�:�M��.�.�
��rc���|dk(rJd}tjd|z�|j|�dd|jj	�|zgS|dk(r/d}tjd|z�|j|�dd|gS|dk(r/d	}tjd|z�|j|�dd|gS|d
k(rJd}tjd|z�|j|�dd|jj	�|zgS|dk(r0|j|�dd|jj	�dzgS|j|�dd|jj	�dzgS)
N�izmake installzcmnd:%sz
make cleanr��tz	make distr<zmake rpm�bzmake debrS)r>rCrlr�rR)rOr��option�cmnds    r
�
build_cmdszCoreInstall.build_cmds7s����S�=�!�D��H�H�Y��%�&��N�N�<�0� ��D�,�,�7�7�9�D�@�B�
B��s�]��D��H�H�Y��%�&��N�N�<�0� ��D�"�
"��s�]��D��H�H�Y��%�&��N�N�<�0� ��D�"�
"��s�]��D��H�H�Y��%�&��N�N�<�0� ��D�,�,�7�7�9�D�@�B�
B��s�]��N�N�<�0� ���$�$�/�/�1�N�B�D�
D�
�N�N�<�0� ���$�$�/�/�1�N�B�D�
Drc��	|r^|j|jd|j|d�xs-|j|jj|d�xs|S|j|jd|jj|d�xs-|j|jj|d�xs|S#t$r|cYSwxYw�NrY�rWr�r_r�r|�value�rOr��default�
distro_vers    r
rgzCoreInstall.get_distro_ver_data_s���	���|�|�D�$4�$4�5�j�A�*�M�Q�Q�RU�W[�\�M��L�L��!1�!1�2�6�6�s�D�A�M�EL�M��|�|�D�$4�$4�5�j�A�$�BU�BU�V�Z�Z�[^�`d�e�M��L�L��!1�!1�2�6�6�s�D�A�M�EL�M���	��N�	�s�AC
�"A'C
�
C�Cc��	|j|jj|d�xs|S#t$r|cYSwxYwr)rWr�r_r|)rOr�r�s   r
�get_distro_datazCoreInstall.get_distro_datalsB��	��<�<�� 0� 0�1�5�5�c�4�@�K�G�K���	��N�	�s�,/�=�=c�
�	|r3|j|jd|j|d�xs|S|j|jd|jj|d�xs|S#t$r|cYSwxYwr�r�r�s    r
�get_ver_datazCoreInstall.get_ver_datars���	���|�|�D�$4�$4�5�j�A�*�M�Q�Q�RU�W[�\�g�`g�g��|�|�D�$4�$4�5�j�A�$�BU�BU�V�Z�Z�[^�`d�e�p�ip�p���	��N�	�s�4A4�<A4�4B�Bc��|jdi|�}|j|i�}|jdg�}|jdg�}||fS)Nr�rprq)r�r_)rO�
dependency�supported_distro_vrsr��dependency_datarprqs       r
�get_dependency_datazCoreInstall.get_dependency_data~s[���+�+��r�#7�9��)�-�-�j�"�=��"�&�&�z�2�6��"�&�&�z�2�6����!�!rc�P�t|jj��}|j�g}g}g}|D]w}d}|j|dD]}|j|s�d}�|s�1|j|�\}}	|r|D]}
|
|vs�|j
|
��|	s�g|j|	��y|jd�}|j|�|r5dj|�}|j
tj|��|stjd�|S)NFrTr_� zNo cmds/pkgs)�listrr��sortr�r�rL�extendrgrr�catr>r})rOr��commands_to_run�packages_to_install�overall_commands_to_runrS�includerR�pkgs�cmdsrr_s            r
�get_dependency_commandsz#CoreInstall.get_dependency_commands�s0��
�$�#�#�(�(�*�
+��
���	��� ��"$���	1�A��G��(�(��+�A�.�
#���(�(��-�"�G�
#��!�5�5�a�8�
��d��!�:�� �$7�7�/�6�6�q�9�:��#�*�*�4�0�	1� �2�2�3D�E���&�&��7��"%�(�(�+>�"?��#�*�*�5�9�9�_�+E�F�&��I�I�n�%�&�&rc�R�|jtk7xr|jtk7Sr)r�r�r�r�r�s r
�distro_knownzCoreInstall.distro_known�s"���{�{�n�,�Z��1D�1D�HZ�1Z�Zrc��|jtk(r<|jtk7xr'|jt
k7xr|j
dd�Sy)NrnFT)r�rnr�r�r�r�r�r�s r
�distro_supportedzCoreInstall.distro_supported�s[���9�9��&��;�;�.�0�I�T�5H�5H�L^�5^�I�cg�ct�ct�vA�CH�dI�
I�rc�F�d}|j�D]\}}}|dz
}�
|S�Nrr)�missing_required_dependencies)rO�num_req_missingrS�descrRs     r
�'count_num_required_missing_dependenciesz3CoreInstall.count_num_required_missing_dependencies�s5���� �>�>�@�	!�L�A�t�S��q� �O�	!��rc�H�d}|j�D]\}}}}|dz
}�|Sr�)�missing_optional_dependencies)rO�num_opt_missingrSr��reqrRs      r
�'count_num_optional_missing_dependenciesz3CoreInstall.count_num_optional_missing_dependencies�s8����!%�!C�!C�!E�	!��A�t�S�#��q� �O�	!��rc#�PK�|j|jdD]�}|j|s�|j|dD]\}|j|t
s�|j|r�*tjd|z�||j|t|f���^��y�w)NrrzMissing required dependency: %s�
r�r�r�r�r�DEPENDENCY_REQUIRED_INDEXr�r>r?�DEPENDENCY_DISPLAY_INDEX�rO�compr�s   r
r�z)CoreInstall.missing_required_dependencies�s������O�O�D�$;�$;�<�Q�?�		^�D��$�$�T�*��<�<��-�a�0�^�C��(�(��-�.G�H�#�5�5�c�:��I�I�&G�#�&M�N�"%�t�'8�'8��'=�>V�'W�Y]�"]�]�
^�		^�s�/B&�+B&�B&�.8B&c#�rK�|j|jdD]�}|j|s�|j|dD]m}|j|t
r�|j|r�*tjd|z�||j|t|j|d|f���o��y�w)Nrr�Missing optional dependency: %srr�r�s   r
r�z)CoreInstall.missing_optional_dependencies�s������O�O�D�$;�$;�<�Q�?�		y�D��$�$�T�*��<�<��-�a�0�y�C��,�,�S�1�2K�L�#�5�5�c�:��I�I�&G�#�&M�N�"%�t�'8�'8��'=�>V�'W�Y]�Yj�Yj�kn�Yo�pq�Yr�tx�"x�x�
y�		y�s�/B7�+B7�B7�.A	B7c���d}|j|jdD]�}|jd�dk7r|j|j�dk(r�6|j|dr�Id}|j
|sd}|||j|d|�|j
|<|j
|s��|j|dD]/}|j|r�tjd|z�|dz
}�1��|S)	Nrr�gui_r��y�nrr�)	r�r�r�r{r�r�r�r>r?)rO�answer_callbackr�rRr�rSs      r
�select_optionszCoreInstall.select_options�s�����?�?�4�#:�#:�;�A�>�	1�C��x�x���2�%�#�(�(�4�?�?�*C�r�*I���<�<��$�Q�'����,�,�S�1�!�G�-<�����c�*�1�-�w�.8��%�%�c�*��(�(��-�!�\�\�#�.�q�1�1��#�5�5�a�8��I�I�&G�!�&K�L�+�q�0�O�1�	1�$�rc�Z�tjd�rytjd�y)N�wgetTzwget is not installedF�rr�r>r?r�s r
rzCoreInstall.check_wget�s!���;�;�v����I�I�-�.�rc�Z�tjd�rytjd�y)Nzavahi-browseTzavahi-browse is not installedFr�r�s r
rzCoreInstall.check_avahi_utils�s!���;�;�~�&���I�I�5�6�rc��|jdd|�}tj|�|r]d}|D]U}tj||j
�\}}|dk7rtj
d|z�|�||d|z�|dz
}�Wyy)Nr`rr�An error occurred running '%s'zPre-install step %dTF�rgr>r?rrir�r��rOrsr��pre_cmdr�rZrwrxs        r
�run_pre_installzCoreInstall.run_pre_installs����*�*�+<�d�J�O���	�	�'����A��	
��!&���3��0@�0@�!A�����Q�;��H�H�=��C�D��'��S�"7�!�";�<��Q���	
��rc��|jdd|�}tj|�t|�|r�d}t	j
||j�\}}td|vd|vd|vd|vg�r|dk(r6tjd|z�n|dk7rtjd|z�|�||d	|z�|dz
}yy)
Nr�r�yum�zypper�dnf�pacmanr�rz hp_libs_remove step %d)	rgr>r?�printrrir��anyr�)rOrsr��
hp_lib_rm_cmdr�rwrxs       r
�remove_default_hplip_libsz%CoreInstall.remove_default_hplip_libss����0�0�1E�t�Z�X�
��	�	�-� �
�m����A�"�Y�Y�}�d�6F�6F�G�N�F�F��E�]�*�8�}�+D�e�}�F\�^f�jw�^w�x�y��Q�;��H�H�=�
�M�N��Q�;��H�H�=�
�M�N��#���(A�A�(E�F�
��F�A�rc�|�|jdd|�}tj|�|r�d}|D]�}tj||j
�\}}t
d|vd|vd|vd|vg�r|dk(r6tjd|z�n|dk7rtjd|z�|�||d	|z�|dz
}��yy)
Nrarr�r�r�r�r�rzPre-depend step %d)rgr>r?rrir�r�r�r�s        r
�run_pre_dependzCoreInstall.run_pre_depend0s����*�*�+;�T�:�N���	�	�'����A��
��!&���3��0@�0@�!A��������h�#�o�u��|�X�QT�_�U�V���{����!A�C�!G�H���{����!A�C�!G�H��'��S�"6��":�;��Q���
�rc��|jdd|�}tj|�|r]d}|D]U}tj||j
�\}}|dk7rtj
d|z�|�||d|z�|dz
}�Wyy)Nrbrrr�zPost-depend step %dr�)rOrsr��post_cmdr�rZrwrxs        r
�run_post_dependzCoreInstall.run_post_dependCs����+�+��t�Z�1���	�	�(����A��	
��!&���3��0@�0@�!A�����Q�;��H�H�=��C�D��'��S�"7�!�";�<��Q���	
�rc�D�ddlm}|r|jdd|�}n|jdd|�}tj	|�|rZd}|D]R}|�||d|z�tj||j�\}}|dk7rtjd�|dz
}�Tyy)Nrr�rdrcrzScanjet-depend step %dzWFailed to install this Scanjet dependency package. Some Scanjet features will not work.)	r1r�rgr>r?rrir�r�)	rOrsr�r��scanjet_cmdr�rZrwrxs	         r
�run_scanjet_dependzCoreInstall.run_scanjet_dependTs���#���2�2�3K�T�S]�^�K��2�2�3G��z�Z�K��	�	�+����A�"�
���'��S�":�Q�">�?�!&���3��0@�0@�!A�����A�:��H�H�v�w��Q���
�
�rc��g}|jdd|�r,|j|jj�dz�|S)NrlFz!python ./installer/fix_symlink.py)rgrLr�rR)rOr�r�s   r
�	pre_buildzCoreInstall.pre_buildmsF�����#�#�$5�u�j�I��K�K��(�(�3�3�5�;�<�
=��rc��d}|j|�D]8}tj||j�\}}|�||d|z�|dz
}�:y)NrzPre-build step %d)r�rrir��rOrsr�r�rZrwrxs       r
�
run_pre_buildzCoreInstall.run_pre_buildusX��
���>�>�*�-�	�C�"�Y�Y�s�D�,<�,<�=�N�F�F��#���1�A�5�6�
��F�A�	rc��d}|j|�D]8}tj||j�\}}|�||d|z�|dz
}�:y)NrzPost-build step %d)�
post_buildrrir�r�s       r
�run_post_buildzCoreInstall.run_post_build~sX��
���?�?�:�.�	�C�"�Y�Y�s�D�,<�,<�=�N�F�F��#���2�Q�6�7�
��F�A�	rc��g}|jrP|jdrA|j|jj	�dz�t
j
d�tddg�}tjdd�}|D]U}t
j
d|�d	||�d
��|d|zz}|j|jj	�|z��W|S)Nr|zsh /etc/init.d/dbus reloadz4Will reload DBUS configuration for PolicyKit supportr�hpssd�killT�Found � for � process� %s)
r�r�rLr�rRr>r?�
get_ps_pidrr�)rOr�r��pid_list�kill_cmdrur�s       r
r�zCoreInstall.post_build�s��������� 5� 5�k� B��K�K��(�(�3�3�5�4�5�
6��I�I�L�M��|�W�5�6���;�;�v�t�,���	>�C��I�I�3���
�F�G��e�c�k�)�D��K�K��(�(�3�3�5��<�=�	>�
�rc��d}|jj�|z}tj||j�\}}y)Nz{rm -rf .libs/libhpipp.so.0.0.1T .libs/libsane-hpaio.so.1.0.0T .libs/libhpmud.so.0.0.6T .libs/hpmudext.soT .libs/cupsext.soT)r�rRrri)rO�run_cmdrZrwrxs     r
�
remove_soTzCoreInstall.remove_soT�s?��P�����)�)�+�g�5�����3��(8�(8�9���rc���d}|jd�}|rV|�	||d�tj||j�\}}|dk(r#|j	�|_|j
sd}|S)NTrfzRemoving old HPLIP versionrF)rgrrir�rhr�)rOrs�failedrfrwrxs      r
�remove_hplipzCoreInstall.remove_hplip�st�����3�3�4F�G����#��)�+G�H�"�Y�Y�'7��9I�9I�J�N�F�F���{�%)�%5�%5�%7��"��)�)�"�F��
rc�t�|jj�|jj�dk(ryy)NrUFT)r��
clearPassword�getPasswordr�s r
�check_passwordzCoreInstall.check_password�s1�����&�&�(����'�'�)�R�/��rc���d}ttj��D](\}}|dkDrntj||�s�$||z
}�*t
j
d|z�|dkDS)zr
        Example code from David Mertz' Text Processing in Python.
        Released in the Public Domain.
        gg�������?zFile error page score: %fg�?)r��err_pats�itemsr?rqr>r?)rO�page�	err_scorerW�probs     r
�isErrorPagezCoreInstall.isErrorPage�si��
�	��h�n�n�.�/�	"�I�C���3����y�y��d�#��T�!�	�		"�	�	�	�-��;�<��4��rc�,�|jtk7ryy�NT)r�r�r�s r
�validate_distozCoreInstall.validate_disto�s���;�;�.�(��rc��yrr�r�s r
�validate_distro_versionz#CoreInstall.validate_distro_version�s��rc��y)NFr�)rOr�s  r
�is_auto_installer_supportz%CoreInstall.is_auto_installer_support�s��rc��d}tj�dk7rd}tjddd�}tjddd	�}|dk(rtjd
�y|tk7r'tjd|zdd
gd
�\}}|r|d
k(ry|jd�}tjd|z�tjd�tjddt�}	tjd�\}
}|
dur�|tk7r9tjddd
gd�\}}|r|d
k(rtjd�yt!dg�}tj"dd�}
|D]\}tjd|�d||�d��|
d|zz}tj$|�\}}tjd|�d|����^tjd�\}}tjd�\}}|dus|durtjd�y|r;|j'�\}}|rt)j*d�|j-|�d}|r|j.j1�|z}tj$||j.�\}
}|�K|j3�D]8}|j5d �d!k7r�tj6||j.|��:|j9�}|d"rQtjd#�t:|dd"D�cgc]#}tj6||j.|���%c}t=j>d$�}|jA|�}d}|��|jCd"�d%z}|jCd"�d&z}d}tjDtF|�}|tI|�kr8tj6|||j.|�|d"z
}|tI|�kr�8d}tjDtJ|�} |tI| �kr8tj6| ||j.|�|d"z
}|tI| �kr�8d}!|tk7r/|	tk7r&tjd'dd
gd�\}}|r
|dk(rd}!nd}!|!durtjDtL|�}"ng}"d}|tI|"�kr8tj6|"||j.|�|d"z
}|tI|"�kr�8tjdd(d�}#|#r!tj6|#|j.|�tjDtN�}$d}|tI|$�kr8tj6|$||j.|�|d"z
}|tI|$�kr�8tjDtPd)�}%|%D]#}&tj6|&|j.|��%tjDtPd*�}%|%D]#}&tj6|&|j.|��%d+}|j.j1�|z}tj$||j.|�\}
}|
dk(r>|j3�}'|'D])}(|(|k7s�	tj6|(|j.|��+tRD]m})|)s�d,|)z}|j.j1�|z}tj$||j.|�\}
}|
dk7s�RtjUd-|)�d.|�d/���o|!dk(r�d}tjDtV|�}*|tI|*�kr8tj6|*||j.|�|d"z
}|tI|*�kr�8d}tjDtX�}+|tI|+�kr8tj6|+||j.|�|d"z
}|tI|+�kr�8tj6||j.|�|�&|d0z},tj6|,|j.|�tjd1�ycc}w)2NFrTrIrJrUr�r]rmzHPLIP is not installed.z4
Are you sure to uninstall HPLIP-%s (y=yes, n=no*)?:r�r�rfzhplip_remove_cmd =%s zStarting uninstallation...�plugin�	installedrzs
Some HPLIP applications are running. Press 'y' to close and proceed or Press 'n' to quit uninstall (y=yes*, n=no):zLQuiting HPLIP unininstallation. Close application(s) manually and run again.r�r�r�r�r�zsts =z out=rzQFailed to close HP-Toolbox/HP-Systray. Close manually and run hp-uninstall again.zfind /home -name .hplipzfind:r�rzRemoving Security ProfilesrKzbin/rLz?
Do you want to remove HP proprietary plug-ins (y=yes*, n=no)?:r{z/etc/udev/rules.dz/lib/udev/rules.dzfind /usr -type d -name hplipz"find /usr -type f -name %s -deletezFailed to delete z library  [r�zhp-unistallz!HPLIP uninstallation is completed)-r��getuidrMr_r>r}�NON_INTERACTIVE_MODEr�enter_choicer�r?rC�	sys_state�PLUGIN_NOT_INSTALLEDr�Is_Process_Runningr�r�ri�close_package_managersr~rr�r�rR�
splitlinesr��removercr`r?rNrArO�
expandList�	BINS_LISTr��	LIBS_LIST�
HPLIP_LIST�
FILES_LIST�
RULES_LIST�HPLIP_EXT_LISTr��PLUGIN_LIST�PLUGIN_STATE)-rOr�rs�	checkSudorVr]�ok�choicerf�plugin_staterwrxr�r�rur��sts�out�toolbox_status�systray_status�	User_exit�Is_pkg_mgr_runningrZr�
package_strDrWrrXrY�cnt�BINS_LIST_FULL�LIBS_LIST_FULL�remove_plugins�HPLIP_LIST_FULLrj�FILES_LIST_FULL�RULES_LIST_FULL�fl�
hplip_folders�hplip_d�ext_f�PLUGIN_LIST_FULL�PLUGIN_STATE_FULL�hp_uninstalls-                                             r
�	uninstallzCoreInstall.uninstall�s����	�
�9�9�;�!���I��<�<����3���,�,�w�	�7�;���r�>��I�I�/�0���'�'��)�)�G�'�Q�TW�Y\�S]�_b�d�J�B����3����/�/�0B�C���	�	�)�,<�<�=����-�.� �}�}��k�#7�9���1�1�,�?�����T�>��+�+� �-�-�K�NQ�SV�MW�Y\�]�
��F��V�s�]��H�H�f�h� �"�<�.�1�H��{�{�6�4�0�H��
9���	�	�s�H�S�M�J�K��%�#�+�-�� �9�9�T�?���S��	�	�c�3�7�8�	
9�"'�!9�!9�,�!G����!&�!9�!9�,�!G�����T�!�^�t�%;��I�I�c�
e���,0�,G�,G�,I�)�I�)����������h�'�(����"�"�-�-�/�#�5�C����3��(8�(8�9�������&�&�(�
=���6�6�'�?�b�(�����Q�� 0� 0�)�<�	
=��1�1�3�
��a�=��I�I�2�3��z�!�}�-�a�0�
2���\�\�!�T�-�-�y�
9�
2��j�j�2�3���y�y��"���
������A���/�J����A���/�J��C�"�-�-�i��D�N���N�+�+����^�C�0�$�2B�2B�I�N��q�����N�+�+��C�"�-�-�i��D�N���N�+�+����^�C�0�$�2B�2B�I�N��q�����N�+�+����'�'�L�<P�,P��)�)�R�UX�Z]�T^�`c�e�J�B���f��m�!%��!�N��U�"�#�.�.�z�8�D�O� �O����C��(�(��L�L���-�t�/?�/?��K��1�H�C��C��(�(�
�,�,�v�u�b�1����L�L��$�"2�"2�I�>� �*�*�:�6�����C��(�(��L�L���-�t�/?�/?��K��1�H�C��C��(�(�
 �*�*�:�7J�K��!�	:�B��L�L��T�-�-�y�9�	:� �*�*�:�7J�K��!�	:�B��L�L��T�-�-�y�9�	:�.�����)�)�+�c�1�����3��(8�(8�)�D�����Q�;�"�-�-�/�M�(�
G���h�&��L�L��$�*:�*:�I�F�
G�
$�	O�E��:�U�B���&�&�1�1�3�c�9��!&���3��0@�0@�)�!L�����Q�;��H�H�?D�f�M�O�
	O��T�!��C�$�/�/��X�F����,�-�-����-�c�2�!�-�-�y�:��q�����,�-�-�
�C� %� 0� 0�� >����-�.�.����.� �"�#'�#3�#3�Y�@��q�����-�.�.�

�L�L��4�#3�#3�Y�?��!�%�
�5�L��L�L��t�'7�'7��C����4�5���U
2s�&(ac�p�d}d}tj|j�\}}|�r|tk(r�t	j
d|zgd�d�\}}|sy|dk(rtjd�n�|dk(r�t	jd	|zd
�\}}|sy|rt|jj�d|zz}	tj|	|j�\}
}|
dk7r,tjd
�ntjd�n&tj|j�\}}|r��|rd}||fS)NFz�A package manager '%s' appears to be running. Please quit the package manager and press enter to continue (i=ignore, r=retry*, f=force, q=quit) :)r�r<�qrDr<)TTr�zCIgnoring running package manager. Some package operations may fail.rDz#
Force quit of package manager '%s'r�zkill %srzBFailed to kill process. You may need to manually quit the program.�GUI is not yet supportedT)
rrdr^r�rrr>r��enter_yes_nor�rRrir})rO�MODEr)r*rurvr"�
user_input�ansrZrwrxs            r
rz"CoreInstall.close_package_managers�sP���	�"���*�*�4�+<�+<�=���W���'�'�!$�!1�!1�h�kr�r�tH�JM�"N���J��%���$��H�H�]�_����$�!�.�.�>��H�#�O�G�B���)��"�.�.�9�9�;�y�3��O��).���3��8H�8H�)I����!�Q�;��I�I� d�f��	�	�4�5�� �.�.�t�/@�/@�A�L�C��3�6�!%���,�,�,rc	�l�d}|tk(�r|r|sytjd|zddgd�\}}|r�|dk(r�tjdd�}|ry|�d|�dt
j��}|jj�|z}tjd|z�tj||j�\}	}
|	d	k(rXd}|Stjd
�|Stjtjd|�dt
j�d
���|Stjd�|S)NFz;Do you want to add missing groups %s to user?(y=yes*, n=no)r�r��usermodTr�z	cmd =  %srzusermod command not found.zPlease add z groups to z userr=)r�rrrr�rr�usernamer�rRr>r?rir}rC�bold)rO�missing_user_groups�missing_user_groups_cmdr��ret_valr"r@�usermod_pathrZr%r&s           r
�add_groups_to_userzCoreInstall.add_groups_to_user�s&�����#�#�&�.E�� �-�-�M�Pc�c�fi�kn�eo�qt�v�N�B�
��j�C�'�$�{�{�9�d�;���$�&=�t�}�}�N�C��*�*�5�5�7�#�=�C��I�I�k�C�/�0�$�y�y��d�.>�.>�?�H�C���a�x�"&�����I�I�:�;���������#6��
�
�#G�H�I�
��
�I�I�0�1��rc��d}d}|tk(�r,tjdddgd�\}}|�r|dk7�rtjj|�stjd|z�y|jj�d|zz}tjd|z�tj||j�\}}|d	k(rd
}tjjd�rLd}|jj�|z}tjd|z�tj|�|Stjd
�|S)NFz/etc/selinux/configzxSELinux is currently enabled in your system. Device may not work properly. Do you want to disable SELinux?(y=yes, n=no*)r�r�zFile %s is not foundz#vi -c %s/enforcing$/disabled -c wq zcmd= %s rTz/selinux/enforcezecho 0 >/selinux/enforcer=)r�rrr�rDrPr>r?r�rRrrir�executer})	rOr�rH�SELinux_filer"r@rZr%r&s	         r
�disable_SELinuxzCoreInstall.disable_SELinux�s?����,���#�#� �-�-�K�NQ�SV�MW�Y\�]�N�B�
��j�C�'��w�w�~�~�l�3��I�I�4�|�C�D� ��&�&�1�1�3�9�L�H�J���	�	�*�s�*�+� �9�9�S�$�*:�*:�;���S��!�8�"�G��7�7�>�>�"4�5�4�C��*�*�5�5�7�#�=�C��I�I�j�3�.�/��$�$�S�)���
�I�I�0�1��rc�x�|jd�}|jd�}i}t|�r'|D]"}|rtj|�||<�|||<�$t|�r'|D]"}|rtj|�||<�|||<�$t|�dk(r$t|�dk(rtjd�yy)Nr_rarzNo missing dependencies)rgr�rr�r>rC)	rOr��required_dependencies�optional_dependencies�missing_cmdr_ra�overall_install_cmdsr�s	         r
�install_missing_dependenciesz(CoreInstall.install_missing_dependencies	s����2�2�3D�E���1�1�2B�C��!���$�%�'<�
C�#�"�/4�y�y��/I�)�+�-�0C�)�+�-�
C��$�%�'<�
C�#�"�/4�y�y��/I�)�+�-�0C�)�+�-�
C��#�$��)�c�+�.>�!�.C��H�H�.�/��rr)rV)NN)er@rN�__qualname__rnr�rTryr�rcr�rarbr�rMr�r�rr�r�rr�r�r�rr�rr0r�r*rrrr
r�r"r&r r$r=r,rr(rrr�r�r�rhr�r.rr	rr3r6r9r8r]r;rcrir`rlr�r�rgr�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�r�rrr	r�rr:rrJrNrTr�rr
rPrP�sE��*�4D�!�D=�L[�z-�,� �36�j>9�@5�,f!�V
�
�!�Q�1��"+�0�@�A�C�K��"7��$�c�.�6�)�	�	�	�	�
����2�U�A��;�5�/�1�d�A�
C�
�	�	�	��.,�\
�
�:�$T�LJ�X@�D&D�P��
�"�!'�F[����
^�
y��.��
��(�(�&�"�2����(:��"� �"��8J��.��w�B+;�"-�ZUe��F$4��<1A�XZ�rt�CE�rrP)mr~r��os.pathr?rp�grp�pwd�tarfilerSrrrr�r�base.g�
base.codesrrrrrr�dcheckr�r�rn�
MODE_CHECK�MODE_CREATE_DOCSr�r�r�r�r�r�r�r�r�r�rrrrrrrr �OK_PROCESS_LIST�CONFIGURE_ERRORSr�r�r�r4r9r�r�r�r�r�r�r�r�r�rrrrr
rrrrrrrrrrr!r#r%r'r)r+r-�PIP_STR�TESS_STR�
TESSEROCR_STR�IMUTILS_STR�
OPENCV_STR�ZBAR_STR�	LEPTO_STR�
PYPDF2_STRr/r2r5r7r:r<r�r�r�APPARMOR_DIR�SELINUX_DIRr`�	functoolsr9rH�objectrPr�rr
�<module>rms��.�	��	��
�
����
&��+���9�9��������
�
�����
�	�
�	�������"#������
�:�D��:�D��(�$��
/���
3�D�	�

3�D��
8��
�
3�D��
.�t��
-�d��
.�t��
-�d��
6�t��
;�D��
;�D��
>�t�� 
"�4�!��(
C�	�
�	�N��\�
�w�
�@�
�A��)�*����
�A�.���)���-���-���0�	�
�/���0�
��.���*���(���0���7���+���.���3���,�� �/�!�"�*�#��*��
�
�
�
�	����#��;��/��J��:��
0��C��
1�
�	N��
 ��7��$��:��9�	�4�
�&��
:�
�M��
8�
����	�
B�
�X�	�4��
@��4��
@��
5�
�"�	�
6�
�
Y��
-��5��X�
�F��
1�
�*��6�	�
.�
�4�
����� �	�#��	��
 ����
�	� ��4��%�(I�Ko�'p�q�#�&]�%^�_���
'�(�'�E!�&�E!��C�&��&�&��Z�
�	�
�s#�F�6F�F�F�F)�(F)

Zerion Mini Shell 1.0