[Zope] Re: dtml-let and product

2008-02-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Wayne Volkmuth wrote:
> I have a simple test Zope product inheriting from Cacheable, PropertyManager 
> and SimpleItem.
> 
> Say I have a dtml method at http://myzopeinstance.com/testdtml with contents
> 
> 
> I'd like "myvar" to be available in the__call__ method of testproduct.  I 
> don't know how to do that.
> 
> Here's my testproduct __call__ method:
> 
> def __call__(self, client=None, REQUEST=None, **kw):
> foo="1. client:"+str(client)+"" \
>+"2. REQUEST:"+str(REQUEST)+"" \
>+"3. kw:"+str(kw)+"" \
>+"4. getattr(..REQUEST..):"+str(getattr(self, "REQUEST", 
> None))+"" \
>+"5. getattr(..client..):"+str(getattr(self, "client", 
> None))+"" \
>+"6. getattr(self, myvar...):"+str(getattr(self, "myvar", None))+ 
> "" \
>+"7. aq_get(self, myvar...):"+str(aq_get(self, "myvar", None))+ 
> ""
> return foo
> 
> From poking around I was expecting "myvar" to be accessible
> somewhere  from that list either directly or as an attribute of one
> of the objects, but it's not. Every call (via a web browser) displays
> None for every line except #4, the getattr(self, "REQUEST", None)
statement.

Two things:

 - 'myvar' is not defined as an attribute of your object:  it is a name
in one layer of the DTML namespace, created by the ''.

 - Callables referenced by name in a var (e.g., your
   '') are called *without* arguments.

To get the mapping passed, you need to implement the method,
'__render_with_namespace__', which will then be passed the
multi-mapping as an argument.  E.g.::

  def __render_with_namespace__(self, md):
  myvar = md['myvar']
  # 



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

iD8DBQFHvle8+gerLs4ltQ4RAmJrAKCV7k8t/9kLzMxNJlqX/uQ7bSDnHwCfdN6i
7bRTszqprybjxx6IgxaK2J8=
=atpX
-END PGP SIGNATURE-

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] dtml-let and product

2008-02-21 Thread Wayne Volkmuth
I have a simple test Zope product inheriting from Cacheable, PropertyManager 
and SimpleItem.

Say I have a dtml method at http://myzopeinstance.com/testdtml with contents


I'd like "myvar" to be available in the__call__ method of testproduct.  I don't 
know how to do that.

Here's my testproduct __call__ method:

def __call__(self, client=None, REQUEST=None, **kw):
foo="1. client:"+str(client)+"" \
   +"2. REQUEST:"+str(REQUEST)+"" \
   +"3. kw:"+str(kw)+"" \
   +"4. getattr(..REQUEST..):"+str(getattr(self, "REQUEST", 
None))+"" \
   +"5. getattr(..client..):"+str(getattr(self, "client", None))+"" 
\
   +"6. getattr(self, myvar...):"+str(getattr(self, "myvar", None))+ 
"" \
   +"7. aq_get(self, myvar...):"+str(aq_get(self, "myvar", None))+ 
""
return foo

>From poking around I was expecting "myvar" to be accessible somewhere from 
>that list either directly or as an attribute of one of the objects, but it's 
>not.  Every call (via a web browser) displays None for every line except #4, 
>the getattr(self, "REQUEST", None) statement.

Containment acquisition works more or less the way I would expect, i.e. if 
myvar is a dtml method in the same folder then the text "hello world" shows up 
on lines 6 and 7.  (I don't understand though why the REQUEST object is always 
None;  I thought when a DTML method calls another object the client and REQUEST 
parameters are passed in.)

I'd appreciate it if someone can explain to me how things work and what I'm 
doing wrong.


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE : Re: [Zope] RE : Re: RE : Re: Frequent Zope crashes (Zope 2.9.8)

2008-02-21 Thread Paul Brettschneider
Hi,

--- Andreas Jung <[EMAIL PROTECTED]> a écrit :
 
> --On 17. Februar 2008 16:59:54 +0100 Paul
> Brettschneider 
> <[EMAIL PROTECTED]> wrote:
> 
> 
> > If I am informed correctly, only ZPsycopgDA
> contains
> > C-code. The psycopg module is not built from
> source
> > but installed via the Debian package repository.
> 
> psycopg is partly written in C. Since you're using
> packages,
> try to compile psycopg yourself from the sources. If
> you're using a system
> python, try to setup your site with a Python source
> installation.

