[Tilecache] Simple question about reading config

Jim Groffen jim.groffen at lisasoft.com
Mon Oct 5 20:43:14 EDT 2009


Hello Mark,

If you look at TileCache/Service.py all the configuration reading is done by the Service.load() method - look at the declaration for _load().

If you have any configuration to read it's best to have it happen during the Service.load() as TileCache does a good job of reading the config file and caching config in memory only when it needs to. For instance Service.load() is called by the various webapp handler methods in Service.py and where possible (ie based on which handler is being used) will only read the configuration if it hasn't been read before or it detects that the config file changed.

What you are doing would work but it bypasses the existing mechanism, so you've asked a good question :D

Regards,

Jim G

-----Original Message-----
From: tilecache-bounces at openlayers.org [mailto:tilecache-bounces at openlayers.org] On Behalf Of Mark Deneen
Sent: Tuesday, 6 October 2009 5:09 AM
To: tilecache
Subject: [Tilecache] Simple question about reading config


This should have a simple answer, but as I only dabble in Python....

I'm modifying tilecache, and I need to know the best method for accessing the configuration.  I've been successful doing 'service.config.get("cache", "attribute")', but I don't see this being done anywhere else in the code.  It works, but I'd like to be consistent.

I'll send a patch when I am done.  I'm writing it against 2.10, but I can try it out on the SVN version as well.

Thanks,
Mark
_______________________________________________
Tilecache mailing list
Tilecache at openlayers.org
http://openlayers.org/mailman/listinfo/tilecache

The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.



More information about the Tilecache mailing list