Re: [Repoze-dev] Chameleon templates and facebook namespace

2010-11-15 Thread Malthe Borch
Hey Eduardo, ---

It shouldn't eat that namespace prefix. I wonder if this is still the
case in the current Chameleon release. Have you tried?

Sorry for the long delay in response.

\malthe

On 5 June 2010 18:29, Eduardo Diaz eduardo.d...@ediaz.me wrote:
 Hi, I'm trying to use facebook's xfbml, it uses a custom namespace which I
 declared like this:

 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:fb=http://www.facebook.com/2008/fbml;
 And in the body I write this:
 fb:login-button/fb:login-button
 The problem is that when the login-button part gets rendered I get:
 login-button/login-button
 Is there a way to tell chameleon to ignore certain namespace??
 Thanks!
 ___
 Repoze-dev mailing list
 Repoze-dev@lists.repoze.org
 http://lists.repoze.org/listinfo/repoze-dev


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


Re: [Repoze-dev] entry points vs ZCA registrations

2010-11-15 Thread Wichert Akkerman
On 11/14/10 05:32 , Shane Hathaway wrote:
 On 11/12/2010 03:17 PM, Iain Duncan wrote:
 Reading some of the diaolgue on the pylons/bfg merger has me curious
 about the following, wondering if any experts care to share opinions and
 war stories:

 - what is the best use case for extending through entry points?
 - why/when would you use entry points and entires in an ini file vs
 registering modules/plugins as zca entries?
 - pros and cons of each approach?

 With ZCA, you can register components temporarily for a test.  You can
 create a short-lived component registry.  You can create multiple
 registries for different parts of the application.  You can store
 registries in a database.  Whatever makes sense.

 With entry points, can you do any of that?  Entry points seem far more
 limiting.  Please correct me if I am wrong.

Entry points work without you having to configure and python, zcml, etc. 
code, which makes them a better fit for some tasks.

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


[Repoze-dev] [Pyramid] Strange error on unittest.

2010-11-15 Thread Atsushi Odagiri
Hi

I try to use Pyramid, routes + sqlalchemy.
And, I wrote unittest with pyramid.configuration:Configurator.

My model uses `route_url`, and call `add_route` in TestCase.setUp.
I got error below::

 Traceback (most recent call last):
  File 
/Users/aodag/.buildout/eggs/unittest2-0.5.1-py2.6.egg/unittest2/case.py,
line 340, in run
testMethod()
  File 
/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/tests.py,
line 34, in test_to_dict
dct = target.to_dict()
  File 
/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/models.py,
line 42, in to_dict
for t in self.tickets])
  File 
/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/models.py,
line 71, in url
issue_no=self.issue_no)
  File /Users/aodag/.buildout/eggs/pyramid-1.0a2-py2.6.egg/pyramid/url.py,
line 110, in route_url
mapper = reg.getUtility(IRoutesMapper)
  File 
/Users/aodag/.buildout/eggs/zope.component-3.10.0-py2.6.egg/zope/component/registry.py,
line 168, in getUtility
raise ComponentLookupError(provided, name)
 ComponentLookupError: (InterfaceClass pyramid.interfaces.IRoutesMapper, u'')


Why was not IRoutesMapper found?

I tried again with trick in TestCase.setUp::

 get_current_request().registry = get_current_registry()

That's OK.
But, `route_url` also uses `get_current_registry`.

Why does the strange error happend?

-- 
/*
Atsushi Odagiri
http://blog.aodag.jp
mailto:aod...@gmail.com
*/
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] basicauth plugin does not work with https/apache

2010-11-15 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/15/2010 12:42 PM, cornelius wrote:
 Dear list,
 
 I am trying to do dual authentication. I am using repoze-who with
 pylons. (Due to my distribtion version 1.0.18 of repoze-who).
 I'd like to do form authentication when accessing a url with a browser
 and basic auth (or rather I'd use digest auth) when accessing with a API
 client.
 
 I followed the only description I could find by Chris Miles. It worked
 out fine so far.
 
 But I am serving  my application through apache using mod_wsgi. AND I am
 using https, and unfortunately the basicauth.py plugin does not work for
 https.
 The 'HTTP_AUTHORIZATION': 'Basic hjksjhudsiuz',
 is not contained in the environ dictionary.
 
 Do you got any ideas for using https or even digest auth?
 
 I suspect I would have to write my own plugin for this (which would be
 ok for me, too)

You need to tell mod_wsgi to include the auth headers:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPassAuthorization


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

iEYEARECAAYFAkzhctgACgkQ+gerLs4ltQ6vGwCeITH0D8emYJRe4aR62GZqGqlG
YlcAoK1j/6wSMTbOc/8eNOO23cYxFRep
=tY0f
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] basicauth plugin does not work with https/apache

