Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults ListLoad Str Num body Expr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assert Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assert Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num NameLoad body Expr Str While Num body Expr Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Return Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareIn SubscriptLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Slice Num AttributeLoad NameLoad attr Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad NameLoad Str handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return ListLoad orelse Raise orelse Assign NameStore Num Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore Str Assign NameStore NameLoad While UnaryOpNot NameLoad body Assign NameStore BinOpMult NameLoad NameLoad If CompareGtE Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Num Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If CompareGtE Call AttributeLoad NameLoad attr Str NameLoad body Break orelse AugAssignSub NameStore Num Return SubscriptLoad Call AttributeLoad NameLoad attr Slice UnaryOpUSub NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body For NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults AttributeLoad NameLoad attr body Expr Str For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise orelse If UnaryOpNot Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Continue Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Raise orelse If CompareNotEq NameLoad Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list If CompareEq NameLoad Str body FunctionDef arguments args NameParam NameParam defaults body For NameStore NameLoad body Print BinOpMod Str NameLoad Print NameLoad decorator_list Assign NameStore ListLoad Str Str Str Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr
N/A N/A 
Real time log files watcher supporting log rotation.

Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
 N/A os N/A time N/A errno N/A stat N/A time N/A fnmatch LogWatcher N/A object N/A N/A Looks for changes in all files of a directory.
    This is useful for watching log file changes in real-time.
    It also supports files rotation.

    Example:

    >>> def callback(filename, lines):
    ...     print filename, lines
    ...
    >>> l = LogWatcher("/var/log/", callback)
    >>> l.loop()
     __init__ N/A N/A self folder files callback extensions tail_lines N/A N/A log 0 N/A N/A Arguments:

        (str) @folder:
            the folder to watch

        (callable) @callback:
            a function which is called every time a new line in a 
            file being watched is found; 
            this is called with "filename" and "lines" arguments.

        (list) @extensions:
            only watch files with these extensions

        (int) @tail_lines:
            read last N lines from files being watched before starting
         N/A N/A self files_map N/A N/A N/A self callback callback N/A N/A self extensions extensions N/A N/A self filenames files N/A N/A self folder folder N/A N/A N/A N/A os path isdir N/A self folder N/A %s does not exists N/A self folder N/A N/A callable callback N/A N/A N/A self update_files N/A N/A id file N/A N/A N/A self files_map iteritems N/A N/A N/A N/A file seek N/A N/A N/A os path getsize N/A file name N/A tail_lines N/A N/A lines N/A N/A self tail N/A file name tail_lines N/A lines N/A N/A N/A N/A self callback N/A file name lines N/A __del__ N/A N/A self N/A N/A N/A N/A N/A self close N/A loop N/A N/A self interval async N/A 0.1 False N/A N/A Start the loop.
        If async is True make one loop then return.
         N/A 1 N/A N/A N/A N/A self update_files N/A N/A fid file N/A list N/A N/A N/A self files_map iteritems N/A N/A N/A N/A self readfile file N/A async N/A N/A N/A N/A N/A time sleep interval N/A log N/A N/A self line N/A N/A N/A Log when a file is un/watched N/A N/A listdir N/A N/A self N/A N/A N/A List directory and filter files by extension.
        You may want to override this to add extra logic or
        globbling support.
         N/A ls N/A N/A os listdir N/A self folder N/A N/A self extensions N/A N/A foo N/A x N/A x ls N/A N/A N/A N/A N/A N/A os path splitext x N/A 1 N/A 1 N/A self extensions N/A foo N/A N/A ls N/A tail N/A N/A fname window N/A N/A N/A Read last N lines from file fname. N/A N/A N/A f N/A open fname r N/A N/A N/A IOError N/A err N/A N/A N/A N/A err errno N/A errno ENOENT N/A N/A N/A N/A N/A N/A N/A BUFSIZ 1024 N/A N/A N/A f seek 0 N/A os SEEK_END N/A fsize N/A N/A f tell N/A block -1 N/A data N/A exit False N/A N/A exit N/A N/A step N/A block BUFSIZ N/A N/A N/A abs step fsize N/A N/A N/A N/A f seek 0 N/A exit True N/A N/A N/A N/A f seek step N/A os SEEK_END N/A data N/A N/A N/A N/A f read strip N/A N/A N/A N/A data count window N/A N/A N/A N/A block 1 N/A N/A N/A N/A data splitlines N/A N/A window N/A staticmethod search_files N/A N/A self N/A N/A N/A files N/A N/A f N/A self filenames N/A N/A result N/A N/A self locate f N/A self folder N/A N/A N/A N/A files append result N/A files N/A locate N/A N/A self pattern root N/A N/A os curdir N/A N/A Locate all files matching supplied filename pattern in and below
	supplied root directory. N/A N/A path dirs files N/A N/A os walk N/A N/A N/A os path abspath root N/A N/A filename N/A N/A fnmatch filter files pattern N/A N/A N/A N/A N/A N/A os path join path filename N/A update_files N/A N/A self N/A N/A N/A ls N/A N/A name N/A N/A self search_files N/A N/A absname name N/A N/A N/A st N/A N/A os stat absname N/A N/A N/A EnvironmentError N/A err N/A N/A N/A N/A err errno N/A errno ENOENT N/A N/A N/A N/A N/A N/A N/A stat S_ISREG N/A st st_mode N/A N/A N/A fid N/A N/A self get_file_id st N/A N/A N/A ls append N/A fid absname N/A N/A fid file N/A list N/A N/A N/A self files_map iteritems N/A N/A N/A N/A st N/A N/A os stat N/A file name N/A N/A N/A EnvironmentError N/A err N/A N/A N/A N/A err errno N/A errno ENOENT N/A N/A N/A N/A self unwatch file fid N/A N/A N/A N/A N/A fid N/A N/A self get_file_id st N/A N/A N/A N/A self unwatch file fid N/A N/A N/A self watch N/A file name N/A N/A fid fname ls N/A N/A N/A fid N/A self files_map N/A N/A N/A N/A self watch fname N/A readfile N/A N/A self file N/A N/A N/A lines N/A N/A file readlines N/A lines N/A N/A N/A N/A self callback N/A file name lines N/A watch N/A N/A self fname N/A N/A N/A N/A N/A file N/A open fname r N/A fid N/A N/A self get_file_id N/A N/A os stat fname N/A N/A N/A EnvironmentError N/A err N/A N/A N/A N/A err errno N/A errno ENOENT N/A N/A N/A N/A N/A N/A self log N/A watching logfile %s fname N/A N/A N/A self files_map N/A fid file N/A unwatch N/A N/A self file fid N/A N/A N/A lines N/A N/A self readfile file N/A N/A N/A self log N/A un-watching logfile %s N/A file name N/A N/A N/A self files_map N/A fid N/A lines N/A N/A N/A N/A self callback N/A file name lines N/A get_file_id N/A N/A st N/A N/A N/A N/A %xg%x N/A N/A st st_dev N/A st st_ino N/A staticmethod close N/A N/A self N/A N/A N/A N/A id file N/A N/A N/A self files_map iteritems N/A N/A N/A N/A file close N/A N/A N/A N/A self files_map clear N/A N/A N/A N/A __name__ __main__ N/A callback N/A N/A filename lines N/A N/A N/A line lines N/A N/A N/A %s changed! filename N/A line N/A N/A files N/A squid_logs.txt probe_data.txt coords.txt dhcpd.leases N/A searchdir /home/stawk/uploads/ N/A l N/A LogWatcher searchdir files callback N/A N/A N/A l loop