Re: [Zope-dev] getURL and url_quoting

2002-01-28 Thread Chris Withers

Hi lambert,

You question is better suited to the [EMAIL PROTECTED] list.

zope-dev is for the development of Zope not the development of applications with
Zope.

lambert muhr wrote:
 
 A HREF=dtml.-getURL;link/a
 
 unfortunately, the link on the web page turns out like this:
 
 /base/select_mm_url/2/show_intro%3fstart%3d4
 
 what is my mistake?

The entity syntax for DTML (dtml-;) automatically url-quotes the result.

I'd use PageTemplates if I were you...

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Chris Withers

Hi,

A routine move to Python 2.1.2 this morning has resulted in one of our Zope
instances continually dying with the following:

zdaemon: Mon Jan 28 13:45:45 2002: Aiieee! 18724 exited with error code: 6

Some questions:

1. What does Error Code 6 mean?

2. How can I find out what these error codes eman in general?

3. How can I fix this problem?

cheers,

Chris

PS:

Zope 2.4.2
ZEO 1.0b4
No DA's or other non-standard C-based extensions.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread stefan holek

At 28.01.2002 13:55 +, Chris Withers wrote:

1. What does Error Code 6 mean?

#define ENXIO6  /* No such device or address */

2. How can I find out what these error codes eman in general?

Look into /usr/include/asm/errno.h

3. How can I fix this problem?

Make the device or address available ;-)

Cheers,
Stefan


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Chris Withers

stefan holek wrote:
 
 1. What does Error Code 6 mean?
 
 #define ENXIO6  /* No such device or address */
 
 2. How can I find out what these error codes eman in general?
 
 Look into /usr/include/asm/errno.h
 
 3. How can I fix this problem?
 
 Make the device or address available ;-)

And how can i find out what device or address isn't available? ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] DTML Document textarea edit

2002-01-28 Thread Dirk Datzert

Hi!

I want to suggest a modification for the DTML Document/Method dtml-file
documentEdit.dtml

On default the textarea will be displayd with wrap=off . If I imported
XML-Files without line breaks it is difficult to edit the files via
DTML-Webfrontend. A property wrapmode could solve this:

documentEdit.dtml:

 textarea name=data:text wrap=dtml-if wrapmodedtml-var
wrapmodedtml-else
off/dtml-if style=width: 100%;dtml-if
   dtpref_cols cols=dtml-var dtpref_colsdtml-else
cols=50/dtml-ifdtml-if dtpref_rows rows=dtml-var
   dtpref_rowsdtml-else rows=20/dtml-ifdtml-var
   __str__/textarea


Regards,
Dirk


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Leonardo Rochael Almeida

On Mon, 2002-01-28 at 12:29, stefan holek wrote:
 At 28.01.2002 13:55 +, Chris Withers wrote:
 
 1. What does Error Code 6 mean?
 
 #define ENXIO6  /* No such device or address */

Actually, it means the Zope process exited because of a signal, and the
signal was 6, meaning SIGABRT or SIGABORT (check kill -l on your
nearest unix prompt). However, I have no idea what could cause a
SIGABORT.

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread stefan holek

At 28.01.2002 12:58 -0200, Leonardo Rochael Almeida wrote:
On Mon, 2002-01-28 at 12:29, stefan holek wrote:
  At 28.01.2002 13:55 +, Chris Withers wrote:
 
  1. What does Error Code 6 mean?
 
  #define ENXIO6  /* No such device or address */

Actually, it means the Zope process exited because of a signal, and the
signal was 6, meaning SIGABRT or SIGABORT (check kill -l on your
nearest unix prompt). However, I have no idea what could cause a
SIGABORT.

oops ;-)


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Matt Behrens

stefan holek wrote:
 At 28.01.2002 13:55 +, Chris Withers wrote:
 
 1. What does Error Code 6 mean?
 
 
 #define ENXIO6  /* No such device or address */

Bzzt.  The error code comes from waitpid(), which the Python library 
doco says has the same return code as wait().  The low eight bits are a 
signal, so we actually got a signal 6, not an exit code 6.  Signal 6 is 
SIGABRT.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Chris Withers

