Re: [Repoze-dev] match templates in chameleon.genshi?

2009-10-04 Thread Malthe Borch
2009/10/3 Iain Duncan :
> Hey folks ( or rather Malte! ), wondering whether there are plans to
> include full match template support in chameleon.genshi? Is such a thing
> possible while still retaining speed?

It is possible; I've previously outlined an idea for an
implementation. It's not easy though as it would require us to
implement XPath selection both in the compilation phase and in the
rendering phase. To maintain speed, we'd need it to be quite clever.

> Are there other decent ways of doing template inheritance using
> chameleon.genshi that remove the need for it?

There are macros and includes. Do you mean an OWrap-like mechanism? I
am not sure actually (I'm a ZPT user).

\malthe
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Default user when not logged in

2009-10-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Richie Ward wrote:
> Normally by default, when you are not logged in with repoze.who/what,
> you are logged in as nothing. I propose a modiforcation that will give
> the option to set a default user (A user in database called guest with
> restricted permissions for example) for when you are not logged in.
> Ideally you could turn this on or off.
> 
> What do you think is the correct way to impliment this?
> Would it be accepted if I made a patch?
> 
> I need this functionality for my project and ideally I would rahter
> the code went into repoze rather than me forking or a ton of
> subclassing. It would remove the need for me to hard code alot of
> guest permissions and I could tell it what guest can and cant do in
> database.

No subclassing required:  just register your own IAuthenticator plugin
"last" in the list and have it return your guest.  E.g., something like:

  class GuestAuth:

  def authenticate(environ, identity):
  return 'guest'


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrIlLsACgkQ+gerLs4ltQ7zbACcD0gepiapF2e3Ql3JxFCbMGwj
+UEAoL4unznan5HlYVSWx43c4nibZ3DH
=c0jc
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Default user when not logged in

2009-10-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tres Seaver wrote:
> Richie Ward wrote:
>> Normally by default, when you are not logged in with repoze.who/what,
>> you are logged in as nothing. I propose a modiforcation that will give
>> the option to set a default user (A user in database called guest with
>> restricted permissions for example) for when you are not logged in.
>> Ideally you could turn this on or off.
> 
>> What do you think is the correct way to impliment this?
>> Would it be accepted if I made a patch?
> 
>> I need this functionality for my project and ideally I would rahter
>> the code went into repoze rather than me forking or a ton of
>> subclassing. It would remove the need for me to hard code alot of
>> guest permissions and I could tell it what guest can and cant do in
>> database.
> 
> No subclassing required:  just register your own IAuthenticator plugin
> "last" in the list and have it return your guest.  E.g., something like:
> 
>   class GuestAuth:
> 
>   def authenticate(environ, identity):
>   return 'guest'

Docs are here:

 http://docs.repoze.org/who/narr.html#writing-an-authenticator-plugin


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrIxL4ACgkQ+gerLs4ltQ48EQCgith7+OE6SW7I5GQ/cgkjZDEU
yDQAn1PGfaDi0zygELMQBdfCn8qisKck
=1Mg0
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev