| Home | Trees | Index | Help |
|---|
| Package Yab :: Module Util :: Class File |
|
This class is used to store information about a file or directory on the file system.
They are stored out to the cache, so *never* store transient information on them without clearing it through clear_transient.
Never construct these with File(). Use get_file_info, parse_file, or parse_files instead. That guarantees that there is only one File instance for each file in the filesystem.| Method Summary | |
|---|---|
Normpath *must* be absolute and have been returned from os.path.normpath. | |
__repr__(self)
| |
Return the name of the file as a relative path from the current working directory. | |
Clear any transient attributes that were saved to the cache | |
Return the File object that represents the directory that this File resides in. | |
extract_uncommon_components(self,
files)
| |
Does the file contain the regexp 'contains'. | |
Flush the cache used in mtime() | |
Given an include path (as a tuple of Files), return the Files that this file includes. | |
Get the java package for the file. | |
Return the files modification time. | |
Return the pathname for the file as a relative path from 'path' | |
Remove the file from the filesystem | |
Sets the value that is retrieved by get_includes. | |
Set the java package for this file. | |
Return a File object that represents the given sub-directory of this one. | |
| Method Details |
|---|
__init__(self,
normpath)
Normpath *must* be absolute and have been returned from
os.path.normpath.
|
__str__(self)
Return the name of the file as a relative path from the current
working directory. Will also quote the filename if it has spaces in
it.
|
clear_transient(self)Clear any transient attributes that were saved to the cache |
dirname(self)Return the File object that represents the directory that this File resides in. |
file_contains(self, contains, compiled_contains)Does the file contain the regexp 'contains'. 'compiled_contains' *must* be re.compile(contains). |
flush_mtime(self)Flush the cache used in mtime() |
get_includes(self, include_path)Given an include path (as a tuple of Files), return the Files that this file includes. If this was never set with set_includes(), or the file has changed on disk, raise KeyError |
get_java_package(self)Get the java package for the file. Returns None if the package was never set with set_java_package, or the file has changed since the last call to set_java_package. |
mtime(self)Return the files modification time. Stored in a cache for speed. If you modify the file, you are responsible for calling flush_mtime to flush this cache. |
relative_to(self, file)Return the pathname for the file as a relative path from 'path' |
remove(self)Remove the file from the filesystem |
set_includes(self, include_path, includes)Sets the value that is retrieved by get_includes. |
set_java_package(self, package)Set the java package for this file. |
subdir(self, name)Return a File object that represents the given sub-directory of this one. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.0 on Fri Aug 15 16:30:52 2003 | http://epydoc.sf.net |