Leonardo Rochael Almeida wrote:
 
 Actually, it means the Zope process exited because of a signal, and the
 signal was 6, meaning SIGABRT or SIGABORT (check kill -l on your
 nearest unix prompt). However, I have no idea what could cause a
 SIGABORT.

Hmmm... how would I go about finding out?

I am rather disturbed by the fact that a third point update to python suddenly
starts causing Zope to keel over :-(

I tracked it down to a python script that returned a data structure consisting
of nested lists and dictionaries. Now, I remember there being a bug in
RestrictedPython that would affect Zope 2.4.2, but why would the upgrade of
Python suddenly trigger this?

confusedly,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Defining Interfaces

2002-01-28 Thread Chris Withers

Jeffrey P Shell wrote:
 
 On 1/27/02 11:25 AM, Steve Alexander [EMAIL PROTECTED] wrote:
 
  Hi folks,
 
  When I define an Interface, are the methods of the interface supposed to
  have self as the first argument?
 
 No.

Can you expand on this a little?

It doesn't make sense to me to exclude 'self'...

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread R. David Murray

On Mon, 28 Jan 2002, Chris Withers wrote:
 I tracked it down to a python script that returned a data structure consisting
 of nested lists and dictionaries. Now, I remember there being a bug in
 RestrictedPython that would affect Zope 2.4.2, but why would the upgrade of
 Python suddenly trigger this?

Well, my understanding is the new python is catching memory corruption
bugs the old one wasn't, and that the compiler for python scripts
in 2.4.2 has bugs...so maybe you were just lucky zope wasn't crashing
before?

--RDM


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Paul Everitt

Leonardo Rochael Almeida wrote:

 I'm really disappointed with ZC for putting out a new release of Zope
 instead of a fixed version of the release most everyone is currently
 using.

2.4.4 is ready, but there's a problem with the Windows build.  I suppose 
we could just put the others up there w/out the Windows build, but then 
we'd wind up with 20 emails to reply to and explain over and over.

All in all, only a few days separate the two releases, and obviously CVS 
people have been able to get at changes all along.  Thus, I don't think 
this is an extreme case.

--Paul


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Martijn Pieters

On Mon, Jan 28, 2002 at 10:32:11AM -0500, Paul Everitt wrote:
 All in all, only a few days separate the two releases, and obviously CVS 
 people have been able to get at changes all along.  Thus, I don't think 
 this is an extreme case.

Also note that downloading a source release from CVS is very very very easy.
Just use the following link:

  http://cvs.zope.org/Zope/Zope.tar.gz?tarball=1only_with_tag=Zope-2_4-branch

This will get you a tarball with a CVS export of the current 2.4.x branch,
which will contain *exactly* the same contents as the Ssource release we'll
make as soon as the windows problem is resolved.

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
-

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Python Base Classes, ZObjectManager, and Subobjects (fwd)

2002-01-28 Thread Ross Patterson

I'm transitioning a product from pure ZClasses to a hybrid product python base
classes and ZClasses.  So this is my first time working with python
products.

I'm trying to setup a python base class to provide a central place to
subclass ZObjectManager and CatalogAware that I can rebase later
without the ZClass hassle.  But when I try to create a ZClass in the
product and subclass to one of my python base classes, I don't get the
subobjects tab in my ZClass.

Clearly I'm missing somthing basic here, but I have scoured the docs
and mailing lists for a clue before coming here.  BTW, I did find this
post earlier that no one seemed to reply to, and below that are my
actual python files.

From the quoted message I can see that I need to do something with the
_zclass_, propertysheets, and manage_options of my base class.  Is
this documented anywhere.  I just gave up on reading the code.

---quoted message---

I want to create a Python base class that inherits from the
ObjectManager and has the Subobjects tab in the ZClass management
screen.  Inheriting from OFS.ObjectManager.ObjectManager does not do
this - I need to inherit from ZClasses.ObjectManager.ObjectManager.

I still don't know how to have the Subobjects propertysheet thing
work.  I've tried the two ways I listed in my last email of doing
this, but I can't get it to work.

One way was:

class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
  

class ZMyObjectManager:
Mix-in for Object Management


_zclass_=myObjectManager

propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

manage_options=(
{'label': 'Subobjects', 'action'
:'propertysheets/subobjects/manage'},
)

and then register ZMyObjectManager as a base class in __init__.py.
The other way was:

class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

manage_options=(
{'label': 'Subobjects', 'action'
:'propertysheets/subobjects/manage'},
)

and register that as the base class.  Neither of them work.

-- 
Itamar S.T.  [EMAIL PROTECTED]

---end quoted message---


#!/usr/bin/python
# __init__.py

from ZClasses import createZClassForBase

from PartBase import PartBase
from SitePartBase import SitePartBase
from ProjectPartBase import ProjectPartBase

def initialize( context ) :
createZClassForBase( PartBase, globals(), 'ZCPPartBase' )
createZClassForBase( SitePartBase, globals(), 'ZCPSitePartBase' )
createZClassForBase( ProjectPartBase, globals(), 'ZCPProjectPartBase' )

#!/usr/bin/python
# PartBases.py

from ZClasses.ObjectManager import ZObjectManager
from Products.ZCatalog.CatalogAwareness import CatalogAware

class PartBases ( CatalogAware, ZObjectManager ) :

Base Classes for all ZCP Parts


#!/usr/bin/python
# PartBase.py

from PartBases import PartBases

class PartBase ( PartBases ) :

Base Class for ZCP Parts


#!/usr/bin/python
# Products/ZCapitalProjects/SitePartBases.py

from PartBases import PartBases

class SitePartBase ( PartBases ) :

Base Class for ZCP Site Parts


#!/usr/bin/python
# Products/ZCapitalProjects/ProjectPartBases.py

from PartBases import PartBases

class ProjectPartBase ( PartBases ) :

Base Class for ZCP Project Parts


-
| Ross Patterson[EMAIL PROTECTED] |
| Programmer/Analyst(831)459-2792   |
| Physical Planning  Construction  Fax:(831)423-7436   |
| UC Santa Cruz http:www2.ucsc.edu/ppc  |
-



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Dieter Maurer

Chris Withers writes:
  A routine move to Python 2.1.2 this morning has resulted in one of our Zope
  instances continually dying with the following:
  
  zdaemon: Mon Jan 28 13:45:45 2002: Aiieee! 18724 exited with error code: 6
  
  Some questions:
  
  1. What does Error Code 6 mean?
Signal 6, SIGABRT (ABORT), used by the C runtime function abort

  Probably a failing assertion. Check standard error.
  You may find some hints.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Dieter Maurer

Olivier Deckmyn writes:
   This has been explained recently (-- mailing list archives, probably
   through Google search for f_stacksize).
  
  I did, without a great success.
  
  
   Summary, you need to upgrade Zope, too!
  
  If only I could...
Zope 2.4.3 will not work with Python 2.1.2.

Unfortunately, you either upgrade Zope or downgrade Python...

A partial upgrade may be possible, though. See the mailing list archives.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python 2.1.2 causes Error code 6?

2002-01-28 Thread Chris McDonough

This is probably caused by the assertion error raised by Python 2.1.2 in 
the case of a miscomputed stack size.  See my previous message.

Dieter Maurer wrote:

 Chris Withers writes:
   A routine move to Python 2.1.2 this morning has resulted in one of our Zope
   instances continually dying with the following:
   
   zdaemon: Mon Jan 28 13:45:45 2002: Aiieee! 18724 exited with error code: 6
   
   Some questions:
   
   1. What does Error Code 6 mean?
 Signal 6, SIGABRT (ABORT), used by the C runtime function abort
 
   Probably a failing assertion. Check standard error.
   You may find some hints.
 
 
 Dieter
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )
 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Chris McDonough

