bug fix: make sure changes are made persistent

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3472 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-07-22 08:18:23 +00:00
parent 9c7ad26306
commit f3776268c9

View file

@ -62,7 +62,7 @@ class RegenerationView(object):
class ChangeSubdirectories(object):
search = '/home/Zope3/ctt'
replace = ''
replace = '/home/33zope/ctt'
def __call__(self):
found = changed = 0
@ -70,9 +70,11 @@ class ChangeSubdirectories(object):
ma = context['concepts']['media_asset']
for obj in ma.getResources():
found += 1
subdir = obj._storageParams.get('subdirectory', '')
sp = obj._storageParams
subdir = sp.get('subdirectory', '')
print subdir
if self.search in subdir:
changed += 1
obj._storageParams['subdirectory'] = subdir.replace(search, replace)
sp['subdirectory'] = subdir.replace(self.search, self.replace)
obj._storageParams = sp
return 'Done, %i media asset objects found, %i changed' % (found, changed)