[Zope-dev] Adding a permission to an ObjectManager derived ZCLass

2001-09-26 Thread Michael R. Bernstein

Hi all,

I posted this 24 hours ago on the main zope list, but didn't receive a
response, so I'm reposting here.

I've got an ObjectManager and Folder derived ZClass that contains
instances of a second rather simple ZClass.

It works fine, the Manager role can access the management interface of
the container, add edit and delete instances of the contained ZClass,
and Anonymous can view index_html.

Now, I am trying to add a permission to the container ZClass that will
let a user with a specialized role that has the permission view the
management interface (the 'Contents' tab) of the container and add,
edit, or delete the simple ZClass instances in the container.

The container doesn't have any property sheets, but the simple ZClass
does.

Does anyone have a simple walkthrough of what I need to do? The Zope
Book only discusses adding a permission to control access to a Property
Sheet.

Thanks in advance,

Michael Bernstein.



___
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: [DISCUSS] Committer agreement not even handed and threadening

2001-09-26 Thread Dieter Maurer

Paul Everitt writes:
 

The "Committer Agreement" does not seem to be even handed:

   The committer transfers rights immediately and indefinitely
   to Zope Corporation (the contributions become a gift to
   Zope Corporation).

   The agreement states explicitly that no rights are transfered
   to the committer.

   This is not a problem in itself. However

  My intention to contribute would be to strengthen
  the Open Source Movement. A statement that
  the supported code base (Zope) will remain open source
  and that committers will be able to use it (indefinitely)
  under terms comparable to the current ZPL would
  help to let the agreement to appear more balanced


The "Commitrer Agreement" is quite threadening:

   A committer takes over a considerable risk (complete warranty
   and indemnification with respect to intellectual rights infringement).

   The risk is far higher than that of a (german) employee.
   German employment law recognizes that

 *  all people make (sometimes) errors
 *  coping with isolated errors is far easier for
a larger community (the big employer) than
a single individual.

   Therefore, it uses the term "Fahrlässigkeit" (carelessness).
   An employee has to take all care to not make errors during
   his work. If something bad happens due to slight
   carelessness (leicht fahrlässig), then this is
   a general risk which has to be taken by the employer.
   If serious carelessness (grob fahrlässig) was the cause,
   then the employee has to take the consequences for himself.

   We should have something similar for the committer agreement
   (not restricted to intellectual property rights!).
   Maybe something like an insurance for slight carelessness
   cases...

   Otherwise, commiting anything might easily ruin an individual.
   Especially with the strange US Patent Laws (where almost
   everything (such as presenting information in a popup window
   or integrating a Web Frontend with a baking oven) can
   be patented) and incredibly high damages amounts
   (5 billion for a smoker who got cancer) assigned in US courts.


I will probably read replies to this message only in several weeks.
Don't be surprised when I remain silent for some time


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] Zope Dying

2001-09-26 Thread Andre Schubert

Hi,

Yesterday our Zope(2.2.5) on redhat 6.2 immunix was dying 3-4 times in
about 2 hours.
There are nothing to report in all the logs zope can produce.
But is there a way that zope makes a core dump when he is dying
unexpectly?

as

___
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] Web Services for Zope

2001-09-26 Thread Andy McKay

Ugh ZPT to read through my .py files?

Parsing the .py files is relatively straight forward, and writing out xml is
easy. But its bits like variable types that get tricky.

Cheers.
--
  Andy McKay.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 5:00 PM
Subject: RE: [Zope-dev] Web Services for Zope


> >>> {snip}
> >>>
> >>> trying-to-auto-generate-a-wsdl-from-my-product'ly yours
>
> Hmm... in the interim, what about using ZPT (+ParsedXML, of course) and a
> few python scripts to do this?
>
> Sean
> ___
> 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 )
>


___
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] Web Services for Zope

2001-09-26 Thread sean . upton