Dieter Maurer wrote:

 Zope 2.4.3 will not work with Python 2.1.2.


This is not literally true.  Zope 2.4.3 will work fine with Python 
2.1.2.  However, Python 2.1.2 doesn't ignore stacksize computation 
problems like Python 2.1.1.  Instead of silently corrutping memory and 
continuing like 2.1.1, Python 2.1.2 will stop with an assertion error. 
This means that Zope 2.4.3 won't really run under 2.1.2 for very long if 
you've got a codepath that tickles a compiler package bug, but at 
least it won't fail mysteriously with odd symptoms.  Zope 2.4.3 will run 
for *longer* under Python 2.1.1, but it will fail with other more 
mysterious symptoms.

Hopefully, this will clear some of the confusion up.

For maximum stability if you're running some 2.4.X-series Zope under 
Python 2.1.X:

- Upgrade your Zope to 2.4.4 (wait for final if you don't like the
   current beta status of 2.4.4)

- Upgrade your Python to 2.1.2

Do these two steps *at the same time*.  You should have increased 
stability and availability after that.

- C


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Zope 2.5.0 and VirtualHostMonster

2002-01-28 Thread Jesus Cea Avion

If you have problems with VirtualHostMonster and Zope 2.5.0, check
http://collector.zope.org/ColDev/64