2010-11-15 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/15/2010 02:17 PM, cornelius wrote:

 you made my day!

Great.

 Just addind this, my configuration also works with digestAuth!

What plugin are you using for digest authentication?


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

iEYEARECAAYFAkzhiP4ACgkQ+gerLs4ltQ7zWwCeL51lEjqToUFU9zuTj2hstGXu
QBEAoI9CCaDd9b4SwOE4ix5hEVgrn0Rx
=SPCi
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] entry points vs ZCA registrations

2010-11-15 Thread Michael Mulich
Iain-

I'll offer my two cents. But first, I want to suggest the use of 
Extensions (http://pypi.python.org/pypi/extensions) opposed to 
setuptools style entrypoints. Distutils2, the successor to Distutils and 
therefore Setuptools, will not support entry points as part of the 
distribution setup. Or at least this was the decision the last time I 
looked.

On 11/12/10 5:17 PM, Iain Duncan wrote:
 Reading some of the diaolgue on the pylons/bfg merger has me curious
 about the following, wondering if any experts care to share opinions and
 war stories:

I have an actual case where I used used entry points in wsgioauth and I 
regret doing so.

 - what is the best use case for extending through entry points?

Part of my decision to use entry points was from my experience at pycon. 
People hear reference to zope and either cringe or run away. So if 
people see zope.* as a dependency they decide not to use use it. ;)

 - why/when would you use entry points and entires in an ini file vs
 registering modules/plugins as zca entries?

I'm a big fan of ini files, but they have limitations. Though, the 
simplicity makes this configuration format one of the best.

Entry points are global. There need not be any direct reference to 
entry-point configuration like you would need to do in ZCA. So in the 
case of wsgioauth, I have wsgioauth.zodb which provides ZODB integration 
features.

 - pros and cons of each approach?

The configuration is built into the distribution, rather than into say a 
zcml file or python configuration script. I consider this both a pro and 
con, because the defines are available right away and comes straight out 
of the distribution itself, but these are not definitions that can be 
easily changed.

-Michael Mulich (pumazi)
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] entry points vs ZCA registrations

2010-11-15 Thread Martin Aspeli
On 15 November 2010 21:21, Michael Mulich mr...@psu.edu wrote:
 Part of my decision to use entry points was from my experience at pycon.
 People hear reference to zope and either cringe or run away. So if
 people see zope.* as a dependency they decide not to use use it. ;)

I think this is one of those amazing self-perpetuating myths. If we
all stopped saying this and thinking this, the issue would probably go
away. Or at least go away in rational, constructive developers. I'm
not sure Repoze/Pylons/Pyramid/Zope need care about those who are
irrational or destructive.

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


Re: [Repoze-dev] entry points vs ZCA registrations

2010-11-15 Thread Shane Hathaway
On 11/15/2010 02:48 PM, Martin Aspeli wrote:
 On 15 November 2010 21:21, Michael Mulichmr...@psu.edu  wrote:
 Part of my decision to use entry points was from my experience at pycon.
 People hear reference to zope and either cringe or run away. So if
 people see zope.* as a dependency they decide not to use use it. ;)

 I think this is one of those amazing self-perpetuating myths. If we
 all stopped saying this and thinking this, the issue would probably go
 away. Or at least go away in rational, constructive developers. I'm
 not sure Repoze/Pylons/Pyramid/Zope need care about those who are
 irrational or destructive.

+1.

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


[Repoze-dev] Chameleon and multiple select box

2010-11-15 Thread Uwe Hentzschel
Hi

I create a new project and add a multiple select box in mytemplate.pt.

=== % =

/div
/div
/div

div  
  select multiple id=select1  
option value=1Option 1/option  
option value=2Option 2/option  
option value=3Option 3/option  
option value=4Option 4/option  
  /select  
  a href=# id=addadd gt;gt;/a  
/div  


div id=footer
div class=footer© Copyright 2008-2010, Agendaless 
Consulting./div
/div

=== % =

But I get an error:

=== % =

  File 
/Users/uhe/develop/pyramid-env/lib/python2.6/site-packages/Chameleon-1.2.13-py2.6.egg/chameleon/core/etree.py,
 line 102, in parse
