403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/hplip/scan/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/hplip/scan/sane.pyc
Ńň
mďJc
@s]ddkZddkZddkZddkZddkZddkTddklZdZhdei	6dei
6dei6dei6d	ei
6d
ei6Zhdei6dei6d
ei6dei6dei6dei6dei6Zddd„ƒYZddd„ƒYZdeifd„ƒYZd„Zd„Zd„Zdd„Zd„Z dS( i˙˙˙˙N(t*(tutilsit	TYPE_BOOLtTYPE_INTt
TYPE_FIXEDtTYPE_STRINGtTYPE_BUTTONt
TYPE_GROUPt	UNIT_NONEt
UNIT_PIXELtUNIT_BITtUNIT_MMtUNIT_DPItUNIT_PERCENTtUNIT_MICROSECONDtOptioncBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sNClass representing a SANE option.
    Attributes:
    index -- number from 0 to n, giving the option number
    name -- a string uniquely identifying the option
    title -- single-line string containing a title for the option
    desc -- a long string describing the option; useful as a help message
    type -- type of this option.  Possible values: TYPE_BOOL,
            TYPE_INT, TYPE_STRING, and so forth.
    unit -- units of this option.  Possible values: UNIT_NONE,
            UNIT_PIXEL, etc.
    size -- size of the value in bytes
    cap -- capabilities available; CAP_EMULATED, CAP_SOFT_SELECT, etc.
    constraint -- constraint on values.  Possible values:
        None : No constraint
        (min,max,step)  Integer values, from min to max, stepping by
        list of integers or strings: only the listed values are allowed
    cCs‡ddk}||_|\	|_|_|_|_|_|_|_|_	|_
t|iƒtdƒjot|iƒ|_ndS(Ni˙˙˙˙t(tstringt
cur_devicetindextnamettitletdescttypetunittsizetcapt
constrainttstr(tselftargsRR((s/usr/share/hplip/scan/sane.pyt__init__hs
	<cCsti|iƒS(N(tscanexttisOptionActiveR(R((s/usr/share/hplip/scan/sane.pytisActiverscCsti|iƒS(N(R tisOptionSettableR(R((s/usr/share/hplip/scan/sane.pyt
isSettableuscCs˜|iƒo
d}nd}|iƒod}|ii|iƒ}n
d}d}d|i||i|i|it|i	t
|i|i||f
S(Ntyestnos <not available, inactive option>s‘
Name:      %s
Cur value: %s
Index:     %d
Title:     %s
Desc:      %s
Type:      %s
Unit:      %s
Constr:    %s
isActive:    %s
isSettable:  %s
(R$R"Rt	getOptionRRRRtTYPE_STRRtUNIT_STRRRts(RtsettabletactivetcurValue((s/usr/share/hplip/scan/sane.pyt__repr__xs


c	Cs×|dj	oą|idj	oĄt|iƒtdƒjoŞ||idjo4|id}tid|i|i||fƒnI||idjo4|id}tid|i|i||fƒn|ii|i|ƒqÓt|iƒtgƒjoť||ijo§|id}ti	}xB|iD]7}t
||ƒ|jot
||ƒ}|}q/q/Wtid|i|i|di|iƒ|fƒ|ii|i|ƒqşqÓn|ii|iƒ}|S(Nis6Invalid value for %s (%s < min value of %d). Using %d.is6Invalid value for %s (%s > max value of %d). Using %d.s?Invalid value for %s (%s not in constraint list: %s). Using %d.s, ((
tNoneRRtlogtwarnRRt	setOptiontsystmaxinttabstjoinR'(Rtvaluetvtmin_disttx((s/usr/share/hplip/scan/sane.pytlimitAndSet•s2
	
	
	
	)"(t__name__t
__module__t__doc__RR"R$R.R;(((s/usr/share/hplip/scan/sane.pyRUs	
			t
ScanDevicecBsžeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	dddd	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„ZRS(sClass representing a SANE device.
    Methods:
    startScan()    -- initiate a scan, using the current settings
    cancelScan()   -- cancel an in-progress scanning operation

    Also available, but rather low-level:
    getParameters() -- get the current parameter settings of the device
    getOptions()    -- return a list of tuples describing all the options.

    Attributes:
    optlist -- list of option names

    You can also access an option name to retrieve its value, and to
    set it.  For example, if one option has a .name attribute of
    imagemode, and scanner is a ScanDevice object, you can do:
         print scanner.imagemode
         scanner.imagemode = 'Full frame'
         scanner.['imagemode'] returns the corresponding Option object.
    cCs2d|_ti|ƒ|_h|_|iƒdS(N(R/tscan_threadR t
openDevicetdevtoptionst_ScanDevice__load_options_dict(RRB((s/usr/share/hplip/scan/sane.pyRçs		cCs`|i}|iiƒ}xA|D]9}t||ƒ}|itijo|||i<qqWdS(N(RCRBt
getOptionsRRR RR(Rtoptstopt_listttto((s/usr/share/hplip/scan/sane.pyt__load_options_dictîs	cCsO|i}||jo|||<dS||}|itijotid|ƒnti|iƒptid|ƒnti|iƒptid|ƒnt|ƒt	jo#|iti
jot|ƒ}ny|ii
|i|ƒ|_Wn-tij
otid||fƒnX|iti@o|iƒndS(NsGroups can't be set: %ssInactive option: %ss#Option can't be set by software: %ss#Unable to set option %s to value %s(RCRR RR0terrorR!RR#tintRtfloatRBR2Rtlast_opttINFO_RELOAD_OPTIONSRD(RtkeyR7RFtopt((s/usr/share/hplip/scan/sane.pyR2ůs&	


&cCsü|i}|djo|iƒS|djo'|d|df|d|dffS||jotd|‚n||}|itijotd|‚n|itijotd	|‚nti|iƒptd
|‚n|i	i
|iƒS(Ntoptlisttareastl-xstl-ysbr-xsbr-ysNo such attribute: %ssButtons don't have values: %ssGroups don't have values: %s sInactive option: %s(RCtkeystAttributeErrorRR RRR!RRBR'R(RRPRFRQ((s/usr/share/hplip/scan/sane.pyR's	

'

cCs#|i}||jo	||SdS(N(RC(RRPRF((s/usr/share/hplip/scan/sane.pytgetOptionObj3s	
cCs
|iiƒS(s?Return a 6-tuple holding all the current device settings:
           (format, format_name, last_frame, (pixels_per_line, lines), depth, bytes_per_line)

            - format is the SANE frame type
            - format is one of 'grey', 'color' (RGB), 'red', 'green', 'blue'.
            - last_frame [bool] indicates if this is the last frame of a multi frame image
            - (pixels_per_line, lines) specifies the size of the scanned image (x,y)
            - lines denotes the number of scanlines per frame
            - depth gives number of pixels per sample
        (RBt
getParameters(R((s/usr/share/hplip/scan/sane.pyRW9scCs
|iiƒS(s<Return a list of tuples describing all the available options(RBRE(R((s/usr/share/hplip/scan/sane.pyREGstBGRAcCsľ|iƒp”|iiƒ}|iiƒ\|_|_|_|_|_|_	|_
t|i|||ƒ|_t
|i_|iiƒt
|i|i
|fStdtifSdS(s]
            Perform a scan with the current device.
            Calls sane_start().
        iN(tisScanActiveRBt	startScanRWtformattformat_namet
last_frametpixels_per_linetlinestdepthtbytes_per_linet
ScanThreadR@tTruetscan_activetstarttFalseR tSANE_STATUS_DEVICE_BUSY(Rtbyte_formattupdate_queuetevent_queuetstatus((s/usr/share/hplip/scan/sane.pyRZLs
9
cCs
|iiƒS(s)Cancel an in-progress scanning operation.(RBt
cancelScan(R((s/usr/share/hplip/scan/sane.pyRl_sc	CsU|iƒpD|i}|i|i|i|i|i|i|i|i	|i
f	SdS(s6Get the output buffer and info about a completed scan.N(RYR@tbufferR[R\R^R_R`Rat	pad_bytest
total_read(RR*((s/usr/share/hplip/scan/sane.pytgetScands
	cCs[|iƒpJ|i}y!|iiƒti|iƒWqWttfj
oqWXndS(s-Cleanup the scan file after a completed scan.N(	RYR@Rmtclosetostremovetbuffer_pathtIOErrorRU(RR*((s/usr/share/hplip/scan/sane.pytfreeScanms
	
cCs3|idj	o|iiƒo
|iiStSdS(N(R@R/tisAliveRdRf(R((s/usr/share/hplip/scan/sane.pyRYyscCs\|idj	oH|iiƒo8|iio+y|iiƒWqXtj
oqXXndS(N(R@R/RwRdR6tKeyboardInterrupt(R((s/usr/share/hplip/scan/sane.pytwaitForScanDone€s
cCsctidƒ|idj	oBx?to3|iiƒo|iiodStidƒq WndS(Ngŕ?(ttimetsleepR@R/RcRwRd(R((s/usr/share/hplip/scan/sane.pytwaitForScanActive‹s

cCs|iiƒdS(s#Close the SANE device after a scan.N(RBt	closeScan(R((s/usr/share/hplip/scan/sane.pyR}sN(R<R=R>RRDR2R'RVRWRER/RZRlRpRvRYRyR|R}(((s/usr/share/hplip/scan/sane.pyR?Ňs 			 											RbcBs5eZdddd„Zd„Zd„Zd„ZRS(RXcCsČtii|ƒt|_||_||_||_ti	ddƒ\|_
|_ti
|i
dƒ|_d|_d|_d|_d|_d|_d|_d|_d|_d|_||_dS(Ntprefixthpscansw+bi˙˙˙˙Ri(t	threadingtThreadRRcRdRBRiRjRtmake_temp_filet	buffer_fdRtRrtfdopenRmR[R\R]R^R_R`RaRnRoRh(RtdeviceRhRiRj((s/usr/share/hplip/scan/sane.pyR¤s"													cCsm|idj	oYyt|ƒ}Wnttfj
o
d}nX|ii||fƒtidƒndS(Ni˙˙˙˙i(RiR/RLt
ValueErrort	TypeErrortputRzR{(RRkt
bytes_read((s/usr/share/hplip/scan/sane.pytupdateQueue¸sc	CsŁ|iiƒ\|_|_|_|_|_|_|_t	i
d|iƒt	i
d|iƒt	i
d|iƒt	i
d|iƒt	i
d|iƒt	i
d|iƒt	i
d|iƒt	i
d|iƒ|ii
}|itijoĐ|id	joź|id
|i|_t	i
d|iƒd}|id
jo
d}ny|ii|iƒ\}}Wn(tij
o}|i|dƒnXx$|tijo|o—d}xN|t|ƒ|ijo3||||d
|…ƒ|dƒ|d
7}qŔW|it|ƒ7_|i||iƒt	i
d|iƒntidƒy|ii|iƒ\}}Wn,tij
o}|i||iƒPnX|iƒoPq q Wqyn˛|itijož|idjoŐ|i|idd	|_t	i
d|iƒy|ii|iƒ\}}Wn(tij
o}|i|dƒnXx|tijoD|oĚd}xƒ|t|ƒ|ijohd}t||ƒ}xAtd	ƒD]3}||@o|dƒn|dƒ|d?}qÄW|d7}q‡W|it|ƒ7_|i||iƒt	i
d|iƒntidƒy|ii|iƒ\}}Wn,tij
o}|i||iƒPnX|iƒoPqgqgWqy|id	joĽ|i|i|_t	i
d|iƒy|ii|iƒ\}}Wn(tij
o}|i|dƒnXx1|tijo|o¤d}x[|t|ƒ|ijo@||}||ƒ||ƒ||ƒ|dƒ|d7}qdW|it|ƒ7_|i||iƒt	i
d|iƒntidƒy|ii|iƒ\}}Wn,tij
o}|i||iƒPnX|iƒoPqDqDWqyn|iidƒt|_t	i
dƒdS(Ns	format=%dsformat_name=%ss
last_frame=%dsppl=%dslines=%dsdepth=%dsbpl=%dsbyte_format=%siispad_bytes=%di˙˙˙˙tRGBAiis˙s
Read %d bytesgš™™™™™š?ii€t˙s˙˙˙˙sScan thread exiting...( RBRWR[R\R]R^R_R`RaR0tdebugRhRmtwriteR t	FRAME_RGBRntreadScanRKRŠtSANE_STATUS_GOODtlenRoRzR{tcheckCancelt
FRAME_GRAYtordtrangetseekRfRd(	RtwtdirtstRHRtktjtb((s/usr/share/hplip/scan/sane.pytrunĂsŘ9














	cCsƒt}xv|iiƒoeyG|iidƒ}|tjo$t}tidƒ|ii	ƒnWq	t
ij
oPq	Xq	W|S(NisCancel pressed!(RfRjtqsizetgettEVENT_SCAN_CANCELEDRcR0RRBRltQueuetEmpty(Rtcanceledtevent((s/usr/share/hplip/scan/sane.pyR“Us

N(R<R=R/RRŠRžR“(((s/usr/share/hplip/scan/sane.pyRbŁs		’cCs
tiƒS(N(R tinit(((s/usr/share/hplip/scan/sane.pyRŚfscCs
tiƒS(N(R tdeInit(((s/usr/share/hplip/scan/sane.pyR§jscCs
t|ƒS(sOpen a device for scanning(R?(RB((s/usr/share/hplip/scan/sane.pyRAnsicCs
ti|ƒS(N(R t
getDevices(t
local_only((s/usr/share/hplip/scan/sane.pyR¨sscCs$tidti|ƒ|fƒdS(NsSANE: %s (code=%d)(R0RKR tgetErrorMessage(tcode((s/usr/share/hplip/scan/sane.pytreportErrorws(((!R R€RzRrR˘tbase.gtbaseRRĄRRRRRRR(RR	R
RRR
RR)RR?RRbRŚR§RAR¨RŹ(((s/usr/share/hplip/scan/sane.pyt<module>:s2







}ŃĂ			

Youez - 2016 - github.com/yon3zu
LinuXploit