-- 
Jesus Cea Avion _/_/  _/_/_/_/_/_/
[EMAIL PROTECTED] http://www.argo.es/~jcea/ _/_/_/_/  _/_/_/_/  _/_/
  _/_/_/_/  _/_/_/_/_/
PGP Key Available at KeyServ   _/_/  _/_/_/_/  _/_/  _/_/
Things are not so easy  _/_/  _/_/_/_/  _/_/_/_/  _/_/
My name is Dump, Core Dump   _/_/_/_/_/_/  _/_/  _/_/
El amor es poner tu felicidad en la felicidad de otro - Leibniz

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



RE: [Zope-dev] Zope 2.5.0 and VirtualHostMonster

2002-01-28 Thread Trevor Toenjes

We are considering upgrading from 2.4.0 to 2.5.0.  Does the same issue apply
to EnhancedVHM?

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
 Of Jesus Cea Avion
 Sent: Monday, January 28, 2002 5:01 PM
 To: [EMAIL PROTECTED]
 Subject: [Zope-dev] Zope 2.5.0 and VirtualHostMonster
 Importance: High


 If you have problems with VirtualHostMonster and Zope 2.5.0, check
 http://collector.zope.org/ColDev/64

 --
 Jesus Cea Avion _/_/  _/_/_/_/_/_/
 [EMAIL PROTECTED] http://www.argo.es/~jcea/ _/_/_/_/  _/_/_/_/  _/_/
   _/_/_/_/  _/_/_/_/_/
 PGP Key Available at KeyServ   _/_/  _/_/_/_/  _/_/  _/_/
 Things are not so easy  _/_/  _/_/_/_/  _/_/_/_/  _/_/
 My name is Dump, Core Dump   _/_/_/_/_/_/  _/_/  _/_/
 El amor es poner tu felicidad en la felicidad de otro - Leibniz

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Defining Interfaces

2002-01-28 Thread Adrian Hungate

This is based on the new Python 2.2 stuff, isn't it? I would guess the
answer would be You exclude the 'self' first arg in a class method.
Unfortunately I am still trying to digest what has changed in Python 2.2, so
I am probably not the best person to answer beyond this point. There was a
link on here (Or was it -announce) to the change docs for 2.2, that might
give you some pointers.

Adrian...

--
The difficulty of tactical maneuvering consists in turning the devious into
the direct, and misfortune into gain.
- Sun Tzu


- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: Jeffrey P Shell [EMAIL PROTECTED]
Cc: Steve Alexander [EMAIL PROTECTED]; zope-dev [EMAIL PROTECTED]
Sent: Monday, January 28, 2002 3:17 PM
Subject: Re: [Zope-dev] Defining Interfaces


 Jeffrey P Shell wrote:
 
  On 1/27/02 11:25 AM, Steve Alexander [EMAIL PROTECTED] wrote:
 
   Hi folks,
  
   When I define an Interface, are the methods of the interface supposed
to
   have self as the first argument?
 
  No.

 Can you expand on this a little?

 It doesn't make sense to me to exclude 'self'...

 cheers,

 Chris

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Defining Interfaces

