Funny timing.. I started taking a look at the config problem just last
night.
>From a quick look, it seems the problem is that CherryPy 3 uses a
nested dict to store configuration, while version 2 used separate
configs. I hacked around in the CP3 branch long enough to get
test_config working, though I'm sure that's just a start.
Disclaimer: I'm not a TG or CP guru, so take the code below as a
strawman.
if cherrypy.__version__ >= '3':
class NestedConfig(dict):
def get(self, item, default=KeyError, return_section=False,
path="global"):
#TODO: Figure out what return_section is used for
try:
result = dict.__getitem__(self, item)
except KeyError:
try:
sub = dict.__getitem__(self, path)
result = sub[item]
except:
if default != KeyError:
result = default
else:
raise
return result
__getitem__ = get
config = NestedConfig(config)
The changes to update_config, get, update, are all trivial. I also
had to add a module-level copy function to get ToscaWidgets running.
The full diff (against the CP3 branch) is at
http://paste.turbogears.org/paste/1682
-ken
On Oct 11, 4:00 am, "Florent Aide" <[EMAIL PROTECTED]> wrote:
> On 10/11/07, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
>
> > Thanks a lot for writing this up. Please put this list also here:
> >http://docs.turbogears.org/1.1/DevPlans
>
> This will be done.
>
> > Maybe we should also define the version numbers of the components TG 1.1
> > will be using. Will the changes in the config system allow moving to
> > CherryPy 3?
>
> You understood my secret plan :-) More seriously this could be a great
> side effect...
>
> Florent.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---