- for size in ((500, 500), (600, 600), (800, 800)) :
- # print 'resize at', size
- p._getResizedImage(size, True)
- transaction.commit()
-
- zMin = p.tiles_min_zoom
- zMax = p.tiles_max_zoom
- zStep = p.tiles_step_zoom
- levels = range(zMin, zMax + zStep, zStep)
- zooms = [l/100. for l in levels]
- todo = set(zooms) - set(p._tiles.keys())
- if todo :
- if p.tileGenerationLock.locked() :
- console.info('skip %s: already tiling.' % p.absolute_url())
- return
-
- p.tileGenerationLock.acquire()
- zooms = list(todo)
- zooms.sort()
- ppm = None
- try :
- ppm = p._getPPM()
- for zoom in zooms :
-
- # print 'tiling at', zoom
- if zoom < 1 :
- rppm = ppm.resize(ratio=zoom)
- else :
- rppm = ppm
- p._makeTilesAt(zoom, rppm)
- del rppm
- transaction.commit()
- finally :
- del ppm
- p.tileGenerationLock.release()
-
- try :
- delattr(p, '_v__methodResultsCache')
- except AttributeError:
- pass
-
- p.tiles_available = 1
- assert p._getCatalogTool()
- p.reindexObject(idxs=['tiles_available'])
- transaction.commit()
+ for size in ((500, 500), (600, 600), (800, 800)) :
+ # print 'resize at', size
+ p._getResizedImage(size, True)
+ transaction.commit()
+
+ zMin = p.tiles_min_zoom
+ zMax = p.tiles_max_zoom
+ zStep = p.tiles_step_zoom
+ levels = range(zMin, zMax + zStep, zStep)
+ zooms = [l/100. for l in levels]
+ todo = set(zooms) - set(p._tiles.keys())
+ if todo :
+ if p.tileGenerationLock.locked() :
+ console.info('skip %s: already tiling.' % p.absolute_url())
+ return
+
+ p.tileGenerationLock.acquire()
+ zooms = list(todo)
+ zooms.sort()
+ ppm = None
+ try :
+ ppm = p._getPPM()
+ for zoom in zooms :
+
+ # print 'tiling at', zoom
+ if zoom < 1 :
+ rppm = ppm.resize(ratio=zoom)
+ else :
+ rppm = ppm
+ p._makeTilesAt(zoom, rppm)
+ del rppm
+ transaction.commit()
+ finally :
+ del ppm
+ p.tileGenerationLock.release()
+
+ try :
+ delattr(p, '_v__methodResultsCache')
+ except AttributeError:
+ pass
+
+ p.tiles_available = 1
+ assert p._getCatalogTool()
+ p.reindexObject(idxs=['tiles_available'])
+ transaction.commit()