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/logging.pyc
mò
ÊEc@sÆdZdZdkZdkZdkZdkZdklZdkZdfd„ƒYZdfd„ƒYZ	dfd	„ƒYZ
d
e
fd„ƒYZe
dd
eƒZ
dkZd„Zee_dS(s„
Logging facilities

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(sconfigt	TimeStampcBs8tZdZd„Zdd„Zed„Zd„ZRS(s8
    Generates timestamps tempfiles and log entries
    cCsd|_tiƒ|_dS(Nt0(tselftnowttimet	localtimettimetup(R((t3/usr/lib/python2.4/site-packages/dogtail/logging.pyt__init__s	icCsE|d|jo&d|tt|ƒƒt|ƒSnt|ƒSdS(s¸
        Pads an integer 'int' with zeroes, up to width 'width'.

        Returns a string.

        It will not truncate. If you call zeroPad(100, 2), '100' will be returned.
        i
RN(tinttwidthtlentstr(RR	R
((RtzeroPads&cCsœ|iƒd|_tiƒ|_d}|o|d}nxUt	|ƒD]G}|djo|id|_n|i|i|i|ƒ|_qJW|iS(s°
        Generates a filename stamp in the format of filename_YYYYMMDD-hhmmss.
        A format of filename_YYYYMMDD can be used instead by specifying addTime = False.
        t_it-N(tfilenametstripRRRRRt
fieldCounttaddTimetrangetiR
(RRRRR((Rt	fileStamp*s

$cCsütiƒ|_xãtdƒD]Õ}|djot|i|ƒ|_q|djp
|djo(|id|i|i|ƒ|_q|i|}|djo(|id|i|i|ƒ|_q|id|i|i|ƒ|_qW|iS(
sH
        Generates a logfile entry stamp of YYYY.MM.DD HH:MM:SS
        iiiit.it t:N(
RRRRRRRRR
tx(RRR((Rt
entryStamp<s

(

(((t__name__t
__module__t__doc__RR
tTrueRR(((RRs
	t
IconLoggercBs/tZdZeZd„Zd„Zd„ZRS(s[
    Writes entries to the tooltip of an icon in the notification area or the desktop.
    cCs’tip„dkl}|ƒt_tiio
t|_n
t|_d}d|}t
ii|ƒotii
|ƒn|idƒndS(N(sTrayIconsdogtail-tail-48.pngs$/usr/share/icons/hicolor/48x48/apps/sdogtail running...(R ttrayicontTrayIcontprocRRtworkstFalseticonNameticonPathtostpathtexiststset_icontmessage(RR&R"R'((RRYs



	
cCstii|ƒdS(s/
        Display a message to the user
        N(R R!tset_tooltiptmsg(RR.((RR,escCstiiƒdS(N(R R!tclose(R((Rt__del__ks(RRRtNoneR!RR,R0(((RR Ts
		tLoggercBs5tZdZeZeƒZeed„Z	d„Z
RS(sJ
    Writes entries to standard out, and to an IconLogger if desired.
    cCsà||_||_||_|ipdSnti}tii|ƒpti	|ƒnti
}|p
d}n||_tii|ƒo¸||ii
|iƒd|i|_d}x•tii|iƒom|djo|idt|ƒ|_n5|iidƒ}t|ƒ|d<di|ƒ|_|d7}qÀWntd|‚yed	|iGHti|id
ddd
ƒ|_|iidtii|iƒdƒ|iiƒWntj
od|iGHnXdS(sÅ
        FIXME! make this log to a file based on the name arg.

        name: the name of the log

        file: The file object to log to.

        stdOut: Whether to log to standard out.
        NtlogRiRiÿÿÿÿis0Log path %s does not exist or is not a directorysCreating logfile at %s ...tmodetwbtencodingsutf-8s##### s
sCould not create and write to (tlogNameRtstdOuttfiletconfigtlogDirR(R)tisdirtmakedirst
scriptNametfileNametstamperRRR*RtsplittlogsplittjointIOErrortcodecstopentwritetbasenametflush(RR7R9R8RR>R;RB((RRts@				
		
	'

!'cCs­|iddƒ}|io!|iio|ii|ƒn|io	|GHn|ipdSny%|ii|dƒ|iiƒWnt	j
od|i
GHnXdS(s~
        Hook used for logging messages. Might eventually be a virtual
        function, but nice and simple for now.
        sutf-8treplaceNs
sCould not write to file (R,tdecodeRt
iconLoggerR$R8R9RGRIRDR?(RR,((RR3¦s
	
(RRRR1RLRR@R%RRR3(((RR2ns
	2t
ResultsLoggercBs#tZdZed„Zd„ZRS(s-
    Writes entries into the Dogtail log
    cCs ti|ddtd|ƒdS(NtresultsR9R8(R2RRRR8(RR8((RRÂscCst|ƒdjoJ|iƒ}|iƒ}|d}|d}t|ƒdt|ƒ}nt|‚dGHti	||iiƒd|ƒdS(s
        Writes the log entry. Requires a 1 {key: value} pair dict for an argument or else it will throw an exception.
        iis:      sVMethod argument requires a 1 {key: value} dict. Supplied argument not one {key: value}s      N(
RtentrytkeystkeytvaluestvalueRt
ValueErrorR2R3RR@R(RRORSRQ((RR3Çs

	(RRRRRR3(((RRM¾stdebugR9cCs?ti|||ƒ}di|ƒ}ti	|ƒt
iƒdS(Nt(t	tracebacktformat_exceptiontexcRSttbttbStringListRCttbStringtdebugLoggerR3tsyst	exc_clear(RYRSRZR[R\((Rt
exceptionHookÞs
(Rt
__author__R(R^RtdatetimeR:RERR R2RMRR]RWR`t
excepthook(RMR]RRWR:RERbR^RR2RaR(R R`((Rt?s				
	@P		

Anon7 - 2021