?PNG  IHDR ? f ??C1 sRGB ?? gAMA ? a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
)Lc@sdZdefdYZdefdYZdefdYZddkZeid joeeinddkZddkZddk Z ddk Z ddk Z ddk Z ddk Z ddkZddkZddkZdd klZdd klZlZddkZddkZddkZddkZddkZddkZddkZydd klZWnej onXd ZdZ e!Z"e#a$e%a&e%a'dZ(e(dei)fdYZ*dei+fdYZ,dZ-e-Z.dfdYZ/x*dddfD]Z0e/e0e1e0Z?e?e2i3defd?YZRd@fdAYZSdBfdCYZTeTaUdDeTfdEYZVdFZWdGZXeYdHjo eXndS(IsW pyinotify @author: Sebastien Martini @license: MIT License @contact: seb@dbzteam.org tPyinotifyErrorcBseZdZRS(s1Indicates exceptions raised by a Pyinotify class.(t__name__t __module__t__doc__(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRstUnsupportedPythonVersionErrorcBseZdZdZRS(s0 Raised on unsupported Python versions. cCsti|d|dS(sV @param version: Current Python version @type version: string s6Python %s is unsupported, requires at least Python 2.4N(Rt__init__(tselftversion((s-/usr/lib/python2.6/site-packages/pyinotify.pyR(s (RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR$stUnsupportedLibcVersionErrorcBseZdZdZRS(s\ Raised when libc couldn't be loaded or when inotify functions werent provided. cCsd}ti||dS(Ns.libc does not provide required inotify support(RR(Rterr((s-/usr/lib/python2.6/site-packages/pyinotify.pyR7s(RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR2siNs2.4(tdeque(tdatetimet timedelta(treduces#seb@dbzteam.org (Sebastien Martini)s0.9.1cCsd}ytiid}Wnttfj onXtiddjo<tiddjo(ti|dt a d}|a nti|a da t t d  p"t t d  pt t d  o t ndS( Ntciiiit use_errnocSs*ti}dti|ti|fS(Ns Errno=%s (%s)(tctypest get_errnotoststrerrorterrnot errorcode(tcode((s-/usr/lib/python2.6/site-packages/pyinotify.pyt _strerrnoys cSsdS(t((((s-/usr/lib/python2.6/site-packages/pyinotify.pytst inotify_inittinotify_add_watchtinotify_rm_watch(tNoneRtutilt find_librarytOSErrortIOErrortsyst version_infotCDLLtTruetLIBCtstrerrnothasattrR(tlibcR((s-/usr/lib/python2.6/site-packages/pyinotify.pyt load_libcms(   tPyinotifyLoggercBseZdZdddZRS(s< Pyinotify logger used for logging unicode strings. c Cst||||||||} | dj oWxT| D]H} | djp| | ijotd| n| | | i| (R]Ri(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyt__repr__s( RRRR^RRiRntpropertyRfRo(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRXs     R[RYRZt EventsCodescBseZdZhh dd6dd6dd6dd6d d 6d d 6d d6dd6dd6dd6dd6dd6d6hdd6dd6dd6d 6hd!d"6d#d$6d%d&6d'd(6d)d*6d+6Zd,ZeeZRS(-s Set of codes corresponding to each kind of events. Some of these flags are used to communicate with inotify, whereas the others are sent to userspace by inotify notifying some events. @cvar IN_ACCESS: File was accessed. @type IN_ACCESS: int @cvar IN_MODIFY: File was modified. @type IN_MODIFY: int @cvar IN_ATTRIB: Metadata changed. @type IN_ATTRIB: int @cvar IN_CLOSE_WRITE: Writtable file was closed. @type IN_CLOSE_WRITE: int @cvar IN_CLOSE_NOWRITE: Unwrittable file closed. @type IN_CLOSE_NOWRITE: int @cvar IN_OPEN: File was opened. @type IN_OPEN: int @cvar IN_MOVED_FROM: File was moved from X. @type IN_MOVED_FROM: int @cvar IN_MOVED_TO: File was moved to Y. @type IN_MOVED_TO: int @cvar IN_CREATE: Subfile was created. @type IN_CREATE: int @cvar IN_DELETE: Subfile was deleted. @type IN_DELETE: int @cvar IN_DELETE_SELF: Self (watched item itself) was deleted. @type IN_DELETE_SELF: int @cvar IN_MOVE_SELF: Self (watched item itself) was moved. @type IN_MOVE_SELF: int @cvar IN_UNMOUNT: Backing fs was unmounted. @type IN_UNMOUNT: int @cvar IN_Q_OVERFLOW: Event queued overflowed. @type IN_Q_OVERFLOW: int @cvar IN_IGNORED: File was ignored. @type IN_IGNORED: int @cvar IN_ONLYDIR: only watch the path if it is a directory (new in kernel 2.6.15). @type IN_ONLYDIR: int @cvar IN_DONT_FOLLOW: don't follow a symlink (new in kernel 2.6.15). IN_ONLYDIR we can make sure that we don't watch the target of symlinks. @type IN_DONT_FOLLOW: int @cvar IN_MASK_ADD: add to the mask of an already existing watch (new in kernel 2.6.14). @type IN_MASK_ADD: int @cvar IN_ISDIR: Event occurred against dir. @type IN_ISDIR: int @cvar IN_ONESHOT: Only send event once. @type IN_ONESHOT: int @cvar ALL_EVENTS: Alias for considering all of the events. @type ALL_EVENTS: int it IN_ACCESSit IN_MODIFYit IN_ATTRIBitIN_CLOSE_WRITEitIN_CLOSE_NOWRITEi tIN_OPENi@t IN_MOVED_FROMit IN_MOVED_TOit IN_CREATEit IN_DELETEitIN_DELETE_SELFit IN_MOVE_SELFtOP_FLAGSi t IN_UNMOUNTi@t IN_Q_OVERFLOWit IN_IGNOREDt EVENT_FLAGSit IN_ONLYDIRitIN_DONT_FOLLOWi t IN_MASK_ADDi@tIN_ISDIRlt IN_ONESHOTt SPECIAL_FLAGScCs:|}d}|t@o|t}d}n|ti|S(s> Returns the event name associated to mask. IN_ISDIR is appended to the result when appropriate. Note: only one event is returned, because only one event can be raised at a given time. @param mask: mask. @type mask: int @return: event name. @rtype: str s%ss %s|IN_ISDIR(RRqt ALL_VALUES(tmasktmsR1((s-/usr/lib/python2.6/site-packages/pyinotify.pytmasknamefs    (RRRtFLAG_COLLECTIONSRt staticmethod(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRqs44   cCs||BS(((txty((s-/usr/lib/python2.6/site-packages/pyinotify.pyRst ALL_EVENTSt_EventcBs)eZdZdZdZdZRS(sw Event structure, represent events raised by the system. This is the base class and should be subclassed. cCs(x!|iD]}t||q WdS(s Attach attributes (contained in dict_) to self. @param dict_: Set of attributes. @type dict_: dictionary N(titemstsetattr(Rtdict_ttpl((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs cCsd}xt|iiddD]\}}|idoq%n|djott||}n#t|to| o d}n|dti |ti dti |f7}q%Wd ti d ti |i i|ti d f}|S( sS @return: Generic event string representation. @rtype: str RR;cSs|dS(i((R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRst_Rs''s %s%s%st=s %s%s%s %st(tsortedR/Rt startswiththextgetattrRBt basestringt output_formatt field_namet punctuationt field_valuet class_namet __class__R(RRFtattrRf((s-/usr/lib/python2.6/site-packages/pyinotify.pyRos"    cCs t|S(N(trepr(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyt__str__s(RRRRRoR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs t _RawEventcBs eZdZdZdZRS(sm Raw event, it contains only the informations provided by the system. It doesn't infer anything. cCs[d|_h|d6|d6|d6|idd6}ti||tit|dS(s @param wd: Watch Descriptor. @type wd: int @param mask: Bitmask of events. @type mask: int @param cookie: Cookie. @type cookie: int @param name: Basename of the file or directory against which the event was raised in case where the watched directory is the parent directory. None if the event was raised on the watched item itself. @type name: string or None twdRtcookietR1N(Rt_strtrstripRRRUtdebugRC(RRRRR1td((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs  cCs-|idjoti||_n|iS(N(RRRR(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs(RRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs tEventcBseZdZdZRS(s This class contains all the useful informations about the observed event. However, the presence of each field is not guaranteed and depends on the type of event. In effect, some fields are irrelevant for some kind of event (for example 'cookie' is meaningless for IN_CREATE whereas it is mandatory for IN_MOVE_TO). The possible fields are: - wd (int): Watch Descriptor. - mask (int): Mask. - maskname (str): Readable event name. - path (str): path of the file or directory being watched. - name (str): Basename of the file or directory against which the event was raised in case where the watched directory is the parent directory. None if the event was raised on the watched item itself. This field is always provided even if the string is ''. - pathname (str): Concatenation of 'path' and 'name'. - src_pathname (str): Only present for IN_MOVED_TO events and only in the case where IN_MOVED_FROM events are watched too. Holds the source pathname from where pathname was moved from. - cookie (int): Cookie. - dir (bool): True if the event was raised against a directory. cCsti||ti|i|_to|i|_nyT|io.ti i ti i |i |i|_ nti i |i |_ Wn"t j o}ti|nXdS(sH Concretely, this is the raw event plus inferred infos. N(RRRqRRtCOMPATIBILITY_MODEt event_nameR1RtpathtabspathtjoinR?tAttributeErrorRUR(RtrawR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs (RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRstProcessEventErrorcBseZdZdZRS(sD ProcessEventError Exception. Raised on ProcessEvent error. cCsti||dS(sT @param err: Exception error description. @type err: string N(RR(RR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs(RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRst _ProcessEventcBs eZdZdZdZRS(s* Abstract processing event class. cCs|i|it@}tii|}|djotd|nt|d|d}|dj o ||St|d|iddd}|dj o ||S|i |S(s To behave like a functor the object must be callable. This method is a dispatch method. Its lookup order is: 1. process_MASKNAME method 2. process_FAMILY_NAME method 3. otherwise calls process_default @param event: Event to be processed. @type event: Event object @return: By convention when used from the ProcessEvent class: - Returning False or None (default value) means keep on executing next chained functors (see chain.py example). - Returning True instead means do not execute next processing functions. @rtype: bool @raise ProcessEventError: Event object undispatchable, unknown event. sUnknown mask 0x%08xtprocess_t process_IN_RiN( RRRqRtgetRRRtsplittprocess_default(Rteventt stripped_maskRtmeth((s-/usr/lib/python2.6/site-packages/pyinotify.pyt__call__ s   #  cCsd|iiS(Ns<%s>(RR(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRoCs(RRRRRo(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs #t_SysProcessEventcBsbeZdZdZdZdZdZdZdZdZ dZ d d Z RS( s There is three kind of processing according to each event: 1. special handling (deletion from internal container, bug, ...). 2. default treatment: which is applied to the majority of events. 3. IN_ISDIR is never sent alone, he is piggybacked with a standard event, he is not processed as the others events, instead, its value is captured and appropriately aggregated to dst event. cCs(||_||_h|_h|_dS(s @param wm: Watch Manager. @type wm: WatchManager instance @param notifier: Notifier. @type notifier: Notifier instance N(t_watch_managert _notifiert _mv_cookiet_mv(Rtwmtnotifier((s-/usr/lib/python2.6/site-packages/pyinotify.pyRQs   cCsti}xv|i|igD]b}xY|iD]K}|||dtddjo#tid||d||=q2q2WqWdS(sh Cleanup (delete) old (>1mn) records contained in self._mv_cookie and self._mv. itminutessCleanup: deleting entry %siN(R tnowRRtkeysR RUR(Rt date_cur_tseqtk((s-/usr/lib/python2.6/site-packages/pyinotify.pytcleanup^s  "c Csb|it@oG|ii|i}tii|i|i}|i o |i | o|ii }|||id|i dt d|i d|i }|i|}|dj o|djoxti|D]t}tii||}tii|oF|ii|djo-t|ttBd|} |ii| qqWqQqUn|i|S(s If the event affects a directory and the auto_add flag of the targetted watch is set to True, a new watch is added on this new directory, with the same attribute values than those of this watch. tproc_funtrectauto_addtexclude_filteriN(RRRt get_watchRRRRR1RRt add_watchRtFalseRRtlistdirtisdirtget_wdRRzRt append_eventR( Rt raw_eventtwatch_t created_dirtaddwtaddw_rettcreated_dir_wdR1tinnertrawevent((s-/usr/lib/python2.6/site-packages/pyinotify.pytprocess_IN_CREATEjs*    $cCsx|ii|i}|i}tiitii||i}|ti f|i |i <|i |h|i d6S(sL Map the cookie with the source path (+ date for cleaning). R( RRRRRtnormpathRR1R RRRR(RRRtpath_tsrc_path((s-/usr/lib/python2.6/site-packages/pyinotify.pytprocess_IN_MOVED_FROMs  $c Cs|ii|i}|i}tiitii||i}|ii |i }h|i d6}|dj o/|t i f|i|d<|d|ds cCs|iS(N(R(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyt nested_peventJscCstiddS(s By default this method only reports warning messages, you can overredide it by subclassing ProcessEvent and implement your own process_IN_Q_OVERFLOW method. The actions you can take on receiving this event is either to update the variable max_queued_events in order to handle more simultaneous events or to modify your code in order to accomplish a better filtering diminishing the number of raised events. Because this method is defined, IN_Q_OVERFLOW will never get transmitted as arguments to process_default calls. @param event: IN_Q_OVERFLOW event. @type event: dict sEvent queue overflowed.N(RUtwarning(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRMscCsdS(se Default processing event method. By default does nothing. Subclass ProcessEvent and redefine this method in order to modify its behavior. @param event: Event to be processed. Can be of any type of events but IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW). @type event: Event instance N((RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyR]s N( RRRRRRRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR s    tPrintAllEventscBs#eZdZddZdZRS(s Dummy class used to print events strings representations. For instance this class is used from command line to print all received events to stdout. cCs'|djo ti}n||_dS(s~ @param out: Where events will be written. @type out: Object providing a valid file object interface. N(RR"tstdoutt_out(Rtout((s-/usr/lib/python2.6/site-packages/pyinotify.pyRns  cCs7|iit||iid|iidS(s$ Writes event string representation to file object provided to my_init(). @param event: Event to be processed. Can be of any type of events but IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW). @type event: Event instance s N(R twriteRCtflush(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRws N(RRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR is t ChainIfTruecBs eZdZdZdZRS(sc Makes conditional chaining depending on the result of the nested processing instance. cCs ||_dS(sJ Method automatically called from base class constructor. N(t_func(RR8((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCs|i| S(N(R(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs(RRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs tStatscBsGeZdZdZdZdZdZdZddZRS(sH Compute and display trivial statistics about processed events. cCs+ti|_h|_ti|_dS(sJ Method automatically called from base class constructor. N(ttimet _start_timet_statst threadingtLockt _stats_lock(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs cCso|iizM|iid}x4|D],}|ii|d}|d|i|(RtintRRRCRRtappendRRRRRRR(Rtstatstelapsedt elapsed_strtltevRfRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRos(       cCsZtitiBtiBtiB}ti||d}ti|t|ti|dS(s Dumps statistics. @param filename: filename where stats will be dumped, filename is created and must not exist prior to this call. @type filename: string iN( RtO_WRONLYtO_CREATt O_NOFOLLOWtO_EXCLtopenRRCtclose(Rtfilenametflagstfd((s-/usr/lib/python2.6/site-packages/pyinotify.pytdumpsi-cs|i}|pdSt|i}t||dttid|dfd}dit|t |i dd}|S( NRs%%-26s%%-%ds%%st@icsMti|dtidt|dtid|ddfS(NiR3is%dtyellow(RRRR"tsimple(R(tfmttunity(s-/usr/lib/python2.6/site-packages/pyinotify.pyR8ss R;cSs|dS(i((R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs( RtmaxRtfloatRRRRtmapRR(RtscaleR$RKR8RF((R7R6s-/usr/lib/python2.6/site-packages/pyinotify.pyRs -( RRRRRRRoR2R(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs    t NotifierErrorcBseZdZdZRS(s8 Notifier Exception. Raised on Notifier error. cCsti||dS(sW @param err: Exception string's description. @type err: string N(RR(RR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs(RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR<stNotifiercBseZdZd ddd dZdZdZedZd dZ dZ dZ d e i e i e i d Zd Zd ed Zd ZRS(s. Read notifications, process events. icCs||_|ii|_ti|_|ii|itid|_t |_ t |i||_ ||_ |djot|_ n||_||_||_t|_t|_dS(s Initialization. read_freq, threshold and timeout parameters are used when looping. @param watch_manager: Watch Manager. @type watch_manager: WatchManager instance @param default_proc_fun: Default processing method. If None, a new instance of PrintAllEvents will be assigned. @type default_proc_fun: instance of ProcessEvent @param read_freq: if read_freq == 0, events are read asap, if read_freq is > 0, this thread sleeps max(0, read_freq - timeout) seconds. But if timeout is None it may be different because poll is blocking waiting for something to read. @type read_freq: int @param threshold: File descriptor will be read only if the accumulated size to read becomes >= threshold. If != 0, you likely want to use it in combination with an appropriate value for read_freq because without that you would keep looping without really reading anything and that until the amount of events to read is >= threshold. At least with read_freq set you might sleep. @type threshold: int @param timeout: http://docs.python.org/lib/poll-objects.html#poll-objects @type timeout: int iN(ii(Rtget_fdt_fdtselecttpollt_pollobjtregistertPOLLINt_pipeR t_eventqRt _sys_proc_funt_default_proc_funRR t _read_freqt _thresholdt_timeoutRt _coalescetsett _eventset(Rt watch_managertdefault_proc_funt read_freqt thresholdttimeout((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs         cCs|ii|dS(s Append a raw event to the event queue. @param event: An event. @type event: _RawEvent instance. N(RFR#(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyR2scCs|iS(N(RH(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR;scCs%||_|p|iindS(s Coalescing events. Events are usually processed by batchs, their size depend on various factors. Thus, before processing them, events received from inotify are aggregated in a fifo queue. If this coalescing option is enabled events are filtered based on their unicity, only unique events are enqueued, doublons are discarded. An event is unique when the combination of its fields (wd, mask, cookie, name) is unique among events of a same batch. After a batch of events is processed any events is accepted again. By default this option is disabled, you have to explictly call this function to turn it on. @param coalesce: Optional new coalescing value. True by default. @type coalesce: Bool N(RLRNtclear(Rtcoalesce((s-/usr/lib/python2.6/site-packages/pyinotify.pytcoalesce_events>s cCsxvtony0|djo |i}n|ii|}Wn6tij o'}|dtijoqqtqXPqW| p|i d|ddjot S|ddti @S(s4 Check for new events available to read, blocks up to timeout milliseconds. @param timeout: If specified it overrides the corresponding instance attribute _timeout. @type timeout: int @return: New events to read. @rtype: bool iiN( R%RRKRBRAR@RRtEINTRRERRD(RRStretR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyt check_eventsQs   $c Cstiddg}ti|iti|ddjodS|d}||ijo!tid|i||idSyt i |i|}Wn!t j o}t |nXtid|d}x||jod}t id ||||!\}}} } t id | |||||| !\} t||| | } |ioDt| } | |ijo$|ii| |ii| qn|ii| ||| 7}qWdS( sN Read events from device, build _RawEvents, and enqueue them. tiiiiNsF(fd: %d) %d bytes available to read but threshold is fixed to %d bytessEvent queue size: %ditiIIIs%ds(tarraytfcntltioctlR?ttermiostFIONREADRJRURRtreadt ExceptionR<tstructtunpackRRLRCRNtaddRFR#(Rtbuf_t queue_sizetrR5trsumts_sizeRRRt fname_lentfnameRt raweventstr((s-/usr/lib/python2.6/site-packages/pyinotify.pyt read_eventsps<%          cCsx|io|ii}|ii|i}|djotidt|qn|i |}|o|i o|i |q|i |qW|i i |i o|iindS(s Routine for processing events from queue by calling their associated proccessing method (an instance of ProcessEvent). It also does internal processings, to keep the system updated. s0Unable to retrieve Watch object associated to %sN(RFtpopleftRRRRRUR RRGRRHRRLRNRT(RRRtrevent((s-/usr/lib/python2.6/site-packages/pyinotify.pytprocess_eventss      c s1d joCd}tiitidpd}tii||dntjo-tiiod}t |nfd}|tjozti ti Bti Bti B} ti| d} ti| ttidti| tifd nd S( s pid_file: file where the pid will be written. If pid_file=None the pid is written to /var/run/.pid, if pid_file=False no pid_file is written. stdin, stdout, stderr: files associated to common streams. s /var/run/iRMs.pids-Cannot daemonize: pid file %s already exists.csti}|djoRtiti}|djotidtidqxtidntidtiti}ti|dtiti ti Bd}ti|dtiti ti Bd}ti|ddS(Nit/iiii( Rtforktsetsidtchdirtumaskt_exitR-tO_RDONLYtdup2R)R*(tpidtfd_inptfd_outtfd_err(R tstdintstderr(s-/usr/lib/python2.6/site-packages/pyinotify.pyt fork_daemons       is cs tiS((Rtunlink((tpid_file(s-/usr/lib/python2.6/site-packages/pyinotify.pyRsN(RRRtbasenameR"targvRRtlexistsR<R)R*R+R,R-RRCtgetpidR.tatexitRC( RRR~R RtdirnameRR RR0tfd_pid((R R~RRs-/usr/lib/python2.6/site-packages/pyinotify.pyt __daemonizes       cCsc|idjoOti}|i||}|djo!tid|ti|q_ndS(NisNow sleeping %d seconds(RIRRURtsleep(Rtref_timetcur_timet sleep_amount((s-/usr/lib/python2.6/site-packages/pyinotify.pyt_sleeps   cKs|o|i|nxyg|i|dj o||tjoPnti}|io|i||inWqtj ot i dPqXq|i dS(s< Events are read only one time every min(read_freq, timeout) seconds at best and only if the size to read is >= threshold. After this method returns it must not be called again for the same instance. @param callback: Functor called after each event processing iteration. Expects to receive the notifier object (self) as first parameter. If this function returns True the loop is immediately terminated otherwise the loop method keeps looping. @type callback: callable object or function @param daemonize: This thread is daemonized if set to True. @type daemonize: boolean @param args: Optional and relevant only if daemonize is True. Remaining keyworded arguments are directly passed to daemonize see __daemonize() method. If pid_file=None or is set to a pathname the caller must ensure the file does not exist before this method is called otherwise an exception pyinotify.NotifierError will be raised. If pid_file=False it is still daemonized but the pid is not written in any file. @type args: various sPyinotify stops monitoring.N( t_Notifier__daemonizeRqRR%RRYRRntKeyboardInterruptRURtstop(Rtcallbackt daemonizeR6R((s-/usr/lib/python2.6/site-packages/pyinotify.pytloops       cCs'|ii|iti|idS(s Close inotify's instance (close its file descriptor). It destroys all existing watches, pending events,... This method is automatically called at the end of loop(). N(RBt unregisterR?RR.(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR#sN(RRRRRRRR%RVRYRnRqRtdevnullRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR=s6    ) 7 /tThreadedNotifiercBs>eZdZdddddZdZdZdZRS(sv This notifier inherits from threading.Thread for instanciating a separate thread, and also inherits from Notifier, because it is a threaded notifier. Note that every functionality provided by this class is also provided through Notifier class. Moreover Notifier should be considered first because it is not threaded and could be easily daemonized. icCsktii|ti|_ti||||||ti|_|i i |idt i dS(s Initialization, initialize base classes. read_freq, threshold and timeout parameters are used when looping. @param watch_manager: Watch Manager. @type watch_manager: WatchManager instance @param default_proc_fun: Default processing method. See base class. @type default_proc_fun: instance of ProcessEvent @param read_freq: if read_freq == 0, events are read asap, if read_freq is > 0, this thread sleeps max(0, read_freq - timeout) seconds. @type read_freq: int @param threshold: File descriptor will be read only if the accumulated size to read becomes >= threshold. If != 0, you likely want to use it in combination with an appropriate value set for read_freq because without that you would keep looping without really reading anything and that until the amount of events to read is >= threshold. At least with read_freq you might sleep. @type threshold: int @param timeout: see http://docs.python.org/lib/poll-objects.html#poll-objects @type timeout: int iN( RtThreadRRt _stop_eventR=RtpipeRERBRCR@RD(RRORPRQRRRS((s-/usr/lib/python2.6/site-packages/pyinotify.pyR6s  cCs|iiti|iddtii|ti ||i i |idti |idti |iddS(sK Stop notifier's loop. Stop notification. Join the thread. iRiN( RRMRRRERRRR=RRBRR.(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR[s  cCsZxS|iipB|iti}|io|i||iqqWdS(s Thread's main loop. Don't meant to be called by user directly. Call inherited start() method instead. Events are read only once time every min(read_freq, timeout) seconds at best and only if the size of events to read is >= threshold. N(RtisSetRqRRYRRn(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRgs     cCs|idS(s  Start thread's loop: read and process events until the method stop() is called. Never call this method directly, instead call the start() method inherited from threading.Thread, which then will call run() in its turn. N(R(R((s-/usr/lib/python2.6/site-packages/pyinotify.pytrunzsN(RRRRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR-s $ t AsyncNotifiercBs/eZdZddddddZdZRS(s This notifier inherits from asyncore.file_dispatcher in order to be able to use pyinotify along with the asyncore framework. icCs9ti||||||tii||i|dS(s Initializes the async notifier. The only additional parameter is 'channel_map' which is the optional asyncore private map. See Notifier class for the meaning of the others parameters. N(R=Rtasyncoretfile_dispatcherR?(RRORPRQRRRSt channel_map((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs cCs|i|idS(s When asyncore tells us we can read from the fd, we proceed processing events. This method can be overridden for handling a notification differently. N(RnRq(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyt handle_reads N(RRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs tWatchcBs eZdZdZdZRS(sE Represent a watch, i.e. a file or directory being watched. cCsR||_||_||_||_||_||_tii|i|_dS(s Initializations. @param wd: Watch descriptor. @type wd: int @param path: Path of the file or directory being watched. @type path: str @param mask: Mask. @type mask: int @param proc_fun: Processing callable object. @type proc_fun: @param auto_add: Automatically add watches on new directories. @type auto_add: bool @param exclude_filter: Boolean function, used to exclude new directories from being automatically watched. See WatchManager.__init__ @type exclude_filter: callable object N( RRRRRRRRR(RRRRRRR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs      c Csdig}|iD]R}|idp<|dti|tidtit||fqq~}dtidti|i i |tidf}|S(sE @return: String representation. @rtype: str t Rs%s%s%sRs %s%s %s %sRR( RR/RRRRRRRRR(RRJRRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRos e(RRRRRo(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs t ExcludeFiltercBs2eZdZdZdZdZdZRS(s/ ExcludeFilter is an exclusion filter. cCst|to|i|}n!t|to |}ntg|_x-|D]%}|iiti|ti qSWdS(s Examples: ef1 = ExcludeFilter(["^/etc/rc.*", "^/etc/hostname"]) ef2 = ExcludeFilter("/my/path/exclude.lst") Where exclude.lst contains: ^/etc/rc.* ^/etc/hostname @param arg_lst: is either a list of patterns or a filename from which patterns will be loaded. @type arg_lst: list of str or str N( RBRCt_load_patterns_from_filetlistt TypeErrort_lregexR#tretcompiletUNICODE(Rtarg_lsttlsttregex((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs   cCszg}t|d}zSxL|iD]>}|i}| p|idoq%n|i|q%WWd|iX|S(NRht#(tfilet readlineststripRR#R.(RR/Rtfile_objtlinetpattern((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs   cCs|i|dj S(N(tmatchR(RRR((s-/usr/lib/python2.6/site-packages/pyinotify.pyt_matchscCs0x)|iD]}|i||otSq WtS(s @param path: Path to match against provided regexps. @type path: str @return: Return True if path has been matched and should be excluded, False otherwise. @rtype: bool (RRR%R(RRR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs   (RRRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs    tWatchManagerErrorcBseZdZdZRS(sY WatchManager Exception. Raised on error encountered on watches operations. cCs||_ti||dS(s @param msg: Exception string's description. @type msg: string @param wmd: This dictionary contains the wd assigned to paths of the same call for which watches were successfully added. @type wmd: dict N(twmdRbR(RR5R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs (RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRst WatchManagercBseZdZddZdZdZdZdZedZ dZ d Z d Z deeeedd Zd Zddeeed ZdZdZdZdZeedZdZRS(s Provide operations for watching files and directories. Its internal dictionary is used to reference watched items. When used inside threaded code, one must instanciate as many WatchManager instances as there are ThreadedNotifier instances. cCstS((R(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR)scCsR||_h|_ti|_|idjodt}t|ndS(s Initialization: init inotify, init watch manager dictionary. Raise OSError if initialization fails. @param exclude_filter: boolean function, returns True if current path must be excluded from being watched. Convenient for providing a common exclusion filter for every call to add_watch. @type exclude_filter: callable object is+Cannot initialize new instance of inotify%sN(t_exclude_filtert_wmdR&RR?R'R (RRR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyR)s   cCsti|idS(s Close inotify's file descriptor, this action will also automatically remove (i.e. stop watching) all its associated watch descriptors. After a call to this method the WatchManager's instance become useless and cannot be reused, a new instance must then be instanciated. It makes sense to call this method in few situations for instance if several independant WatchManager must be instanciated or if all watches must be removed and no other watches need to be added. N(RR.R?(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR.;s cCs|iS(ss Return assigned inotify's file descriptor. @return: File descriptor. @rtype: int (R?(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyR>GscCs|ii|S(sz Get watch from provided watch descriptor wd. @param wd: Watch descriptor. @type wd: int (RR(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRPscCs=y|i|=Wn(tj o}tit|nXdS(s Remove watch entry associated to watch descriptor wd. @param wd: Watch descriptor. @type wd: int N(RR0RURRC(RRR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyRYscCs|iS(s Get a reference on the internal watch manager dictionary. @return: Internal watch manager dictionary. @rtype: dict (R(R((s-/usr/lib/python2.6/site-packages/pyinotify.pyRescCs9t|to|iti}ntii|S(sW Format path to its internal (stored in watch manager) representation. (RBRDtencodeR"RERRR(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyt __format_pathos c Cs|i|}ti|iti||}|djo|Std|d|d|d|d|d|}||i|RRRpRRRRRRR%RRRRRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyR!s,     Q # F  *tRawOutputFormatcBsGeZdZddZdZdZdZdZdZ RS(s( Format string representations. cCs|ph|_dS(N(tformat(RR((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCsJt|tpt|}n|ii|d||iiddS(NRtnormal(RBRCRR(RRFt attribute((s-/usr/lib/python2.6/site-packages/pyinotify.pyR5scCs|i|dS(sPunctuation color.R(R5(RRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCs|i|dS(sField value color.tpurple(R5(RRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCs|i|dS(sField name color.tblue(R5(RRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCs#|iidd|i|dS(sClass name color.tredRtbold(RRR5(RRF((s-/usr/lib/python2.6/site-packages/pyinotify.pyRsN( RRRRRR5RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs     tColoredOutputFormatcBseZdZdZRS(s0 Format colored string representations. cCsnh dd6dd6dd6dd6d d 6d d 6d d6dd6dd6dd6dd6dd6}ti||dS(NsRstblacksRstgreensR4sRsRstcyansRstulinestblinkstinvert(RR(Rtf((s-/usr/lib/python2.6/site-packages/pyinotify.pyRs  (RRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyRscCsYttdtx<tD]1}|idott|t|qqWtadS(s Use this function to turn on the compatibility mode. The compatibility mode is used to improve compatibility with Pyinotify 0.7.1 (or older) programs. The compatibility mode provides additional variables 'is_dir', 'event_name', 'EventsCodes.IN_*' and 'EventsCodes.ALL_EVENTS' as Pyinotify 0.7.1 provided. Do not call this function from new programs!! Especially if there are developped for Pyinotify >= 0.8.x. RtIN_N(RRqRtglobalsRR%R(tevname((s-/usr/lib/python2.6/site-packages/pyinotify.pytcompatibility_modes  c Csddkl}d}|d|}|iddddd d d d |id dddd dd d|iddddd dd d|iddddd dd d|iddddd dd d|idd ddd d!d d"|id#d$ddd d%d d&|i\}}|iotid'n|io tGHn|i p t a nt |d(jo d)}n|}t }|iot|d*td+d,}nt|d*t}d-}|iob|iid.} xS| D]A} tii| d-} | o|| O}q|id/| qWnt}d4} |iod0} | } ntid1||i||d2|id|i|id3| d4S(5s By default the watched path is '/tmp' and all types of events are monitored. Events monitoring serves forever, type c^c to stop it. i(t OptionParsers.usage: %prog [options] [path1] [path2] [pathn]tusages-vs --verbosetactiont store_truetdesttverbosethelps Verbose modes-rs --recursivet recursives Add watches recursively on pathss-as --auto_addRs,Automatically add watches on new directoriess-es --events-listtmetavars EVENT[,...]t events_listspA comma-separated list of events to watch for - see the documentation for valid options (defaults to everything)s-ss--statsR$sDisplay dummy statisticss-Vs --versionRsPyinotify versions-fs --raw-formatt raw_formatsDisable enhanced output format.i is/tmpRPRQiit,s4The event '%s' specified with option -e is not validcSsitiit|itiidtiit|itiidtiidS(Ns (R"R RRRRCR(RF((s-/usr/lib/python2.6/site-packages/pyinotify.pytcbns s2Start monitoring %s, (press c^c to halt pyinotify)RRN(toptparseRt add_optiont parse_argsRRURTRt __version__R RRRRR$R=RR R RRqt ALL_FLAGSRRRRRRRRR(RRtparsertoptionsR6RRRRR R(tevcodetcb_funR ((s-/usr/lib/python2.6/site-packages/pyinotify.pyt command_line$sl               "t__main__(ZRRbRRRR"RRRR@RcR]RR_R\R=Rt collectionsR R R RtfnmatchRRt ctypes.utilRRt functoolsR t ImportErrort __author__Rttypet __metaclass__RRRR&R'R*tLoggerR+R>R.RWRURXR`RRqRRRRtflagctvalcRRR1tvalR~RRRRRRRRRR RRR<R=RRRRRRRRRRRRRR(((s-/usr/lib/python2.6/site-packages/pyinotify.pyts                   $ >n       +$. +]U 8X2;   Y