I'm trying to use repoze.bfg.traversalwrapper instead of baking in
location awareness.  It appears that the names used to identify
virtual host information drifted apart between repoze.bfg and
traversalwrapper.  When trying to run I get a key error on
"virtual_root".  Looking closer, it appears that repoze.bfg.router is
looking for:

            context, view_name, subpath, traversed, vroot, vroot_path = (
                tdict['context'], tdict['view_name'], tdict['subpath'],
                tdict['traversed'], tdict['virtual_root'],

And repoze.bfg.traversalwrapper is providing a dict with slightly
different keys:

        return dict(context=ob, view_name='', subpath=[], traversed=traversed,
                    vroot=vroot, vroot_path=vroot_path, root=self.root)

Changing vroot to virtual_root and vroot_path to virtual_root_path in
traversalwrapper seems to fix the problem.

My question is about how to write a patch:

a) Change keys used in repoze.bfg to match traversalwrapper (I suspect not)
b) Change keys used in traversalwrapper to match repoze.bfg (perhaps)
c) Update traversalwrapper to return *both* sets of keys

I can see (c) being the correct choice if something other than
repoze.bfg is currently using traversalwrapper.

I'd love to write a quick patch and get things updated, just need a
little guidance.


Repoze-dev mailing list

Reply via email to