>>> {snip}
>>>
>>> trying-to-auto-generate-a-wsdl-from-my-product'ly yours

Hmm... in the interim, what about using ZPT (+ParsedXML, of course) and a
few python scripts to do this?

Sean
___
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 )



[Zope-dev] Web Services for Zope

2001-09-26 Thread Andy McKay

Can I ask what the current status of the WebServices for Zope project is?

http://dev.zope.org/Wikis/DevSite/Projects/WebServicesForZope/FrontPage

Wiki says "I had been shooting for something at the end of September, but
that has been overtaken by events :( I'll be trying to work on this on an
as-possible basis"

trying-to-auto-generate-a-wsdl-from-my-product'ly yours
--
  Andy McKay.


___
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 on Windows/Mac OS X: BatteriesIncludedDistribution

2001-09-26 Thread Richard Jones

I've just created the follwing fishbowl proposal:

  http://dev.zope.org/Wikis/DevSite/Proposals/BatteriesIncludedDistribution

Please read and comment.


Richard

___
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] Distributing Zope & one of our products

2001-09-26 Thread Richard Jones

On Thursday 27 September 2001 00:37, Simon Coles wrote:
> But of course at the moment we have to get them to:
>   - install Zope
>   - get, expand, and install the CMF (which is distributed as a .tgz,
> rather confounding Windows users)
>   - get our product and expand/install it
>   - then log in as the inituser, create a normal user, log out, log back
> in, create an ELN, then log out, then access the ELN, and join in the
> normal CMF fashion

What you're describing is exactly the issues (well, some of them :) that 
we've addressed in making Zope a viable out-of-the-box product for our 
commercial product. A result of our efforts are the two GUIs that we're 
making available - the Mac OS X and Windows Zope Controllers.

  http://www.bizarsoftware.com.au/resource_centre/articles/open_source.html

Note, the screenshots are a little different to the current version - but the 
general idea is still the same.

I hope to make a "batteries included" Zope distribution for both platforms 
that include the controllers and some pre-installed products. We don't know 
which products they'll be yet because the idea's still very young :)

Fishbowl proposal has been created - I'm announcing it in another thread.


Richard

___
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] Acquisition, __getattr__ and making a Proxy/Symlink class

2001-09-26 Thread Chris Withers

> Also, be sure optimize, because __getattr__ gets called *a lot*.  In 
> some cases, I've measured it getting invoked hundreds of thousands of 
> times in a single request!

Ouch! How was that happening?

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] Z2.log file not showing user name correctly

2001-09-26 Thread Chris McDonough

Someone (Shane?) claimed that 2.4.1 removes this "optimization".

- Original Message -
From: "R. David Murray" <[EMAIL PROTECTED]>
To: "George Nguyen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 4:40 PM
Subject: Re: [Zope-dev] Z2.log file not showing user name correctly


> On Wed, 26 Sep 2001, George Nguyen wrote:
> > I was looking in the entries in the Z2.log file and it
> > lists the user as being "Anonymous" when I'm actually
> > logged in as a validated user.
>
> This is very likely the result of an authentication...optimization?...done
> by the security machinery:  if the resource requires only Anonymous
> permission to access, then no further security checks are done,
> including identification of the user.  This leads to various unexpected
> behaviors, presumably this among them, and there has been at least
> one motion to change this behavior.  I don't know if it has made it
> into the Fishbowl yet or not.
>
> --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 )
>


___
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] Z2.log file not showing user name correctly

2001-09-26 Thread R. David Murray

On Wed, 26 Sep 2001, George Nguyen wrote:
> I was looking in the entries in the Z2.log file and it
> lists the user as being "Anonymous" when I'm actually
> logged in as a validated user.

This is very likely the result of an authentication...optimization?...done
by the security machinery:  if the resource requires only Anonymous
permission to access, then no further security checks are done,
including identification of the user.  This leads to various unexpected
behaviors, presumably this among them, and there has been at least
one motion to change this behavior.  I don't know if it has made it
into the Fishbowl yet or not.