we tried again with python 2.4 compiled from source
(including psycopg and PIL) and a fresh compiled Zope
2.9.8.

The crash still happens. Here is a gdb backtrace:

0x00446623 in type_dealloc (type=0x613280) at
Objects/typeobject.c:2108
2108_PyObject_GC_UNTRACK(type);
#0  0x00446623 in type_dealloc (type=0x613280)
at Objects/typeobject.c:2108
#1  0x2b062b0f5f41 in cc_oid_unreferenced
(self=0x2aaad120, oid=0x2bea6180) at
persistent/cPickleCache.c:607
#2  0x2b062aeed5a8 in Per_dealloc (self=0x9fa7cf8)
at persistent/cPersistence.c:578
#3  0x00446c23 in subtype_dealloc
(self=0x9fa7cf8) at Objects/typeobject.c:703
#4  0x00436bfc in dict_dealloc (mp=0x4e1f1c0)
at Objects/dictobject.c:766
#5  0x00446c7c in subtype_dealloc
(self=0x9fa7c08) at Objects/typeobject.c:691
#6  0x00436bfc in dict_dealloc (mp=0x2ebfd40)
at Objects/dictobject.c:766
#7  0x00446c7c in subtype_dealloc
(self=0x9fa7230) at Objects/typeobject.c:691
#8  0x00436bfc in dict_dealloc (mp=0x53387c0)
at Objects/dictobject.c:766
#9  0x00446c7c in subtype_dealloc
(self=0x9fa72a8) at Objects/typeobject.c:691
#10 0x00436bfc in dict_dealloc (mp=0x24b2c20)
at Objects/dictobject.c:766
#11 0x00446c7c in subtype_dealloc
(self=0x2b319848) at Objects/typeobject.c:691
#12 0x00436bfc in dict_dealloc (mp=0x5baa280)
at Objects/dictobject.c:766
#13 0x00446c7c in subtype_dealloc
(self=0x2b3196e0) at Objects/typeobject.c:691
#14 0x00436bfc in dict_dealloc (mp=0x4aaf710)
at Objects/dictobject.c:766
#15 0x00446c7c in subtype_dealloc
(self=0x2bb80668) at Objects/typeobject.c:691
#16 0x00436bfc in dict_dealloc (mp=0x4ba6100)
at Objects/dictobject.c:766
#17 0x00446c7c in subtype_dealloc
(self=0x2bb80500) at Objects/typeobject.c:691
#18 0x00436bfc in dict_dealloc (mp=0x8b59320)
at Objects/dictobject.c:766
#19 0x00446c7c in subtype_dealloc
(self=0x2bb80398) at Objects/typeobject.c:691
#20 0x00436bfc in dict_dealloc (mp=0xf7fdd80)
at Objects/dictobject.c:766
#21 0x00446c7c in subtype_dealloc
(self=0x2bb801b8) at Objects/typeobject.c:691
#22 0x00436bfc in dict_dealloc (mp=0x80e06e0)
at Objects/dictobject.c:766
#23 0x00446c7c in subtype_dealloc
(self=0x2bb80cf8) at Objects/typeobject.c:691
#24 0x00436bfc in dict_dealloc (mp=0x5b74d10)
at Objects/dictobject.c:766
#25 0x00446c7c in subtype_dealloc
(self=0x2bb80d70) at Objects/typeobject.c:691
#26 0x00438dfb in _PyTrash_destroy_chain () at
Objects/object.c:2087
#27 0x2b062b0f65fa in cc_clear
(self=0x2aaad120) at persistent/cPickleCache.c:756
#28 0x0049f112 in collect
(generation=117993392) at Modules/gcmodule.c:710
#29 0x0049f9b5 in _PyObject_GC_New
(tp=0x5f3be0) at Modules/gcmodule.c:872
#30 0x0041a9fc in PyInstance_NewRaw
(klass=0x2b062b81eb30, dict=0x4f52700) at
Objects/classobject.c:543
#31 0x0041d093 in PyInstance_New
(klass=0x2b062b81eb30, arg=0xbcc4cb0, kw=0xa01f2e0) at
Objects/classobject.c:568
#32 0x00413a10 in PyObject_Call
(func=0x613280, arg=0x2bea6180, kw=0x0) at
Objects/abstract.c:1795
#33 0x004723c9 in PyEval_EvalFrame
(f=0x4d3de90) at Python/ceval.c:3776
#34 0x00472d69 in PyEval_EvalFrame
(f=0x5101a40) at Python/ceval.c:3651
#35 0x00472d69 in PyEval_EvalFrame
(f=0x57902a0) at Python/ceval.c:3651
#36 0x00472d69 in PyEval_EvalFrame
(f=0x5d42260) at Python/ceval.c:3651
#37 0x00472d69 in PyEval_EvalFrame
(f=0x5790030) at Python/ceval.c:3651
#38 0x00472d69 in PyEval_EvalFrame
(f=0x24f1090) at Python/ceval.c:3651
#39 0x00472d69 in PyEval_EvalFrame
(f=0x5c06f70) at Python/ceval.c:3651
#40 0x00472d69 in PyEval_EvalFrame
(f=0x542fc20) at Python/ceval.c:3651
#41 0x00472d69 in PyEval_EvalFrame
(f=0x8dfb5d0) at Python/ceval.c:3651
#42 0x00472d69 in PyEval_EvalFrame
(f=0x5ee53b0) at Python/ceval.c:3651
#43 0x00472d69 in PyEval_EvalFrame
(f=0x3317c30) at Python/ceval.c:3651
#44 0x00472d69 in PyEval_EvalFrame
(f=0x8655750) at Python/ceval.c:3651
#45 0x00472d69 in PyEval_EvalFrame
(f=0x2d4c500) at Python/ceval.c:3651
#46 0x00472d69 in PyEval_EvalFrame
(f=0x7ca56a0) at Python/ceval.c:3651
#47 0x00472d69 in PyEval_EvalFrame
(f=0x4d25e40) at Python/ceval.c:3651
#48 0x

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Hugo Ramos
Hi Tino,