raise xml.parsers.expat.ExpatError(error_msg)
RuntimeError: Caught exception rendering template.
 - Filename:   /Users/uhe/develop/pyramid-env/demo/demo/templates/mytemplate.pt

ExpatError: not well-formed (invalid token): line 77, column 24

=== % =

-uhe

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


Re: [Repoze-dev] Chameleon and multiple select box

2010-11-15 Thread Shane Hathaway
On 11/15/2010 06:29 PM, Uwe Hentzschel wrote:
select multiple id=select1
  

Your multiple attribute needs a value.  One possibility:

select multiple=multiple id=select1

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


Re: [Repoze-dev] Chameleon and multiple select box

2010-11-15 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/15/2010 08:29 PM, Uwe Hentzschel wrote:
 Hi
 
 I create a new project and add a multiple select box in mytemplate.pt.
 
 === % =
 
   /div
   /div
   /div
 
 div  
   select multiple id=select1  
 option value=1Option 1/option  
 option value=2Option 2/option  
 option value=3Option 3/option  
 option value=4Option 4/option  
   /select  
   a href=# id=addadd gt;gt;/a  
 /div  
 
 
 div id=footer
   div class=footer© Copyright 2008-2010, Agendaless 
 Consulting./div
   /div
 
 === % =
 
 But I get an error:
 
 === % =
 
   File 
 /Users/uhe/develop/pyramid-env/lib/python2.6/site-packages/Chameleon-1.2.13-py2.6.egg/chameleon/core/etree.py,
  line 102, in parse
 raise xml.parsers.expat.ExpatError(error_msg)
 RuntimeError: Caught exception rendering template.
  - Filename:   
 /Users/uhe/develop/pyramid-env/demo/demo/templates/mytemplate.pt
 
 ExpatError: not well-formed (invalid token): line 77, column 24
 
 === % =

Chameleon requires valid XHTML in templates:  in this case, the
valueless 'multiple' attribute is the culprit (perfectly valid in HTML,
but not XML).

Spell it::

 select multiple=multiple id=select1



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

iEYEARECAAYFAkzh4KwACgkQ+gerLs4ltQ7fqQCgpq8q2JSiz4D7+O2y9OQZW0k9
KbIAni8287Fyvk2z9YRmvEq2eWLrqTRG
=gNB6
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] Fwd: Chameleon and multiple select box

2010-11-15 Thread Uwe Hentzschel
great thanks

-uhe

Anfang der weitergeleiteten E-Mail:

 Von: Tres Seaver tsea...@palladion.com
 Datum: 16. November 2010 02:38:53 MEZ
 An: Uwe Hentzschel u...@gmh-systems-ost.de
 Kopie: repoze-dev repoze-dev@lists.repoze.org
 Betreff: Re: [Repoze-dev] Chameleon and multiple select box
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 11/15/2010 08:29 PM, Uwe Hentzschel wrote:
 Hi
 
 I create a new project and add a multiple select box in mytemplate.pt.
 
 === % =
 
  /div
  /div
  /div
 
div  
  select multiple id=select1  
option value=1Option 1/option  
option value=2Option 2/option  
option value=3Option 3/option  
option value=4Option 4/option  
  /select  
  a href=# id=addadd gt;gt;/a  
/div  
 
 
div id=footer
  div class=footer© Copyright 2008-2010, Agendaless 
 Consulting./div
  /div
 
 === % =
 
 But I get an error:
 
 === % =
 
  File 
 /Users/uhe/develop/pyramid-env/lib/python2.6/site-packages/Chameleon-1.2.13-py2.6.egg/chameleon/core/etree.py,
  line 102, in parse
raise xml.parsers.expat.ExpatError(error_msg)
 RuntimeError: Caught exception rendering template.
 - Filename:   
 /Users/uhe/develop/pyramid-env/demo/demo/templates/mytemplate.pt
 
 ExpatError: not well-formed (invalid token): line 77, column 24
 
 === % =
 
 Chameleon requires valid XHTML in templates:  in this case, the
 valueless 'multiple' attribute is the culprit (perfectly valid in HTML,
 but not XML).
 
 Spell it::
 
 select multiple=multiple id=select1
 
 
 
 Tres.
 - -- 
 ===
 Tres Seaver  +1 540-429-0999  tsea...@palladion.com
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkzh4KwACgkQ+gerLs4ltQ7fqQCgpq8q2JSiz4D7+O2y9OQZW0k9
 KbIAni8287Fyvk2z9YRmvEq2eWLrqTRG
 =gNB6
 -END PGP SIGNATURE-

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