2002-01-28 Thread Steve Alexander

Adrian Hungate wrote:
 This is based on the new Python 2.2 stuff, isn't it? I would guess the
 answer would be You exclude the 'self' first arg in a class method.

Not really. You exclude the self first argument of a static method. 
The first argument of a class method is where the class is passed.

The reason that self is now excluded when defining interfaces comes 
from considering who reads interface definitions.

By their nature, interfaces are meant to be read from the outside; 
from beyond the facade. The self attribute of methods is an 
implementation detail, and is not a concern of those who make calls on 
an interface.

With Python2.2, you can demonstrate this by defining a class that has 
static methods only, but which still satisfies some interface 
definition. The self argument need not occur at all.

--
Steve Alexander


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Error 11

2002-01-28 Thread Ahsan Imam

Applied the db.py patch and no success.
Currently dowloaded and
installed the Zope 2.4.4 beta 1

Python Version
python 2.1.2

ZMySQLDA

Here is a little excerpt from gdb
Would the following output have any special meaning?

gdb python core

#0  0x4008c8a5 in __sigsuspend (set=0x415cf19c) at
../sysdeps/unix/sysv/linux/sigsuspend.c:45
45  ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or
directory.
  in ../sysdeps/unix/sysv/linux/sigsuspend.c


 Matthew T. Kromer [EMAIL PROTECTED] 01/25/02 15:13 PM 
Ahsan Imam wrote:

Setting the variable did not help.
I downloaded and built Python 2.1.2 yesterday.

Products:
zope-tinytable-0.8.2-2
zope-zmysqlda-2.0.7-5

Chris McDonough [EMAIL PROTECTED] 01/24/02 12:22 PM 

Sigh.  Can you try to start Zope with the environment variable
ZOPE_SECURITY_POLICY=PYTHON set to see if the problem continues?

Are you using any database adapters or other C extensions?

Are you sure that Zope is using the Python 2.1.2 that you installed?


Try applying this patch to db.py in ZMySQLDA.

It makes it so MySQLDA database connections reopen themselves when the 
DA object migrates between threads.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Defining Interfaces

2002-01-28 Thread Jeffrey P Shell

On 1/28/02 8:17 AM, Chris Withers [EMAIL PROTECTED] wrote:

 Jeffrey P Shell wrote:
 
 On 1/27/02 11:25 AM, Steve Alexander [EMAIL PROTECTED] wrote:
 
 Hi folks,
 
 When I define an Interface, are the methods of the interface supposed to
 have self as the first argument?
 
 No.
 
 Can you expand on this a little?
 
 It doesn't make sense to me to exclude 'self'...

Jim [Fulton] explained it to me once.  He can explain it better than I can.
But think of it this way -- theoretically, an interface can be implemented
by a folder full of Python scripts as [relatively] easily as it can be
implemented by a class.  Should you then include all of the binding options
(context, container, etc)?

Or, if you were defining the interface in IDL (mmm,
almost-avoiding-redundancy through acronyms!) with the target language being
Python, would you include self?

An interface defines a contract on the usage of an object/component; it's
not necessarily a specification on how to implement it.  The concept of
'self' as the first argument for instance methods is a product of
implementing in a Python class (not to mention that 'self' is not a required
name, just an extremely common convention.  You could use 'this' just as
easily).  

The big theory behind most component models is that the implementation
shouldn't matter so long as certain interfaces are satisfied.  And the
following simple interface could be satisfied a number of ways in Zope
already - by a normal Python class implementation; by a folder with a Python
Script or External Method; by a ZClass with the same; or (in Python 2.2) by
a class with a static method (which would have no 'self').

class ISubscriber(Base):
 Subscriber base interface 
def EventService_inform(event):
 Informs the subscriber that the event has occurred 

-- 
Jeffrey P Shell 
www.cuemedia.com



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Error 11

2002-01-28 Thread Chris McDonough

You have a core file from the zdaemon process.. it's sorta useless as 
a result.  If you want to get a meaningful core file, run Zope without 
ZDaemon (pass -Z '' to the start script).

