created cybertools.storage

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1396 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-10-08 22:56:51 +00:00
parent c810ab11af
commit d21b4a8f80
2 changed files with 3 additions and 4 deletions

View file

@ -9,8 +9,8 @@ Controlling the storage of data
>>> directory = os.path.dirname(storage.__file__)
>>> from cybertools.storage.filesystem import explicitDirectoryStorage
>>> storage = explicitDirectoryStorage(os.path.sep.join((directory, 'testdata')))
>>> storage = explicitDirectoryStorage(os.path.join(directory, 'testdata'))
>>> storage.getDir('demo')
'/.../cybertools/storage/testdata/demo'
'/home/.../cybertools/storage/testdata/demo'

View file

@ -39,8 +39,7 @@ class FileSystemStorage(object):
def getDir(self, address, subDir=None):
subDir = subDir or self.subDir
paths = [p for p in (self.rootDir, subDir, address) if p]
return os.path.sep.join(paths)
return os.path.join(self.rootDir, subDir, address)
def setData(self, address, data, params={}):
subDir = params.get('subdirectory')