Is "I've never used Postgres before and all my web life experience is
MySQL based" reason enough?
:-)

Thanks
Hugo


On Thu, Feb 21, 2008 at 3:31 PM, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Hugo Ramos wrote:
>  > Well,
>  >
>  > I went googling for this error... Google gives 1 (one) answer!!! The
>  > worst part is that it's related to django and mod_python.
>  >
>  > I guess nobody solved this yet... I'll have to go back to OS X 10.4 
> (Tiger).
>
>  You could also forward to Postgres :-) Unless you have a very specific
>  need for mysql...
>
>  Regards
>  Tino
>
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Tino Wildenhain

Hugo Ramos wrote:

Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).


You could also forward to Postgres :-) Unless you have a very specific
need for mysql...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread David Pratt
Hi Hugo. Yes, that's true but of course you have to consider all of the 
other frameworks that apple has already put on your machine. Much of the 
problem will come when linking the libraries when compiling. So in fact 
it is a bigger issue and requires much of the base software to 
recompiled using macports or on your own for a sound development 
machine. You can of course recompile these to create a framework build 
for your own architecture.


You probably just need to keep in mind that mac is really only just 
FreeBSD/Darwin so things will compile in a normal mode without anything 
'universal' involved. I just takes some effort.


Regards,
David

Hugo Ramos wrote:

Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <[EMAIL PROTECTED]> wrote:

Hi Hugo. I believe 'file is not of required architecture' may be the
 clue here. Ever since mac went to universal binaries, folks with ppc
 have been having trouble since it is compiled with i386 arch flags and
 vice versa for folks with intel macs (with ppc arch flags). The only way
 to get around this is to compile a universal build, use universal
 binaries, or build for your own architecture. There is a large amount of
 software out there that does not do the right thing.

 For myself, I build my own software including python and I try and keep
 away from the universal insanity. On a mac, many folks use macports
 without the universal build. If you choose to build your own software,
 you can place it in the /opt directory to prevent it from affecting your
 system software. This is where your macports software will go if you use
 it. You will also need to modify your path to ensure that your compiled
 software is obtained over system software.

 I see that your issue was solved with a universal build. This probably
 just confirms what I have written. This may be alright until you run
 into the next snag with something else you need to compile. Personally,
 I got tired of the consistent problems trying to build software with the
 universal python.

 Regards,
 David



 Hugo Ramos wrote:
 > Hello Chetan,
 >
 > Well thank you very much! I must be very tired to forget to compile
 > MySQL without --enable-thread-safe-client !!!
 > It seems that MySQL-python now compiles with a warning:
 >
 > ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
 > is not of required architecture
 >
 > But when I try to import _mysql in Python 2.4.4 shell it seems to
 > import the module with no errors.
 >
 > After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
 > receive the following error:
 >
 > ===
 > 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
 > Traceback (most recent call last):
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 709, in import_product
 > product=__import__(pname, global_dict, global_dict, silly)
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
 > line 91, in ?
 > import DA
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
in ?
 > from db import DB
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
in ?
 > import _mysql
 >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
 >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
 > ImportError: Inappropriate file type for dynamic loading
 > Traceback (most recent call last):
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ?
 > run()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in 
