Implement __dir__ in ObjectStore
parent
10246f0713
commit
4687f34d9d
|
@ -10,6 +10,14 @@ class DiscObjectStore:
|
|||
if not os.path.exists( self._path ):
|
||||
os.makedirs( self._path )
|
||||
|
||||
def __dir__(self):
|
||||
fl = os.listdir(self._path)
|
||||
l = []
|
||||
for f in fl:
|
||||
if not f.startswith("."):
|
||||
l.append(f)
|
||||
return l
|
||||
|
||||
def __contains__(self, name):
|
||||
return os.path.exists( "%s/%s" % (self._path, name))
|
||||
|
||||
|
|
Loading…
Reference in New Issue