
    =	f                        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 ddl	m
Z
mZmZmZ edd	d
fdez  ddd
fej                  dddddddddej                  ej                   ej"                  ej$                  ej&                  ej(                  dddddgZ	  ej,                  eee eeef      Zej3                  dg dd      \  ZZZZZZdZ dZ!d Z"g Z#dZ$d!Z%eD ]  \  Z&Z'e&d"v rc	 e'jQ                  d#      D  cg c]   } | jS                         jU                         " c} Z  e
jX                  e       rZej[                  d%g&       ne&d'v r:e'jS                         jU                         Z%e%d(vrej[                  d)g&       d*gZ e&d+v r
	  e.e'      Z"e&d-v r;	  e.e'      Z!e!d.kD  re0jc                  d/       d.Z!e!dk  sej[                  d2g&       e&d3v rde'jQ                  d#      D  cg c]   } | jU                         jS                         " c} Z# e
jd                  e#      rLej[                  d4g&       ae&d5v sge'jS                         jU                         Z$ e M ejf                         Z e  ejh                  d       e0jk                  d6e d   z         e0jk                  d        ejl                  d7       e D ]  Z7e7d*k(  r#e0jk                  e0jq                  d8e!z               ddd9d:d;d<d=Z9i Z:e#D ],  Z;e;e9v rejx                  dfe:e9e;   <   ejx                  dfe:e;<   . e0j{                  e:        e
j|                  e7ge!e"e:e$e%      Z? e@        d>\  ZAZBZCZDe?re?D ];  ZE eF eGeE      eA      ZA eF eGe?eE   d         eC      ZC eF eGe?eE   d?         eD      ZD= e7d*k(  r ej                  eAd?d@eCd?d@eDd?d@f      ZIe0jk                  eIj                  dA             e0jk                  eIj                  dBeAz  dBeCz  dBeDz  f             e?D ]1  ZEe0jk                  eIj                  eEe?eE   d   e?eE   d?   f             3 ne7dCv r ej                  eAd?d@eCd?d@f      ZIe0jk                  eIj                  dD             e0jk                  eIj                  dBeAz  dBeCz  f             e?D ]*  ZEe0jk                  eIj                  eEe?eE   d   f             , ne0j                  dEe7z         e0jk                  dF eGe?      e7fz         Pe0j                  dGe7z         e7d*k(  r$e0j                  dH       e0j                  dI       e0j                  dJ        	 e0jk                  d       e0jk                  dL       yc c} w # e+$ r d$gZ Y yw xY w# e/$ r d Z"e0jc                  d,       Y w xY w# e/$ r d0Z!e0jc                  d1       Y w xY wc c} w # eM$ r e0j                  dK       Y w xY w)Mz4.1hp-probezPrinter Discovery UtilityzFDiscover HPLIP supported USB, parallel, and network attached printers.    N)*)deviceutilstuimodule nameTzUsage: %s [OPTIONS]summary)zBus to probe:z-b<bus> or --bus=<bus>optionF)r	   za<bus>: cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)r   F)zSet Time to Live (TTL):z&-t<ttl> or --ttl=<ttl> (Default is 4).r   F)zSet timeout:z4-o<timeout in secs.> or --timeout=<timeout is secs.>r   F)zFilter by functionality:z)-e<filter list> or --filter=<filter list>r   F)r	   zq<filter list>: comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)r   F)zSearch:z%-s<search re> or --search=<search re>r   F)r	   zC<search re> must be a valid regular expression (not case sensitive)r   F)zNetwork discovery method:z>-m<method> or --method=<method>: <method> is 'slp'* or 'mdns'.r   F)z Find all devices on the network:zhp-probe -bnetexampleF)z.Find all devices on USB that support scanning:zhp-probe -busb -escanr   F)z`Find all networked devices that contain the name 'lnx' and that support photo cards or scanning:z!hp-probe -bnet -slnx -escan,pcardr   F)z4Find all devices that have queues installed in CUPS:zhp-probe -bcupsr   F)z Find all devices on the USB bus:r   r   Fzb:t:o:e:s:m:)zttl=zfilter=zsearch=zfind=zmethod=z	time-out=ztimeout=zbus=F)handle_device_printer
      slp)z-bz--bus,usbzInvalid bus name)	error_msg)z-mz--method)r   mdnsbonjourz>Invalid network search protocol name. Must be 'slp' or 'mdns'.net)z-tz--ttlz.TTL value error. TTL set to default of 4 hops.)z-oz	--timeoutz
--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.)z-ez--filterzInvalid term in filter)z-sz--searchz--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)printnonescancopypcardfax)r   r   r   r      )widthmargin)
Device URIModelName-)r   parcups)r#   r$   z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.)N__version____mod__	__title____doc__sysgetoptoperatorosbase.gbaser   r   r   r   USAGE_OPTIONSUSAGE_LOGGING1USAGE_LOGGING2USAGE_LOGGING3
USAGE_HELPUSAGE_SPACEUSAGE_EXAMPLESUSAGEModuleINTERACTIVE_MODEmodparseStdOptsopts
device_uriprinter_namemode
ui_toolkitlocbustimeoutttlfiltersearchmethodoasplitlowerstrip	TypeErrorvalidateBusListusageint
ValueErrorlognotevalidateFilterListconnection_tableexitinfoheaderbbold
FILTER_MAPfilter_dictfgtdebugprobeDevicesdevicescleanup_spinnermax_c1max_c2max_c3max_c4dmaxlenTextFormatter	formattercomposeerrorwarnKeyboardInterrupt)xs   0/usr/share/hplip/probe.py<module>ru      s  0 
'	
R    	  + + 2vt	$
'
)2y$	?				E 
E	_	b	c 
U	N	e	y			u33U5I5I										Q	f 
e	f	K)	2U
&--K%)+-C 	F05 	 	7 :D*lD*c CG	CFFF ,'123''#,?Qqwwy(? *6))#.		%7$8	9$$WWY__&F77		%e$f	gg/!K!f
 33Ra&R<HHCD G
 {		%V$W	X$$12>Aaggioo'>F,6,,V4		%=$>	?..WWY__&FY,'\ {"c""$;CHHQK.Q78CJJ!" Gc:HHSXXqt{{|} $#))+'
  	2AJ.6kk1-=JqM*"*++q!1A		2 			+%&%%qc7CffU)3& 9SVV,SA/8SA/89
 Ez/E//*0Q ?*0Q ?*0Q ?	 **+JKL**CJF
CJ+OPQ  SAHHY..71:a='!*Q-/PQRS ,,/E//*0Q ?*0Q ?	 **+BCD**CJF
+CDE  DAHHY..71:a=/ABCD 		+a/0HH?3w<QRBSST HHdghhiEzUV9:abOGcX   I @ g"  KIJK  RPQR ?x  IIks   AW $V7%VVW 2AW 	VW  V;7W =+W (%WW $W ?L%W VVW VW V84W 7V88W ;WW WW W87W8