--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] zLog and stderr

2001-09-26 Thread Dieter Maurer

Stefan H. Holek writes:
 > AFAIK, setting the STUPID_LOG_FILE envar in the start script will provide 
 > stdout/stderr to Zope.
"stderr" but not "stdout"

Long time ago, I switched to "STUPID_LOG_FILE=...".
>From this time on, I never again saw a write to "stderr"
appear outside the log file.

As someone else pointed out, all remaining outputs can be redirected
to a file. Under Unix, it would be "... > xxx 2>&1"


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] Acquisition, __getattr__ and making a Proxy/Symlink class

2001-09-26 Thread Dieter Maurer

Lupus Yonderboy writes:
 > I'm having some troubles trying to develop a
 > particular zope object and would really appreciate a
 > bit of help. I'll explain what I'm trying to do:
 > ...  Symbolic Link ...
I did not read your lengthy explanation, just got the above keyword

There is a "SymLink" product of Shane. Check whether it does what you
need.


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] DISCUSS: Community checkins for CVS

2001-09-26 Thread Dieter Maurer

Paul Everitt writes:
 > We'll probably work up some boilerplate such as, "I'm going to commit 
 > your patch to Zope.  It's going to be available under the ZPL and the 
 > joint ownership model of the Zope Contributor Agreement.  Please respond 
 > agreeing that you understand the ZPL, the joint ownership model, and 
 > allow this contribution under these terms."
 > 
 > How does that sound?
We should make this implicit!
... if possible as all under US law (and in view of the overwhelming
power of US lawyers ;-)).

  When someone submits a patch, then we can assume that
  the submitter does not only allow but wants that
  his patch is used in the Zope codebase, under
  the well known conditions for the Zope code.

I once had to sign such a patch use agreement for Python.

   It has been a 10 line patch including 6 lines of comment.
   Both me and Guido knew it has been pure stupidity to
   make such a fuzz about it, just to please lawyers


Please check, whether it is possible that submitting a patch
is sufficient that the patch can be used as far as the
submitter is concerned. There may be other rights infringed.
That still may need to be checked for significant changes.



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] zLog and stderr

2001-09-26 Thread Dieter Maurer

Toby Dickenson writes:
 > I think it makes sense that Zope should replace sys.stderr with an
 > object that sends messages to zLog, however zLog itself sometimes
 > wites to sys.stderr.
"zLog" writes to stderr only when there is no log file defined


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] Z2.log file not showing user name correctly

2001-09-26 Thread George Nguyen

I was looking in the entries in the Z2.log file and it
lists the user as being "Anonymous" when I'm actually
logged in as a validated user.

I'm using the LDAPLoginAdapter for my top-level
acl_users. I have no other acl_users folders.

Any comments?

George

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.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 )



[Zope-dev] StructuredText problem w/ literals & underlining

2001-09-26 Thread sean . bowman

hello,

I'm having a problem with StructuredText on Zope-2_4-branch under python
2.1.1.  Literals with underscores in them get rendered as underlined
rather than literals; for example, '__class_init__' gets rendered as

StructuredTextParagraph(["'_", StructuredTextUnderline('class'),
"init__'"], [
])

rather than 

StructuredTextParagraph(StructuredTextLiteral('__class_init__'), [
])

(which is how ClassicDocumentClass.DocumentClass renders it).

The following patch works for me, but perhaps I'm just confused about the
proper way of doing things with the StructuredTextNG package?  

regards,
Sean

--- DocumentClass.pyWed Sep 26 11:49:43 2001
+++ DocumentClassNew.py Wed Sep 26 11:48:55 2001
@@ -371,8 +371,8 @@
 'doc_href',
 'doc_strong',
 'doc_emphasize',
-'doc_underline',
 'doc_literal',
+'doc_underline',
 'doc_sgml',
 'doc_xref',
 ]



