Thanks, Jamie.
I followed your suggestion. What I am doing now is:
- I set 'ah' field in globals; if this field is absent in config, it's
set to 0 in globals.
- and use autohandler of the following type:

---- autohandler---
<%python scope="init">
if c.ah:
    m.subexec(c.ah)
</%python>
<html><head><title>autohandler local</title></head>
<body>
<h3>local autohandler</h3>
<b><% c.ah %></b>
% m.call_next()
</body>
</html>
--- end of autohandler ---

here is the error:

---- error traceback ----
TopLevelNotFound: ComponentNotFound: Cant locate component
/D:/Pylons/autohandler (resolvefile:,
D:\Pylons\auto\auto\components/D:/Pylons/autohandler,
D:\Pylons\auto\auto\templates/D:/Pylons/autohandler, dhandler,
resolvefile:, D:\Pylons\auto\auto\components/D:/Pylons/dhandler,
D:\Pylons\auto\auto\templates/D:/Pylons/dhandler, resolvefile:,
D:\Pylons\auto\auto\components/D:/dhandler,
D:\Pylons\auto\auto\templates/D:/dhandler, resolvefile:,
D:\Pylons\auto\auto\components/dhandler,
D:\Pylons\auto\auto\templates/dhandler)
--- end of traceback ------

Thus, Pylons is looking for any component only in dirs defined via
load_environment.

Also, and it might be a paster issue, slash is prepend to the
windows-styled path.

greetings,
Giorgi

Jamie Wilkinson wrote:
> This one time, at band camp, iGL wrote:
> >
> >Hi,
> >How can one define autohandler programmically?
> >
> >More exactly, my task is to do the following: if there is a field 'ah'
> >(or whichever way named) in a config file with the autohandler file
> >name, my pylons app should use that autohandler; if not, the default
> >one in the templates dir.
>
> You could subexec the template you want from the actual autohandler, like
> so:
>
> -- autohandler --
> % m.subexec(config['ah'])
> ---
> 
> or somesuch...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to