diff options
author | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2008-09-19 11:10:28 +0000 |
---|---|---|
committer | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2008-09-19 11:10:28 +0000 |
commit | 467fc6d66ed52def0d480b3c4fda29ebcc4bedab (patch) | |
tree | 7553cf4ce7390499f8b21ef75f315709965b7551 | |
parent | 0861f637ebbe4d6a2de39e6e032633f0d664899c (diff) | |
download | pyfilesystem-467fc6d66ed52def0d480b3c4fda29ebcc4bedab.tar.gz |
Some docstrings
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@81 67cdc799-7952-0410-af00-57a81ceafa0f
-rw-r--r-- | fs/fs.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -95,6 +95,13 @@ class SystemError(FSError): pass class ResourceInvalid(FSError): pass def silence_fserrors(f, *args, **kwargs): + """Perform a function call and return None if any FSError exceptions are thrown/ + + f -- Function to call + args -- Parameters to f + kwargs -- Keyword parameters to f + + """ try: return f(*args, **kwargs) except FSError: @@ -320,15 +327,41 @@ class FS(object): raise UnsupportedError("UNSUPPORTED") def makedir(self, path, mode=0777, recursive=False, allow_recreate=False): + """Make a directory on the file system. + + path -- Path of directory + mode -- Permissions + recursive -- If True, also create intermediate directories + allow_recreate -- If True, then re-creating a directory wont throw an exception + + """ + raise UnsupportedError("UNSUPPORTED") def remove(self, path): + """Remove a resource from the filesystem. + + path -- Path of the resource to remove + + """ raise UnsupportedError("UNSUPPORTED") def removedir(self, path, recursive=False): + """Remove a directory + + path -- Path of the directory to remove + recursive -- If True, then blank parent directories will be removed + + """ raise UnsupportedError("UNSUPPORTED") def rename(self, src, dst): + """Renames a file or directory + + src -- Path to rename + dst -- New name (not a path) + + """ raise UnsupportedError("UNSUPPORTED") def getinfo(self, path): |