___
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] Create directory in LocalFS

2001-09-26 Thread Garry Steedman

when you're inside a LocalFS "folder", you can add a directory by 
simply adding a "folder", but obviously you need the permissions to 
create a directory in the FS (i.e. the Zope/Apache process needs the 
permissions)...

cheers,

Garry

On 26 Sep 2001, at 11:59, R. David Murray wrote:

From:   "R. David Murray" <[EMAIL PROTECTED]>
To: Jeff Nielsen / UgoFast <[EMAIL PROTECTED]>
Copies to:  <[EMAIL PROTECTED]>
Subject:RE: [Zope-dev] Create directory in LocalFS
Date sent:  Wed, 26 Sep 2001 11:59:32 -0400 (EDT)

> On Tue, 25 Sep 2001, Jeff Nielsen / UgoFast wrote:
> > I don't think I'm understanding you. I want to create the
> > subdirectory programmitcally inside a DTML Document. Are you
> > suggesting something like:
> >
> >  > "/images/Companies/100/manage_addProduct/OFSP/folderAdd(187)">
> 
> OFSP is Zope's Object File System Product.  So no, you wouldn't be
> using one of its methods to create a subfolder in a LocalFS folder.
> 
> What Dieter was asking/suggesting, is that you look at LocalFS's
> management system.  *If* it has a way of creating a subdirectory
> inside a LocalFS folder, then you could just take a peak at how it
> does it, to find out how to code it yourself in your own product.  If,
> however, LocalFS does *not* have a way of creating a subdirectory
> through its management interface, then you'll probably need to write
> an external method that uses python file system library functions to
> create the subdirectory.  I've never looked at LocalFS, so I don't
> know if that would be enough, or if you'd also have to call some
> LocalFS routines to let it know that the subdirectory now exists.
> 
> --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 )


+---+
  Garry Steedman  mailto:[EMAIL PROTECTED]  
  Styrax Associates  http://www.styrax.com/ 

  "The Good Man has no shape."
+---+

___
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] Create directory in LocalFS

2001-09-26 Thread R. David Murray

On Tue, 25 Sep 2001, Jeff Nielsen / UgoFast wrote:
> I don't think I'm understanding you. I want to create the subdirectory
> programmitcally inside a DTML Document. Are you suggesting something
> like:
>
>  "/images/Companies/100/manage_addProduct/OFSP/folderAdd(187)">

OFSP is Zope's Object File System Product.  So no, you wouldn't be using
one of its methods to create a subfolder in a LocalFS folder.

What Dieter was asking/suggesting, is that you look at LocalFS's management
system.  *If* it has a way of creating a subdirectory inside a
LocalFS folder, then you could just take a peak at how it does it,
to find out how to code it yourself in your own product.  If, however,
LocalFS does *not* have a way of creating a subdirectory through
its management interface, then you'll probably need to write an
external method that uses python file system library functions to
create the subdirectory.  I've never looked at LocalFS, so I don't
know if that would be enough, or if you'd also have to call some
LocalFS routines to let it know that the subdirectory now exists.

--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 )



[Zope-dev] Distributing Zope & one of our products

2001-09-26 Thread Simon Coles

Hi,

You may know that as well as doing Cool Things With Zope, we also do stuff 
with Electronic Lab Notebooks (ELNs) - not using Zope unfortunately, but 
that's another story.

Anyway, we have come up with an Open Source ELN (OS-ELN), which is based on 
Zope and the CMF. Readers of this forum will not be surprised to know that 
it didn't take much to turn Zope + CMF into quite a nice little ELN. For 
the curious, you can download what we have at http://www.opensourceeln.org/

What we're trying to do is make this thing approachable for people who 
don't know Zope, and indeed are somewhat unfamiliar with installing Open 
Source stuff on their machines.

Our primary target for a more approachable install is Windows users, as we 
feel Linux users are probably going to be OK with a more manual install.

