[Tilecache] TileCache.Cache import DiskCache
Christopher Schmidt
crschmidt at metacarta.com
Wed Jan 16 00:00:06 EST 2008
On Tue, Jan 15, 2008 at 11:38:36PM -0500, James McManus wrote:
> Christopher Schmidt wrote:
> >On Tue, Jan 15, 2008 at 06:55:10PM -0800, James McManus McManus wrote:
> >
> >>Hi - I am trying to create a python script use Example.py in the doc
> >>directory. However, when I try to import DiskCache, I get the following
> >>error message:
> >>
> >>
> >>>>>from TileCache.Cache import DiskCache
> >>>>>
> >>Traceback (most recent call last):
> >> File "<stdin>", line 1, in <module>
> >>ImportError: cannot import name DiskCache
> >>
> >>I can import all other modules in the example. Does DiskCache still
> >>exist? I could not find any reference to it in the code.
> >>
> >
> >Sorry -- the Cache got renamed "Disk". I'll fix the example. Fixed,
> >r249, will be in the next release.
> >
> >Regards,
> >
> Christopher,
>
> I tried that but thought it was incorrect because I got the following error:
>
> >>> from TileCache.Service import Service, modPythonHandler, cgiHandler
> >>> from TileCache.Caches import Disk
> >>> import TileCache.Layers.MapServer as MS
> >>> myService = Service (Disk("/var/www/html/mapdata/tmp"),{"basemap" :
> MS.MapServer( "basemap", "/var/www/html/mapdata/Durham.map" )})
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: 'module' object is not callable
>
> Am I using the correct sequence?
My bad. Didn't think it through. What you want is "from
TileCache.Caches.Disk import Disk", and then to use that.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Tilecache
mailing list