That said, we've confirmed crashbug problems in an installation with 
mysqlda in at least one customer site.  Can you make this problem happen 
without mysqlda?

Ahsan Imam wrote:

 Applied the db.py patch and no success.
 Currently dowloaded and
 installed the Zope 2.4.4 beta 1
 
 Python Version
 python 2.1.2
 
 ZMySQLDA
 
 Here is a little excerpt from gdb
 Would the following output have any special meaning?
 
 gdb python core
 
 #0  0x4008c8a5 in __sigsuspend (set=0x415cf19c) at
 ../sysdeps/unix/sysv/linux/sigsuspend.c:45
 45  ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or
 directory.
   in ../sysdeps/unix/sysv/linux/sigsuspend.c
 
 
 
Matthew T. Kromer [EMAIL PROTECTED] 01/25/02 15:13 PM 

 Ahsan Imam wrote:
 
 
Setting the variable did not help.
I downloaded and built Python 2.1.2 yesterday.

Products:
zope-tinytable-0.8.2-2
zope-zmysqlda-2.0.7-5


Chris McDonough [EMAIL PROTECTED] 01/24/02 12:22 PM 

Sigh.  Can you try to start Zope with the environment variable
ZOPE_SECURITY_POLICY=PYTHON set to see if the problem continues?

Are you using any database adapters or other C extensions?

Are you sure that Zope is using the Python 2.1.2 that you installed?


 
 Try applying this patch to db.py in ZMySQLDA.
 
 It makes it so MySQLDA database connections reopen themselves when the 
 DA object migrates between threads.
 
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )
 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Zope 2.5.0 and VirtualHostMonster