The ideal would be to have single file they double click to install, answer 
a couple of simple questions in the install process, and then point their 
browser at their running ELN. Kind of like the existing Zope for Windows 
binary install...

But of course at the moment we have to get them to:
- install Zope
- get, expand, and install the CMF (which is distributed as a .tgz, 
rather
confounding Windows users)
  - get our product and expand/install it
  - then log in as the inituser, create a normal user, log out, log back in,
create an ELN, then log out, then access the ELN, and join in the normal
CMF fashion

What I'd like to do is customise the existing Zope installer to include the 
CMF and our OS-ELN, and to have an already-setup Data.fs.

That would really reduce the amount of work someone had to do to download 
and start playing with this, and of course once they've had a play they may 
well decide to invest more time in learning Zope and setting up a proper 
server for production use.

Does anyone have any thoughts as to the desirability of this, and the best 
way of doing it?

(BTW, I've always felt that "products" like Squishdot would really benefit 
from something like this as well. Maybe when Chris sees how easy this is to 
do for the OS-ELN ;-)

Thanks for any help,



Simon

- My opinions are my own, NIP's opinions are theirs --
Simon J. Coles Email: [EMAIL PROTECTED]
New Information Paradigms  Work Phone: +44 1344 753703
http://www.nipltd.com/ Work Fax:   +44 1344 753742
=== Life is too precious to take seriously ===

___
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] Acquisition, __getattr__ and making a Proxy/Symlink class

2001-09-26 Thread Shane Hathaway

Lupus Yonderboy wrote:

> I have tried hooking __getattr__ and have a hard time
> avoiding recursion; I have taken a look at the
> ever-productive Shane Hathaway's TransparentFolder
> product as well but I think I am let down by my lack
> of understanding of the particulars of acquisition.


Here are a few hints for avoiding recursion in __getattr__():

- Every attribute __getattr__ accesses that is expected to be in 
self.__dict__ should also be a class attribute.

- Use self.__dict__.get().

- The "self" passed to __getattr__ is *not* wrapped, as it is for other 
methods, meaning you can't access anything in the object's context from 
__getattr__.  CMF uses a combination of __of__(), volatile attributes, 
and Zope's threading model to get around this.

Also, be sure optimize, because __getattr__ gets called *a lot*.  In 
some cases, I've measured it getting invoked hundreds of thousands of 
times in a single request!

Shane


___
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] random regex

2001-09-26 Thread Andreas Jung


- Original Message - 
From: "seb bacon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 10:47
Subject: [Zope-dev] random regex


> I'm finding that the regex which deals with links in structured text
> is broken (Zope 2.4.1, Python 2.1).  If you try a link with a query
> string:
>  
>  "link":http://www.foo.com?ding=dong&bit=bat
> 
> the part of the regex which is matching the url only matches up to the
> first '=' (or '&').

This works for me with the latest checkout of the Zope-2_4-branch. Please
check if the problem persist.

Andreas


___
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] random regex

2001-09-26 Thread seb bacon

I'm finding that the regex which deals with links in structured text
is broken (Zope 2.4.1, Python 2.1).  If you try a link with a query
string:
 
 "link":http://www.foo.com?ding=dong&bit=bat

the part of the regex which is matching the url only matches up to the
first '=' (or '&').

If I run the expression against a string in the python interpreter,
the correct match is returned.  The problem only occurs in
lib/python/StructuredText/DocumentClass.py.  After a lot of playing
around with the expression, I found I could only get it to match
correctly *by running it against the same string three times in a
row*. 

Can anyone else reproduce this problem?  Has anyone any suggestions as
to what might be causing it?  Perhaps it's some kind of boundary
condition in the re module?  I don't really have the time to pursue it
much further, so it looks like I'll have to settle with a Tracker
entry and a nasty hack.

seb


___
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] zLog and stderr

2001-09-26 Thread Stefan H. Holek

