Package phones :: Module com_brew :: Class _DirCache
[hide private]
[frames] | no frames]

Class _DirCache

source code

This is a class that lets you do various filesystem manipulations and it remembers the data. Typical usage would be if you make changes to files (adding, removing, rewriting) and then have to keep checking if files exist, add sizes etc. This class saves the hassle of rereading the directory every single time. Note that it will only see changes you make via this class. If you go directly to the Brew class then those won't be seen.

Instance Methods [hide private]
 
__init__(self, target) source code
 
rmfile(self, filename) source code
 
stat(self, filename) source code
 
readfile(self, filename) source code
 
writefile(self, filename, contents) source code
 
_getdirectory(self, dirname, ensure=False) source code
Method Details [hide private]

__init__(self, target)
(Constructor)

source code 
Parameters:
  • target - where operations should be done after recording them here