KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/dogtail/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/dogtail/utils.pyc
m
X!Ec@sdZdZdkZdkZdklZdklZdklZ	dkl
Z
dklZde
d	Zeieided
dZddZd
fdYZdkZdkZeiZdZdZdZdZdZdZdS(s
Various utilities

Authors: Ed Rousseau <rousseau@redhat.com>, Zack Cerza <zcerza@redhat.com, David Malcolm <dmalcolm@redhat.com>
sfEd Rousseau <rousseau@redhat.com>,
Zack Cerza <zcerza@redhat.com,
David Malcolm <dmalcolm@redhat.com>
N(sconfig(ssleep(sdebugLogger(s	TimeStamp(sDependencyNotFoundErrorsscreenshot.pngcCst|tp
tdntiitipt	di
|iddd!}|iddi}|p|}d}n|o1t}|i|d|}ti|}
n|d|}ti|}
dk}dk}	|ii}|i}|ii|iitd|d	|d
}|iii |||i!dddd|d	|d
	|djo
d}ny|i"|
|Wn#|	i#j
ot$d
|nXtii%|
pt	t&i'd|
|
S(s}
    This function wraps the ImageMagick import command to take a screenshot.

    The file argument may be specified as 'foo', 'foo.png', or using any other
    extension that ImageMagick supports. PNG is the default.

    By default, screenshot filenames are in the format of foo_YYYYMMDD-hhmmss.png .
    The timeStamp argument may be set to False to name the file foo.png.
    s timeStampt must be True or Falsett.iitpngNiiitjpgtjpegs&Failed to save screenshot in %s formatsScreenshot taken: ((t
isinstancet	timeStamptboolt	TypeErrortostpathtisdirtconfigt
scratchDirtAssertionErrortjointfiletsplittbaseNametlowertfileExtt	TimeStampttst	fileStamptnewFiletgtk.gdktgtktgobjecttgdktget_default_root_windowt
rootWindowtget_geometrytgeometrytPixbuftCOLORSPACE_RGBtFalsetpixbuftget_from_drawabletget_colormaptsavetGErrort
ValueErrortexiststloggertlog(RRRR RRR$RRRR
R((t1/usr/lib/python2.4/site-packages/dogtail/utils.pyt
screenshots@	

	
		
'

RcCsadkl}
l}l}|pdkl}n|i}|d}d|
d<|||||
}	|p|d}n|ot|nd}x||jo||}yx|idddD]i}|i
|joSxP|iD]A}|idjo+d	kl}
||
i_t||	SqqWqqWWntj
onXt|qW|	S(
s(
    Runs an application. [For simple command execution such as 'rm *', use os.popen() or os.system()]
    If dumb is omitted or is False, polls at interval seconds until the application is finished starting, or until timeout is reached.
    If dumb is True, returns when timeout is reached.
    (senvironsspawnvpesP_NOWAIT(srootisgail:atk-bridgetGTK_MODULESNitframe(sfocus(R	tenvirontspawnvpetP_NOWAITtdesktopttreetroottstringRtargstnametpidtappNametdumbtdoDelayttimeoutttimetintervaltchildrentchildt
grandchildtroleNamet
proceduraltfocustapplicationtnodetAttributeError(R7R>R@R4R<R;RCRBR8R:RFR3R?R1R2R9((R-trunCs>






cCsG|djo
ti}ntiotid|nt|dS(s`
    Utility function to insert a delay (with logging and a configurable
    default delay)
    ssleeping for %fN(tdelaytNoneRtdefaultDelayt
debugSleepR+R,tsleep(RK((R-R=is


tBlinkercBs#tZdZddZdZRS(NiicCshdk}dk}||_||_||_||_||_|i	t
i|i|_
|idS(N(RRRtcounttselftxtytwthttimeout_addRPtINTERVAL_MStblinkDrawRectanglettimeout_handler_idtmain(RRRSRTRURVRQRR((R-t__init__ws							cCsdk}|ii}|i}|i}|i	}|i|ii|i
|ii|id|ii|ii|ii|i|t|i|i|i|i|id8_|idjo|itSntS(Niii(RRRtdisplay_get_defaulttdisplaytget_default_screentscreentget_root_windowRtnew_gctgct
set_subwindowtINCLUDE_INFERIORStset_functiontINVERTtset_line_attributest
LINE_SOLIDtCAP_BUTTt
JOIN_MITERtdraw_rectangleR#RRRSRTRURVRQt	main_quittTrue(RRR`RR^RcR((R-RYs	((
(t__name__t
__module__RXR\RY(((R-RPtss&/desktop/gnome/interface/accessibilitycCs
titS(s7
    Checks if accessibility is enabled via gconf.
    N(tgconfClienttget_boolta11yGConfKey(((R-t
isA11yEnabledscCstidtiddS(NsJDogtail requires that Assistive Technology support be enabled. Aborting...i(R+R,tsystexit(((R-tbailBecauseA11yIsDisableds
cCstittS(s*
    Enables accessibility via gconf.
    N(Rqtset_boolRsRn(((R-t
enableA11yscCstptndS(sO
    Checks if accessibility is enabled, and halts execution if it is not.
    N(RtRw(((R-tcheckForA11ys
cCstodSndk}|idd|i|iB|i|id|if}di
}|i|i|i
|}|it|ii||i|i}||ijotidtn||ijotn|idS(s
    Checks if accessibility is enabled, and presents a dialog prompting the
    user if it should be enabled if it is not already, then halts execution.
    Ns$Enable Assistive Technology Support?t_EnablesDogtail requires that Assistive Technology Support be enabled for it to function. Would you like to enable Assistive Technology support now?

Note that you will have to log out for the change to fully take effect.
    sEnabling accessibility...(RtRtDialogRLtDIALOG_MODALtDIALOG_DESTROY_WITH_PARENTt
STOCK_QUITtRESPONSE_CLOSEtRESPONSE_ACCEPTtdialogtstriptquestiontset_default_responsetLabelt
questionLabelt
set_line_wrapRntvboxt
pack_starttshow_allRJtresultR+R,RyRwtdestroy(RRRRR((R-tcheckForA11yInteractivelys*
		



( t__doc__t
__author__R	treRR?ROtloggingtdebugLoggerR+RterrorstDependencyNotFoundErrorRnR.t
runTimeouttrunIntervalRLR#RJR=RPRutgconftclient_get_defaultRqRsRtRwRyRzR(RRzRtRqRORPRRwR+RRJR.RRRuRyRR=RRsR	((R-t?s*		




.&#						

Anon7 - 2021