On Wed, 26 Sep 2001, Toby Dickenson wrote:

> I have some old python modules which are generating messages from the
> new python 2.1 warning framework. I can easily fix these modules,
> however it has exposed a problem in Zope..
> 
> The warning framework tries to write to sys.stderr, and my Zope is
> dying from an exception because stderr has been closed.
> 
> I think it makes sense that Zope should replace sys.stderr with an
> object that sends messages to zLog, however zLog itself sometimes
> wites to sys.stderr.
> 
> Any thoughts on the right way to fix this?

AFAIK, setting the STUPID_LOG_FILE envar in the start script will provide 
stdout/stderr to Zope.

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] zLog and stderr

2001-09-26 Thread Steve Alexander

Toby Dickenson wrote:

> I have some old python modules which are generating messages from the
> new python 2.1 warning framework. I can easily fix these modules,
> however it has exposed a problem in Zope..

 >
 > The warning framework tries to write to sys.stderr, and my Zope is
 > dying from an exception because stderr has been closed.

I bumped into this with Python 1.5.2, and a print statement in the 
Threading module. This was causing me problems using Xron.

The solution was to use this at the end of the start script:

   >> /some/path/logs/zope_stdout.log 2>&1

I keep a separate script called start_debug that doesn't do this, and 
adds -D to the z2.py switches.


> I think it makes sense that Zope should replace sys.stderr with an
> object that sends messages to zLog, however zLog itself sometimes
> wites to sys.stderr.


I guess it would be nice to specify switches to z2.py to say that stderr 
should go to ZLog, and ZLog's stderr messages should get appended to a 
specified file.

--
Steve Alexander
Software Engineer
Cat-Box limited




___
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] Multithread transaction problems in ZODB

2001-09-26 Thread Paul Everitt


First, just a friendly reminder that there is a zodb-dev mailing list. 
On this, check out Andrew Kuchling's page about ZEO development:

   http://www.amk.ca/zodb/zodb-zeo.html

There's a section at the bottom with a brief discussion of 
ConflictError, what it means, and how to handle it.  Zope automatically 
does the retry, but Python develops have to handle it themselves.

Here's a link with some information about what's known as application 
level conflict resolution:

  http://www.zope.org/Members/jim/ZODB/ApplicationLevelConflictResolution

There's also some discussion at:

   http://www.zope.org/Documentation/Articles/ZODB2

Hope this helps...

--Paul

Cyril Elkaim wrote:

> Hi,
> 
>   We are testing ZODB directly from Python and have a multitread 
> ConflictError problem.
> 
>   In short :-) if we open a connection in a first thread, then a second 
> connection in a second thread and then commit the first one and then the 
> second (the transactions are so interlaced)...
> 
>   Not only we have the ConflicError, even if obviously we do not modify 
> or create the same objects. But in fact the last transaction doesn't 
> even have its own objects saved.
> 
>   We are using ZODB from Zope 2.4. We have a similar problem using 
> Berkeley Storage too (beta4).
> 
>   If the two threads are serialized eveything works fine (but that's no 
> more multithreading no? ;-)
> 
>   So is it possible to access ZODB from a multithreaded application?
> 
> 
> Thanks in advance
> 
> Cyril Elkaim
> 
> 
> ___
> 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 )



[Zope-dev] KeyError on UnIndex.keyForDocument

2001-09-26 Thread Morten W. Petersen

Hia,

While trying to reindex an entire catalog an error is raised, which looks
like this:

Traceback (innermost last):
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Zope/__init__.py,
line 221, in zpublisher_exception_hook
(Object: api)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: update_instances)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: update_instances)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Products/WarpFramework/catalog.py,
line 438, in update_instances
(Object: api)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Products/WarpFramework/catalog.py,
line 195, in __call__
(Object: Traversable)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Products/ZCatalog/ZCatalog.py,
line 535, in searchResults
(Object: Traversable)
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Products/ZCatalog/Catalog.py,
line 666, in searchResults
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/Products/ZCatalog/Catalog.py,
line 614, in _indexedSearch
  File
