3
NZ                 @   s  d Z dZdZdZddlZddlZddlZddlZddlT ddl	m
Z
mZmZmZ edd	d
fde ddd
fejdmdndodpdqdrdsdtduejejejejejejdvdwdxdydzgZyejeee eeefZejd(d)d*d+d,d-d.d/d0gdd1\ZZZZZZdZ d2Z!d3Z"g Z#dZ$d4Z%xeD ]\Z&Z'e&d{krryd7d8 e'j(d9D Z W n e)k
rR   d:gZ Y nX e
j*e sej+d;gd< q
e&d|kre'j, j- Z%e%d}krej+dAgd< ndBgZ q
e&d~krye.e'Z"W n$ e/k
r   d3Z"e0j1dE Y nX ne&dkrXy$e.e'Z!e!dIkre0j1dJ dIZ!W n$ e/k
r<   dKZ!e0j1dL Y nX e!dk rej+dMgd< nPe&dkrdPd8 e'j(d9D Z#e
j2e#sej+dQgd< ne&dkr
e'j, j- Z$q
W e dkrej3 Z e dkrej4d e0j5dUe d   e0j5d ej6dV xte D ]jZ7e7dBkr&e0j5e0j8dWe!  dddXdYdZd[d\Z9i Z:x:e#D ]2Z;e;e9krdej<dfe:e9e; < nej<dfe:e;< qBW e0j=e: e
j>e7ge!e"e:e$e%Z?e@  d\ZAZBZCZDe?r4xHe?D ]@ZEeFeGeEeAZAeFeGe?eE d eCZCeFeGe?eE d] eDZDqW e7dBkrejHeAd]d^eCd]d^eDd]d^fZIe0j5eIjJd e0j5eIjJdbeA dbeC dbeD f xe?D ],ZEe0j5eIjJeEe?eE d e?eE d] f q^W ne7dkrejHeAd]d^eCd]d^fZIe0j5eIjJd e0j5eIjJdbeA dbeC f x:e?D ]"ZEe0j5eIjJeEe?eE d f qW ne0jKdee7  e0j5dfeGe?e7f  n8e0jLdge7  e7dBkrbe0jLdh e0jLdi n
e0jLdj qW W n  eMk
r   e0jKdk Y nX e0j5d e0j5dl dS )z4.1hp-probezPrinter Discovery UtilityzFDiscover HPLIP supported USB, parallel, and network attached printers.    N)*)deviceutilstuimodule nameTzUsage: %s [OPTIONS]ZsummaryBus to probe:-b<bus> or --bus=<bus>optionFa<bus>: cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)Set Time to Live (TTL):&-t<ttl> or --ttl=<ttl> (Default is 4).Set timeout:4-o<timeout in secs.> or --timeout=<timeout is secs.>Filter by functionality:)-e<filter list> or --filter=<filter list>q<filter list>: comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)Search:%-s<search re> or --search=<search re>C<search re> must be a valid regular expression (not case sensitive)Network discovery method:>-m<method> or --method=<method>: <method> is 'slp'* or 'mdns'. Find all devices on the network:hp-probe -bnetexample.Find all devices on USB that support scanning:hp-probe -busb -escan`Find all networked devices that contain the name 'lnx' and that support photo cards or scanning:!hp-probe -bnet -slnx -escan,pcard4Find all devices that have queues installed in CUPS:hp-probe -bcups Find all devices on the USB bus:zb:t:o:e:s:m:zttl=zfilter=zsearch=zfind=zmethod=z	time-out=ztimeout=zbus=)Zhandle_device_printer
      slp-b--busc             C   s   g | ]}|j  j qS  )lowerstrip).0xr)   r)   /usr/share/hplip/probe.py
<listcomp>V   s    r/   ,usbzInvalid bus name)Z	error_msg-m--methodmdnsbonjourz>Invalid network search protocol name. Must be 'slp' or 'mdns'.Znet-t--ttlz.TTL value error. TTL set to default of 4 hops.-o	--timeout
--time-out-   z$Timeout > 45secs. Setting to 45secs.   z5Timeout value error. Timeout set to default of 5secs.z/You must specify a positive timeout in seconds.-e--filterc             C   s   g | ]}|j  j qS r)   )r+   r*   )r,   r-   r)   r)   r.   r/   z   s    zInvalid term in filter-s--search--findz
Using connection type: %szDEVICE DISCOVERYzPProbing network for printers. Please wait, this will take approx. %d seconds...
z	scan-typez	copy-typez
pcard-typezfax-type)printZnonescancopyZpcardZfax   )widthZmargin
Device URIModelName-parcupszInvalid bus: %sz&
Found %d printer(s) on the '%s' bus.
zMNo devices found on the '%s' bus. If this isn't the result you are expecting,z:check your network connections and make sure your internetzfirewall software is disabled.zFcheck to make sure your devices are properly connected and powered on.z	User exitzDone.)r
   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r   r   F)r   r    r   F)r!   r"   r   F)r#   r   r   F)r'   r(   )r2   r3   )r&   r4   r5   )r6   r7   )r8   r9   r:   )r=   r>   )r?   r@   rA   )r   r   r   r   )rG   rH   rI   )r1   rK   rL   )rG   rH   )N__version____mod__Z	__title____doc__sysZgetoptoperatorosZbase.gbaser   r   r   r   ZUSAGE_OPTIONSZUSAGE_LOGGING1ZUSAGE_LOGGING2ZUSAGE_LOGGING3Z
USAGE_HELPZUSAGE_SPACEZUSAGE_EXAMPLESZUSAGEZModuleZINTERACTIVE_MODEmodZparseStdOptsZoptsZ
device_uriZprinter_namemodeZ
ui_toolkitlocZbusZtimeoutZttlfiltersearchmethodoasplit	TypeErrorZvalidateBusListZusager*   r+   int
ValueErrorlogZnoteZvalidateFilterListZconnection_tableexitinfoheaderbZboldZ
FILTER_MAPZfilter_dictfgtdebugZprobeDevicesZdevicesZcleanup_spinnerZmax_c1Zmax_c2Zmax_c3Zmax_c4dmaxlenZTextFormatterZ	formatterZcomposeerrorwarnKeyboardInterruptr)   r)   r)   r.   <module>   s  























"
.

$


