diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-05-06 10:43:25 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-05-06 10:43:25 -0400 |
commit | 9a49b797a3832cb34d8aa490c62277821524c9ec (patch) | |
tree | 72cdb0361388de134129a00d3dda7ce9156621ea /coverage/files.py | |
parent | a5c57934960bd5e762b9a8138dc6c575a20d41fd (diff) | |
download | python-coveragepy-git-9a49b797a3832cb34d8aa490c62277821524c9ec.tar.gz |
Better docstrings.
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/coverage/files.py b/coverage/files.py index 99db390a..f3fafdfb 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -13,13 +13,15 @@ class FileLocator: self.canonical_filename_cache = {} def abs_file(self, filename): - """ Helper function to turn a filename into an absolute normalized - filename. - """ + """Return the absolute normalized form of `filename`.""" return os.path.normcase(os.path.abspath(os.path.realpath(filename))) def relative_filename(self, filename): - """ Convert filename to relative filename from self.relative_dir. + """Return the relative form of `filename`. + + The filename will be relative to the current directory when the + FileLocator was constructed. + """ return filename.replace(self.relative_dir, "") @@ -45,8 +47,11 @@ class FileLocator: return self.canonical_filename_cache[filename] def get_zip_data(self, filename): - """ Get data from `filename` if it is a zip file path, or return None - if it is not. + """Get data from `filename` if it is a zip file path. + + Returns the data read from the zip file, or None if no zip file could + be found or `filename` isn't in it. + """ import zipimport markers = ['.zip'+os.sep, '.egg'+os.sep] |