run
 > starter.prepare()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
 > line 102, in prepare
 > self.startZope()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
 > line 278, in startZope
 > Zope2.startup()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in 
startup
 > _startup()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
 > 45, in startup
 > OFS.Application.import_products()
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 686, in import_products
 > import_product(product_dir, product_name, raise_exc=debug_mode)
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 709, in import_product
 > product=__import__(pname, global_dict, global_dict, silly)
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
 > line 91, in ?
 > import DA
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
in ?
 > from db import DB
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
in ?
 > import _my

[Zope] What groupware (not CMS) on top of Zope?

2008-02-21 Thread Rakotomandimby Mihamina

Hi,
I juste asked on the Plone ML if it could be used as a groupware while 
CMS is its first feature.
Andreas (thanks Andreas) aswered me it would be a good idea to look for 
a dedicated solution.

I would like to stick on Zope and I am looking for a solution laying on it.
My feature requests are:
- A webmail
- A shared and individual calendar
- Some file management (~5MB/File, binary or not) that would allow me to 
 make some files public or private.

- A discussion tool

Indexation (for Mail, discussion, calendar and files) is not a must, but 
would be appreciated.
Is there any packaged (or easily packageable) solution you would know on 
top of Zope?


Thank you.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Hugo Ramos
Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <[EMAIL PROTECTED]> wrote:
> Hi Hugo. I believe 'file is not of required architecture' may be the
>  clue here. Ever since mac went to universal binaries, folks with ppc
>  have been having trouble since it is compiled with i386 arch flags and
>  vice versa for folks with intel macs (with ppc arch flags). The only way
>  to get around this is to compile a universal build, use universal
>  binaries, or build for your own architecture. There is a large amount of
>  software out there that does not do the right thing.
>
>  For myself, I build my own software including python and I try and keep
>  away from the universal insanity. On a mac, many folks use macports
>  without the universal build. If you choose to build your own software,
>  you can place it in the /opt directory to prevent it from affecting your
>  system software. This is where your macports software will go if you use
>  it. You will also need to modify your path to ensure that your compiled
>  software is obtained over system software.
>
>  I see that your issue was solved with a universal build. This probably
>  just confirms what I have written. This may be alright until you run
>  into the next snag with something else you need to compile. Personally,
>  I got tired of the consistent problems trying to build software with the
>  universal python.
>
>  Regards,
>  David
>
>
>
>  Hugo Ramos wrote:
>  > Hello Chetan,
>  >
>  > Well thank you very much! I must be very tired to forget to compile
>  > MySQL without --enable-thread-safe-client !!!
>  > It seems that MySQL-python now compiles with a warning:
>  >
>  > ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
>  > is not of required architecture
>  >
>  > But when I try to import _mysql in Python 2.4.4 shell it seems to
>  > import the module with no errors.
>  >
>  > After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
>  > receive the following error:
>  >
>  > ===
>  > 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
>  > Traceback (most recent call last):
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 709, in import_product
>  > product=__import__(pname, global_dict, global_dict, silly)
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
>  > line 91, in ?
>  > import DA
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
> in ?
>  > from db import DB
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
> in ?
>  > import _mysql
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in 
> __bootstrap__
>  > ImportError: Inappropriate file type for dynamic loading
>  > Traceback (most recent call last):
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, 
> in ?
>  > run()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, 
> in run
>  > starter.prepare()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  > line 102, in prepare
>  > self.startZope()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  > line 278, in startZope
>  > Zope2.startup()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in 
> startup
>  > _startup()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
>  > 45, in startup
>  > OFS.Application.import_products()
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 686, in import_products
>  > import_product(product_dir, product_name, raise_exc=debug_mode)
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 709, in import_product
>  > product=__import__(pname, global_dict, global_dict, silly)
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
>  > line 91, in ?
>  > import DA
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
> in ?
>  > from db import DB
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
> in ?
>  > import _mysql
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in 
> __bootstrap__
>  > ImportError: Inappropriate file type for dynamic loading
>  > ===
>  >
>  > Any ideas?
>  >
>  > ps: I'm posting this to zope list because I'm sure there is more
>  > people with this problem.
>  >
>  >
>  > tia
>  >
>  > Hugo
>  >
>  >
>  > On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]