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:
parent
c810ab11af
commit
d21b4a8f80
2 changed files with 3 additions and 4 deletions
|
@ -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'
|
||||
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue