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 | 821b048eb79ba07820f33b08aac0b7750d53ffcc (patch) | |
tree | 4fa63504f8e308a35a6b7ad5b54cf291affea95d /coverage/files.py | |
parent | 64c2017d91047c50b19f3c48ed02916cee144799 (diff) | |
download | python-coveragepy-821b048eb79ba07820f33b08aac0b7750d53ffcc.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 99db390..f3fafdf 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] |