/home/morten/zope_instances/usr2/local/Zope-bcr/lib/python/SearchIndex/UnIndex.py,
line 453, in keyForDocument
KeyError: (see above)


Any clues?

Thanks a whole bunch,

Morten


___
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] Multithread transaction problems in ZODB

2001-09-26 Thread Cyril Elkaim

Hi,

   We are testing ZODB directly from Python and have a multitread 
ConflictError problem.

   In short :-) if we open a connection in a first thread, then a second 
connection in a second thread and then commit the first one and then the 
second (the transactions are so interlaced)...

   Not only we have the ConflicError, even if obviously we do not modify 
or create the same objects. But in fact the last transaction doesn't 
even have its own objects saved.

   We are using ZODB from Zope 2.4. We have a similar problem using 
Berkeley Storage too (beta4).

   If the two threads are serialized eveything works fine (but that's no 
more multithreading no? ;-)

   So is it possible to access ZODB from a multithreaded application?


Thanks in advance

Cyril Elkaim


___
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] ImportError (No module names utils)

2001-09-26 Thread Morten W. Petersen

Hi,

after using a module named utils in a Zope product the root management
screen is no longer available (the module is now renamed).

The traceback looks like this:

Traceback (innermost last):
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/Zope/__init__.py, line
226, in zpublisher_exception_hook
(Object: ApplicationDefaultPermissions)
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_main)
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: manage_main)
  File
/home/morten/tmp/Zope-2.4.1-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 324, in __call__
(Object: manage_main)
  File
/home/morten/tmp/Zope-2.4.1-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 354, in _bindAndExec
(Object: manage_main)
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/App/special_dtml.py,
line 244, in _exec
(Object: manage_main)
  File
/home/morten/tmp/Zope-2.4.1-src/lib/python/DocumentTemplate/DT_In.py, line
711, in renderwob
(Object: objectItems)
  File
/home/morten/tmp/Zope-2.4.1-src/lib/python/DocumentTemplate/DT_In.py, line
839, in sort_sequence
(Object: objectItems)
  File /home/morten/tmp/Zope-2.4.1-src/lib/python/ZODB/Connection.py, line
544, in setstate
ImportError: (see above)


Any ideas?

Thanks,

Morten


___
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] zLog and stderr

2001-09-26 Thread Toby Dickenson

I have some old python modules which are generating messages from the
new python 2.1 warning framework. I can easily fix these modules,
however it has exposed a problem in Zope..

The warning framework tries to write to sys.stderr, and my Zope is
dying from an exception because stderr has been closed.

I think it makes sense that Zope should replace sys.stderr with an
object that sends messages to zLog, however zLog itself sometimes
wites to sys.stderr.

Any thoughts on the right way to fix this?


Toby Dickenson
[EMAIL PROTECTED]

___
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] Acquisition, __getattr__ and making a Proxy/Symlink class

2001-09-26 Thread Steve Alexander

Lupus Yonderboy wrote:

> 
> Can anyone shed some light on how i might do this? All
> objects under the DocumentRoot will be derived from
> one of our base classes, so if we need to override
> __getattr__ as per TransparentFolders it can be done
> easily.


Have you looked at the __bobo_traverse__ traversal hook?

   http://www.zope.org/Documentation/ZDG/ObjectPublishing.dtml

--
Steve Alexander
Software Engineer
Cat-Box limited



___
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] monitor_client.py in Zope 2.4.1 not working properly

2001-09-26 Thread Morten W. Petersen

Hi,

I've been playing a bit with the monitor_client (ZServer/medusa), and it
seems all exceptions aren't raised so it's visible in the client, it's
seen in the debug output from Zope itself.

Has anyone experienced this?

-Morten


___
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 )