HWRF
trunk@4391
|
Imitates the shell "ls -l" program. More...
Imitates the shell "ls -l" program.
Imitate ls -l, but with a longer mtime string:
To include files whose names begin with "." add hidden=True:
To log messages related to failures of lstat and readlink, pass a logging.Logger:
Definition at line 9 of file listing.py.
Public Member Functions | |
def | __init__ |
Constructor for Listing: More... | |
def | __iter__ (self) |
Iterates over filenames in the listed directory. More... | |
def | iteritems (self) |
Iterates over name,data pairs in the listed directory. More... | |
def | iterkeys (self) |
Iterates over filenames in the listed directory. More... | |
def | list |
Updates the internal data structures with a new listing of the directory. More... | |
def | __str__ (self) |
Generates an ls -l style listing of the directory. More... | |
def produtil.listing.Listing.__init__ | ( | self, | |
path = "." , |
|||
hidden = False , |
|||
logger = None |
|||
) |
Constructor for Listing:
path | The directory path to list. |
hidden | If True, files with names beginning with "." are listed. |
logger | A logging.Logger for error messages. |
Definition at line 27 of file listing.py.
def produtil.listing.Listing.__iter__ | ( | self | ) |
Iterates over filenames in the listed directory.
Definition at line 35 of file listing.py.
def produtil.listing.Listing.__str__ | ( | self | ) |
Generates an ls -l style listing of the directory.
Definition at line 84 of file listing.py.
def produtil.listing.Listing.iteritems | ( | self | ) |
Iterates over name,data pairs in the listed directory.
The "data" will be a tuple containing the output of lstat and the output of readlink.
Definition at line 39 of file listing.py.
def produtil.listing.Listing.iterkeys | ( | self | ) |
Iterates over filenames in the listed directory.
Definition at line 45 of file listing.py.
def produtil.listing.Listing.list | ( | self, | |
hidden = False , |
|||
logger = None |
|||
) |
Updates the internal data structures with a new listing of the directory.
Arguments are the same as for the constructor.
hidden | If True, files with names beginning with "." are listed. |
logger | A logging.Logger for error messages. |
Definition at line 50 of file listing.py.
Referenced by produtil.listing.Listing.__init__(), and produtil.listing.Listing.__str__().