2002-01-28 Thread marc lindahl



 From: Trevor Toenjes [EMAIL PROTECTED]
 Date: Mon, 28 Jan 2002 17:16:12 -0500
 To: Jesus Cea Avion [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [Zope-dev] Zope 2.5.0 and VirtualHostMonster
 
 We are considering upgrading from 2.4.0 to 2.5.0.  Does the same issue apply
 to EnhancedVHM?
 

I was just testing 2.5 with that and don't see this bug


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Re: Python Base Classes, ZObjectManager, and Subobjects

2002-01-28 Thread Ross Patterson

Nobody's really answering and I keep getting both closer and further
looking at the ZClasses code.  As I understand it now,
ZClasses.ZClass.createZClassForBase is supposed to address the ZClass
meta class issues such as creating the _zclass_ in addition to the
actual class and handling propertysheets.  So I would assume that my
error lies somewhere in there, but I can't figure it out.

A few more notes, when I create a ZClass that subclasses my python base
class which in turn subclasses ZClasses.ObjectManager.ZObjectManager,
it creates a ZClass with a default View for Subobjects.  This
seems to indicate that somewhere the subobjects propertysheet is being
treated as an instance propertysheet rather than a propertysheet of
the ZClass meta class.

Also, when I create an instance from such a ZClass, trying to access
the instance in the ZMI yields an authorization error.  Following is
the traceback:

Traceback (innermost last):
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 150, in
publish_module
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 114, in
publish
  File /usr/Zope/lib/python/Zope/__init__.py, line 158, in
zpublisher_exception_hook
(Object: blah1)
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /usr/Zope/lib/python/ZPublisher/mapply.py, line 88, in mapply
(Object: manage_workspace)
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 39, in
call_object
(Object: manage_workspace)
  File /usr/Zope/lib/python/App/Management.py, line 76, in
manage_workspace
(Object: blah1)
Unauthorized: (see above)

I would assume this happens because the
propertysheets/subobjects/manage method listed in the view tab is not
valid for the instance, but trying to call that method on the ZClass
directly returns:

Traceback (innermost last):
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 150, in
publish_module
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 114, in
publish
  File /usr/Zope/lib/python/Zope/__init__.py, line 158, in
zpublisher_exception_hook
  File /usr/Zope/lib/python/ZPublisher/Publish.py, line 89, in publish
  File /usr/Zope/lib/python/ZPublisher/BaseRequest.py, line 278, in
traverse
  File /usr/Zope/lib/python/OFS/PropertySheets.py, line 601, in
__bobo_traverse__
AttributeError: subobjects

I have also tried the two variations in the quoted message below.
Then I tried the two variations below except substituting
ZClasses.ObjectManager.ZObjectManager for
ZClasses.ObjectManager.ObjectManager.  All with the same results

Again, my goal is to be able create a ZClass that subclasses a python
base class that in turn subclasses
ZClasses.ObjectManager.ZObjectManager in such a way that the final
ZClass and any other ZClasses that subclass it have a subobjects tab
in the management view of the ZClass.  Thanks.

On Sun, 27 Jan 2002, Ross Patterson wrote:

 I'm transitioning a product from pure ZClasses to a hybrid product python base
 classes and ZClasses.  So this is my first time working with python
 products.

 I'm trying to setup a python base class to provide a central place to
 subclass ZObjectManager and CatalogAware that I can rebase later
 without the ZClass hassle.  But when I try to create a ZClass in the
 product and subclass to one of my python base classes, I don't get the
 subobjects tab in my ZClass.

 Clearly I'm missing somthing basic here, but I have scoured the docs
 and mailing lists for a clue before coming here.  BTW, I did find this
 post earlier that no one seemed to reply to, and below that are my
 actual python files.

 ---quoted message---

 I want to create a Python base class that inherits from the
 ObjectManager and has the Subobjects tab in the ZClass management
 screen.  Inheriting from OFS.ObjectManager.ObjectManager does not do
 this - I need to inherit from ZClasses.ObjectManager.ObjectManager.

 I still don't know how to have the Subobjects propertysheet thing
 work.  I've tried the two ways I listed in my last email of doing
 this, but I can't get it to work.

 One way was:

 class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
   

 class ZMyObjectManager:
 Mix-in for Object Management
 

 _zclass_=myObjectManager

 propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

 manage_options=(
 {'label': 'Subobjects', 'action'
 :'propertysheets/subobjects/manage'},
 )

 and then register ZMyObjectManager as a base class in __init__.py.
 The other way was:

 class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
 propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

 manage_options=(
 {'label': 'Subobjects', 'action'
 :'propertysheets/subobjects/manage'},
 )

 and register that as the base class.  Neither of them work.

 --
 Itamar S.T.  [EMAIL PROTECTED]

 ---end quoted message---


#!/usr/bin/python
# Products/ZCapitalProjects/__init__.py

from ZClasses import createZClassForBase

from PartBases import 

Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Anthony Baxter

 Olivier Deckmyn wrote
 assertion STACK_LEVEL() = f-f_stacksize failed: file Python/ceval.c,
 line 687

This is a new assertion, put in to catch the case where the RestrictedCompiler
code used by PythonScripts incorrectly calculates stack size.

 After some hours of researches, I have a (dirty, really) fix :
 I had to modify Python sources and hack line 687 in ceval.c  : I removed
 it...

This is _not_ a fix, any more than putting in a signal handler for 
SIGSEGV that ignored it and kept going would be a fix for a segfault
bug. The bug is _real_ and causes memory corruption. The most likely 
result is that Zope will crash mysteriously, some time later down the 
track, but it's also possible you'll end up with random data corruption. 
This is _far_ worse than just a crash.

If upgrading to 2.5 or 2.4.4-to-be is not an issue, just replace the
lib/python/RestrictedPython package in your Zope installation and reboot.

Please, please, please, don't propagate dodgy and incorrect fixes like
the above (removing the assertion). The assertion is in the code for a
very, very good reason.

Anthony

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] [BUG] Python 2.1.2 Zope 2.4.1

2002-01-28 Thread Olivier Deckmyn

 Please, please, please, don't propagate dodgy and incorrect fixes like
 the above (removing the assertion). The assertion is in the code for a
 very, very good reason.

I obviously know this !! But couldn't find another way to have my servers
restart this sunday.

I just regret that this problem was not warned anywhere clearly. I must not
be the only one that have had seen this happen !

But I know it now :-)

Anyway, many thanx to every one who gave help.


Olivier.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )