Re: [Zope-dev] Traversal Barf

2001-07-11 Thread Steve Alexander

Casey Duncan wrote:

 seb bacon wrote:
 
I've been getting a puzzling error.  It's not reliably reproduceable.
It occurs perhaps one time in four when I'm using Opera.  At first, it
appeared only to be related to Opera, but now I'm getting the same
error in netscape.  I can just hit refresh and it works again.
There's no sign of anything like ConflictErrors or the like on the
console.

Has anyone seen this before?  What could it be?

 snip 

 File /usr/local/Zope/lib/python/DocumentTemplate/DT_Let.py, line 146, in render
(Object: rootpath=absolute_url())
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval
(Object: absolute_url())
(Info: absolute_url)
  File string, line 0, in ?
  File /usr/local/Zope/lib/python/OFS/Traversable.py, line 119, in absolute_url
(Object: Traversable)
KeyError: SERVER_URL

Cheers,

seb


 
 I have seen a similar traceback which was due to a bug in CopyPaste.py,
 to which I have submitted a patch. It had to do with a lack of an
 acquisition wrapper at an inopportune time. It looks as though
 absolute_url() is being called without a proper wrapper around the
 object it is begin called for.


Looks to me like absolute_url() is being called when absolute_url(1) 
should be used.

--
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] Re: [ZPatterns] HowTo: Make an Image/File a DataSkin ???

2001-07-11 Thread Steve Alexander

Steve Spicklemire wrote:

 
 Hi Ulrich,
 
   Hmm.. can you just call DataSkin.__init__(self, id) in the File's constructor?


You might need to do it like this:

   DataSkin.inheritedAttribute('__init__')(self, id)

--
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] How long below the radar?

2001-07-11 Thread Martijn Faassen

Rene Pijlman wrote:
 On 10 Jul 2001 08:06:42 +0200, you wrote:
 | How about treating some of the most critically needed Zope modules
 | as a community project?
 I agree totally.
 
 So what do you think are the most needed Zope products?

Form tools! :)

Uhmm. Check. Feel free to join the community project at:

http://www.zope.org/Members/faassen/Formulator

I'll be giving a presentation to the community this friday in Berlin,
too.

Another thing I'm getting back involved in now is the whole Zope
XML picture. I think good support for things such as XSLT, XPath,
XLink and so on could add a lot of value for lots of people, and
would do wonders for the enterprise buzzwordability of Zope, as well. 

e-commerce infrastructure is nice too, of course. Someone else can
do that. :)

What Zope also needs is a set of good clear APIs for component developers,
and it needs something like the 'new religion' that's on a wiki somewhere;
model/view/controller type architecture. If you think this can't be
a community project as it's too advanced then I'll tell you that thought
is the bane of community projects. Community projects can do anything! :)
But as with any open source project, the community project will only succeed
if there is one dedicated person (or a small group of dedicated people) that
does all the work anyway.

The opening of the Zope CVS for outside developers will help here too,
hopefully. 

Regards,

Martijn


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



[Fwd: Re: [Zope-dev] Management Interface in ZODB]

2001-07-11 Thread Tim R Ansell



 Original Message 
Subject: Re: [Zope-dev] Management Interface in ZODB
Date: Tue, 10 Jul 2001 22:29:46 +0930
From: Tim R Ansell [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Andreas Jung [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
036d01c10889$be6cd5f0$9865fea9@SUXLAP [EMAIL PROTECTED]
06b001c10934$ac429a80$9865fea9@SUXLAP

As soon as i submitted to the collector i figured out the
SUPPRESS_CUST_MANAGE bug and found a new quirk. The new quirk seems
to be that the manage_options get inherited downwards as well (in a
kinda additive way). I'm yet to figure this one out as i did little to
change the manage_tabs stuff...

Anyway it would be nice if i could get some comments etc. about the
patch, do people think this is the right way to go? etc.?

Mithro


Andreas Jung wrote:
 
 I just saw your submission to the collector. Do you need
 any further assistance ?
 
 Andreas
 - Original Message -
 From: Tim R Ansell [EMAIL PROTECTED]
 To: Andreas Jung [EMAIL PROTECTED]
 Sent: Dienstag, 10. Juli 2001 05:03
 Subject: Re: [Zope-dev] Management Interface in ZODB
 
  Andreas Jung wrote:
  
   From: Tim R Ansell [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Montag, 9. Juli 2001 09:03
   Subject: [Zope-dev] Management Interface in ZODB
  
   
What do people think of this patch? Is there a better way to do this?
 Is
it possible to get a patch similar to this integrated into the Zope
 core
because it's an extremely useful.
  
   If you like to provide patches to the Zope core please use the collector
   to submit the patches.
  
 
  Is there some HowTo for using the collector, a search on the website
  doesn't seem to return much useful information.
 
   Andreas
  
   P.S. Please don't post larger patches to the mailing list. Instead
   put the patches on your member page on www.zope.org and write a small
   announcement with the URL of the patches.
 
 
  BTW is there anywhere you can download single zope files? Like a CVSWeb
  etc?
 
  Mithro
 

___
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] Traversal Barf

2001-07-11 Thread seb bacon

* Steve Alexander [EMAIL PROTECTED] [010711 07:59]:
 KeyError: SERVER_URL

  I have seen a similar traceback which was due to a bug in CopyPaste.py,
  to which I have submitted a patch. It had to do with a lack of an
  acquisition wrapper at an inopportune time. It looks as though
  absolute_url() is being called without a proper wrapper around the
  object it is begin called for.

 Looks to me like absolute_url() is being called when absolute_url(1) 
 should be used.

I didn't know about the absolute_url(relative=1) switch.  Do virtually
hosted envirnoments not have a SERVER_URL variable?  

However, I don't think this is the problem.  

(1) I'm not in a virtual hosting scenario
(2) it happens at fairly random intervals *on the same page*.  

I can be working on a page, then reload it, and I get the KeyError.
Then I can reload it again and the error goes.  Then I go back to it,
reload it again, and the error appears.  Reload it again and the error
remains.  Reload it again and it disappears again...  You get the
idea. 

This makes it very difficult to debug.  I left my computer on
overnight, without changing any app settings, and haven't seen the
error yet today.

My feeling is that Casey's right.  It's happening on a CMF object
to which I've added BeforeTraverse hooks, which could possibly have
something to do with it.  However, I've actually seen this problem
before, about a year ago, with a completely unrelated ZClass-based
objects.  I remember then noticing that the error occured more often
with Netscape and Opera than IE.  Of course, that theory is utter
nonsense seeing as HTTP is a connectionless protocol and the headers
each browser sends are effectively the same.  However, in the absence
of a reproduceable error, I have to clutch at straws ;-)

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] Re: [ZPatterns] HowTo: Make an Image/File a DataSkin ???

2001-07-11 Thread Ulrich Eck

 
 You might need to do it like this:
 
DataSkin.inheritedAttribute('__init__')(self, id)
 

can you give me a hint what this actually does or
where it comes from (ExtensionClass.Base or Persistence...)?

when do I need to use this and how is it compareable to 

DataSkin.__init__(self,id)
or
DataSkin.__init__.im_func(self,id) ??

I have tried the above and it didn't work in this case .. now I
have the DataSkin Method the first that a PortalImage is
subclassed from and needed to overlay _setId() to coop
with Image.__name and DataSkin.id .. it works .. but I
have no idea what drawbacks this could have.

thanks for your help .. I nearly got it ..

cu
Ulrich Eck




___
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] Patching Zope Products Question

2001-07-11 Thread Ulrich Eck


 Ulrich Eck wrote:
  
  I'm not shure however, what format this should be distributed .. for unix a 
  CMF-ZPatterns-Patch
  would probably be best .. other plattforms do not have this .. any comments ??
 
 Make it into a Product that patches the CMF classes at runtime.
 
 See Zope Hotfixes fot a template to work from.
 


I have for example this modification of PortalContent:

## added for ZPatterns
from Products.ZPatterns.DataSkins import DataSkin

## changed for ZPatterns
class PortalContent(DataSkin, DynamicType, SimpleItem):

Base class for portal objects.
  
.

so I need to completely replace the 
Products.CMFCore.PortalContent.PortalContent
with a new class defined (mainly copied from original)
 in the __init__ of the Patch?

can I do this with:
--
import Products.CMFCore.PortalContent

define myclass here 

InitializeClass(myclass)
Products.CMFCore.PortalContent.PortalContent = myclass
--

Is it the same to replace a class  in a module than replacing 
a method/attribute in a Class ??

thanks

Ulrich Eck


___
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] XMLDocument Memory Leak

2001-07-11 Thread Dean Jenkins

I've found a memory leak in the XMLDocument Product by Amos at DC.

I use it for storing and presenting small XML documents (30-40 lines or so)
and do only simple things such as ...

dtml-in getElementsByTagName('option')
trtd bgcolor=#99dtml-var text_content()/td/tr
/dtml-in

by 'viewing' the document with a method thus ...

anEMQtobeshown/viewEMQ

I suspected it may be the cause of a memory leak but haven't been able to
trace it until using the LeakFinder product.

The refcounts for

Products.XMLDocument.XMLDocument.Element
Products.XMLDocument.Node.Text

increase and increase until python is using most of my physical memory and
the server grinds to a halt.

http://www.onexamination.com/

I have tried patching the classes as suggested in the LeakFinder useage but
have no results to show.

Anyone else using XMLDocument? Can someone plug the leak?

Dean Jenkins.


___
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] masquerading python products as functions

2001-07-11 Thread Mick

Hi,

I am trying to make a product act like an external method, or dtmlmethod.
Basically I have taken the minimal product and added a __call__ function.
It works fine, and can be called as a function of the object that contains
it.  The problem is that the minimal objects namespace is also pushed onto
the stack, and to get out of it I need to go through self.aq_parent.
Reading though all the help I could find I tried adding the following (as
DTMLMethod suggests.)

#Documents masquerade as functions
class func_code: pass
func_code=func_code()
func_code.co_varnames='self','RQUEST','RESPONSE'
func_code.co_argcount=3


This doesn't seem to do anything to the namespace problem.  Actually,
reading through DTMLMethod and ExternalMEthod aren't helping at all.
mapply.py seems equally unhelpful, though I can see some of what it is
trying to do.  Reading it also made me wonder why people say the above code
make Documents masquerade as functions, it seems in mapply, that if __call__
is defined, then it is bound to f in mapply anyway.  It seems to me to be in
the __call__ method that things are important where namespaces are passed to
HTML.__call__

I am obviously missing some fundamental points or sequences that would help
me to understand this, I was hoping someone could point me in the right
direction, either documentation, or some simple explanation, that would make
reading through that code more obvious.

I am running Zope 2.4.0b2 on python 2.1.

regards
Mick


___
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] Re: [ZPatterns] HowTo: Make an Image/File a DataSkin ???

2001-07-11 Thread Phillip J. Eby

At 08:03 AM 7/11/01 +0100, Steve Alexander wrote:
Steve Spicklemire wrote:

Hi Ulrich,
 Hmm.. can you just call DataSkin.__init__(self, id) in the 
 File's constructor?


You might need to do it like this:

   DataSkin.inheritedAttribute('__init__')(self, id)

Actually, I'm not sure you need to do anything special at all.  If you use 
the File DataSkin in a Folder w/Customizer Support, you shouldn't need to 
do anything special, because in that mode the 'id' attribute is never used 
by ZPatterns.  If you need to use these File DataSkins in a Rack, though, 
you'll need to include a SkinScript that says::

  WITH SELF COMPUTE id=getId()

Racks still use the id attribute directly, I'm afraid.  Your '__init__' 
method will still need to accept an 'id' parameter, also, and you'd need to 
set the __name__ attribute instead of id.  Ugh.

Anyway, I will take a look at Rack and see if it can be made to use the 
'getId()' and 'setId()' methods.  Of course, you can also subclass Rack and 
replace the '_getClientID(client)' method with one that uses 'getId()', but 
it might be that I could do this safely in the base Rack class.

The SkinScript examples should also probably be changed to use 'getId()' 
instead of 'id' so that people don't use them as a justification for 
continuing to indulge in deprecated behavior.  :)


___
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] Management Interface in ZODB IT WORKS! Feed back NEEDED!

2001-07-11 Thread Tim R Ansell


Okay everything works as it should now

This patch allows you to store the Zope management interfaces inside the
ZODB. It does this by making the manage stuff inheritable and giving the
defaults to the root of the folder (This means that the management can't
be changed for the root folder - which in my opinion is a good thing.)

To override the manage_page_header, all you need to do is create a DTML
Method (other method types should work as well but haven't been tested)
with the id manage_page_header. This will replace manage_page_header for
ALL object below the folder the method was created in. 

This means that you can lock your self out of the management screens
(say by putting !-- in the manage_page_header). To get around this you
can use the special SUPPRESS_CUST_MANAGE object. This object must be
inserted AFTER the object that has the offending manage stuff but before
the actual manage. For example;

 /Folder_with_cust_manage/SUPPRESS_CUST_MANAGE/manage_main
and
 /Folder_with_cust_manage/SUPPRESS_CUST_MANAGE/Normal_Folder/manage_main
and
 /Folder_with_cust_manage/Normal_Folder/SUPPRESS_CUST_MANAGE/manage_main

would work but

 /Folder_with_cust_manage/manage_main/SUPPRESS_CUST_MANAGE
or
 /SUPPRESS_CUST_MANAGE/Folder_with_cust_manage/manage_main
or 
 /Folder_with_cust_manage/Normal_Folder/manage_main/SUPPRESS_CUST_MANAGE

wouldn't.

I've tested this patch and are yet to find any problems with it.

This in theory should allow template folders to apply templates to any
object below themselves (through the normal standard_html_header/footer)
and to the object's management screens (through the
manage_page_header/footer). Without modification of any of the zope
source. 

It allows  you to quickly provide a different look for the management
screens on a per site bases (when you are virtual hosting). This could
be invaluable if some company wants to BADGE the management screens of
their zope site.

NOTE: This patch doesn't currently let you override 'manage'

Would it be possible for somebody to review this patch for me and tell
me if there are any inherent problems with the way i have done this?

This is an actual patch and is relatively small so i've attached it to
the bottom of this email, hope this is okay

Mithro

PS: I can't seem to update the collector Item with this new patch?

Tim R Ansell wrote:
snip

diff -w -b -B -c -r -d --exclude=Products --exclude=sedscript --exclude=var 
--exclude=pcgi --exclude=*.c --exclude=*.pyc --exclude=*.zexp --exclude=*.xml 
--exclude=*.so --exclude=Extensions --exclude=Zope.cgi --exclude=core --exclude=fcgi 
--exclude=*.bak --exclude=#*# --exclude=Makefile* --exclude=z2.py --exclude=*~ 
--exclude=start --exclude=stop --exclude=Setup --exclude=*.old 
./download/Zope-2.3.2-src/lib/python/App/Management.py 
./zope/lib/python/App/Management.py
*** ./download/Zope-2.3.2-src/lib/python/App/Management.py  Wed Jan 17 09:26:53 
2001
--- ./zope/lib/python/App/Management.py Wed Jul 11 21:47:07 2001
***
*** 94,107 
  from Globals import DTMLFile, HTMLFile
  from string import split, join, find
  from AccessControl import getSecurityManager
  
  class Tabs(ExtensionClass.Base):
  Mix-in provides management folder tab support.
  
- manage_tabs__roles__=('Anonymous',)
- manage_tabs=DTMLFile('dtml/manage_tabs', globals())
- 
- 
  manage_options  =()
  
  filtered_manage_options__roles__=None
--- 94,104 
  from Globals import DTMLFile, HTMLFile
  from string import split, join, find
  from AccessControl import getSecurityManager
+ import Acquisition
  
  class Tabs(ExtensionClass.Base):
  Mix-in provides management folder tab support.
  
  manage_options  =()
  
  filtered_manage_options__roles__=None
***
*** 135,141 
  
  return result
  
- 
  manage_workspace__roles__=('Anonymous',)
  def manage_workspace(self, REQUEST):
  Dispatch to first interface in manage_options
--- 132,137 
***
*** 193,202 
  out.append(last)
  return join(out, '/')
  
! Globals.default__class_init__(Tabs)
! 
  
  class Navigation(ExtensionClass.Base):
  Basic navigation UI support
  
  __ac_permissions__=(
--- 189,203 
  out.append(last)
  return join(out, '/')
  
! class RealTabs(ExtensionClass.Base):
! manage_options = ()
! manage_tabs__roles__=('Anonymous',)
! manage_tabs=HTMLFile('dtml/manage_tabs', globals())
  
  class Navigation(ExtensionClass.Base):
+ manage = DTMLFile('dtml/manage', globals())
+ 
+ class RealNavigation(Navigation, ExtensionClass.Base):
  Basic navigation UI support
  
  __ac_permissions__=(
***
*** 207,218 
)),
  )
  
! manage=DTMLFile('dtml/manage', globals())
! manage_menu   =DTMLFile('dtml/menu', globals())
  
! manage_top_frame  =DTMLFile('dtml/manage_top_frame', globals())
! 

[Zope-dev] How long below the radar?

2001-07-11 Thread jimbo

Hold that thought.  In order to fully answer the question I have to ask myself why I 
choose to use a below the radar system in the first place. I'ts said that nothings 
truly *Free* as in product advertising everything has its cost.  When we look at the 
*cost* compared to other systems Zope/Python wins hands down in all the *right* areas. 
 Its just plain abuse of money and power that keeps Zope/Python where it is. Does'nt 
matter if it's coming from this camp or another something must be done soon. It boils 
down to this.
  Back in the old days if you had something faster, quicker, and better you cleary 
would be the winner.  Too many people were worried about their evestments so of course 
they stuck with the *hot* tickets.  But it would be too expensise to go head to head 
with the big boys no I think that true interprise is going to be in turmoil.  For 
Instance now that things like MCSE, and CISCO are now part of public college 
institutions that means what?  The climate is such that if its not Microsoft or Sun 
forget it.  I'm not knocking either company I support them 100%.  But here's my 
example.
  I'm taking a course at a local college and I sit next to a guy that says he only 
needs to get his MCSE and he will be gainfully employed.  I asked him if he felt the 
need to learn any programming languages and he said no. I doubt very much that this 
person would ever be inclined to select anything Zope/Python. The big companies spent 
their money well. Do like they do.DC needs to create Zope Certificatied 
Desginer/Technicans and shops.  Make it commercial *looking* as *freely* possible.
  Ok back to whats wrong with it. Secure E-commerce Support out the box is one thing. 
I think we need to hear more of zope coming from out of the major players mouth as a 
major player.
  Or is it?  There are quite a few choices out there, but what really makes 
Zope/Python the clear winner.  They already have most of the commercial qualities 
needed to be the best of the best. 
We have to make them see the value. like Red Hat Distros, Certifications, and  plug 
and play software.  Things like Talk shows would be nice.

Hey I got dibs on the Zope Certification/Testing center track/fishbowl/proposal thing 
if one doesnt already exist?  and it's possible for a 3rd party to do such a thing.

The thing that I can't understand is that in my state the government workers 
threatened to strike, and dot-coms failed because of money problems. They also have 
millions tied up in building a technology center. My thing is that Things like 
Zope/Python should be taught/used right along side the others in the schools.  DC 
should be sending free to schools an easy to install package that allows them to have 
some limited *commercial* looking front-end. If they can actually see and feel and 
*burn* copies of an actuall cool looking product CD with all the products on the CD.

I need some sleep,
Cheerio

-Jimbo

___
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] Traversal Barf

2001-07-11 Thread Casey Duncan

seb bacon wrote:
 
 * Steve Alexander [EMAIL PROTECTED] [010711 07:59]:
  KeyError: SERVER_URL
 
   I have seen a similar traceback which was due to a bug in CopyPaste.py,
   to which I have submitted a patch. It had to do with a lack of an
   acquisition wrapper at an inopportune time. It looks as though
   absolute_url() is being called without a proper wrapper around the
   object it is begin called for.
 
  Looks to me like absolute_url() is being called when absolute_url(1)
  should be used.
 
 I didn't know about the absolute_url(relative=1) switch.  Do virtually
 hosted envirnoments not have a SERVER_URL variable?
 

This actually points to a lack of an acquireable REQUEST object. If you
look at the code in absolute_url, it tries to acquire REQUEST and if it
can't, it sets it to {}. Then when it does a REQUEST['SERVER_URL'] later
on it gets a KeyError. I personally think this code is very brittle, but
it does work 99.99% of the time.

 However, I don't think this is the problem.
 
 (1) I'm not in a virtual hosting scenario
 (2) it happens at fairly random intervals *on the same page*.

This is very weird. I would expect it to act consistently. I hate that!

 
 I can be working on a page, then reload it, and I get the KeyError.
 Then I can reload it again and the error goes.  Then I go back to it,
 reload it again, and the error appears.  Reload it again and the error
 remains.  Reload it again and it disappears again...  You get the
 idea.

Is it truely random or an every-other reload sort of regularity? I have
a feeling you'll pick the former.

 
 This makes it very difficult to debug.  I left my computer on
 overnight, without changing any app settings, and haven't seen the
 error yet today.
 
 My feeling is that Casey's right.  It's happening on a CMF object
 to which I've added BeforeTraverse hooks, which could possibly have
 something to do with it.  

Can you experiment with removing/changing these hooks?
Can you post the code for your object?

 However, I've actually seen this problem
 before, about a year ago, with a completely unrelated ZClass-based
 objects.  I remember then noticing that the error occured more often
 with Netscape and Opera than IE.  Of course, that theory is utter
 nonsense seeing as HTTP is a connectionless protocol and the headers
 each browser sends are effectively the same.  However, in the absence
 of a reproduceable error, I have to clutch at straws ;-)
 
 seb

The browser differences may point to caching differences that make it
seem as though it is working.

Any DCians have any insights?

-- 
| Casey Duncan
| Kaivo, Inc.
| [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] Traversal Barf

2001-07-11 Thread Casey Duncan

seb bacon wrote:
 
 OK, I've found out some more stuff about the problem.  Of course, it
 wasn't really random.  The culprit is a linked stylesheet.  Every time
 I alter the sheet in some way, I get the SERVER_URL KeyError.

Good, at least we know *when* it happens.
 
 I can't really see why this should be happening, though.  The
 absolute_url() in question is in the main body of the document, not
 the stylesheet.

Can we see the code for your page? What is the stylesheet, a DTML obj,
ZStyleSheet, etc?
 
 Is perhaps the acquisition wrapper not getting applied to the document
 until after the linked objects are also downloaded, or something
 strange like that?

No, that is client-side stuff.

 
 I haven't the time time to pursue this right now, but I'll attempt to
 make a simple, reproduceable example and submit it to the Tracker.
 But just in case I get time to debug it, where might I start?  I'm not
 very familiar with the Traversal / Publishing stuff.

I'm happy to help if I can.
 
 seb
 

-- 
| Casey Duncan
| Kaivo, Inc.
| [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] masquerading python products as functions

2001-07-11 Thread Casey Duncan

Mick wrote:
 
 Hi,
 
 I am trying to make a product act like an external method, or dtmlmethod.
 Basically I have taken the minimal product and added a __call__ function.
 It works fine, and can be called as a function of the object that contains
 it.  The problem is that the minimal objects namespace is also pushed onto
 the stack, and to get out of it I need to go through self.aq_parent.
 Reading though all the help I could find I tried adding the following (as
 DTMLMethod suggests.)

Yes, the current object is at the top of the namespace in general.

DTML Methods get around this with the client argument which defaults to
None. AFAIK This represents the containment namespace to use for
execution.

 
 #Documents masquerade as functions
 class func_code: pass
 func_code=func_code()
 func_code.co_varnames='self','RQUEST','RESPONSE'
 func_code.co_argcount=3

From what I read, this tells ZPublisher what arguments to pass by
default to the object when it is called by traversal. Since client is
omitted from co_varnames, it defaults to None, which tells the DT_String
machinery (Which executes the DTML code) to do a containment-less
execution.

The DTML interpreter just does lookups though a namespace mapping
passed in. Perhaps you could do something similar in your
implementation.

 
 This doesn't seem to do anything to the namespace problem.  Actually,
 reading through DTMLMethod and ExternalMEthod aren't helping at all.
 mapply.py seems equally unhelpful, though I can see some of what it is
 trying to do.  Reading it also made me wonder why people say the above code
 make Documents masquerade as functions, it seems in mapply, that if __call__
 is defined, then it is bound to f in mapply anyway.  It seems to me to be in
 the __call__ method that things are important where namespaces are passed to
 HTML.__call__
 
 I am obviously missing some fundamental points or sequences that would help
 me to understand this, I was hoping someone could point me in the right
 direction, either documentation, or some simple explanation, that would make
 reading through that code more obvious.
 
 I am running Zope 2.4.0b2 on python 2.1.
 
 regards
 Mick
 

-- 
| Casey Duncan
| Kaivo, Inc.
| [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] ZODBCA for Python 2.1

2001-07-11 Thread Matthew T. Kromer

Andy McKay wrote:
 
 Since the source of ZODBCA is not available could someone in DC compile this
 for Python 2.1 / Zope 2.4? Or make the source available? Pretty please :)
 
 http://www.zope.org/Products/DA/ZODBCDA
 
 Thanks.
 --
   Andy McKay.

Hey, AFAIK the src directory inside the ZODBCDA tarball is the
source; I spent a few moments and rebuilt the SQL.PYD file for
Python2.1.  The replacement SQL.PYD file is at

   http://www.zope.org/Members/matt/ZODBCDA/sql.pyd

Just copy that over the top of the existing sql.pyd file in
lib/python/Products/ZODBCDA and you should be back.  I make zero
guarantees how well it works -- I only recompiled it, and I
don't use it myself.

___
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] Patching Zope Products .. next Question

2001-07-11 Thread Ulrich Eck

 can I do this with:
 --
 import Products.CMFCore.PortalContent
 
 define myclass here 
 
 InitializeClass(myclass)
 Products.CMFCore.PortalContent.PortalContent = myclass
 --

ok this works but there is another tricky thing now ... 

I need to patch two products: CMFCore and CMFDefault.

first i patch CMFCore and I think this works (at least a portalfolder
is a customizerfolder :)

I have now 2 new Classes PortalFolder and PortalContent ..

but 

the CMFDefault.Document for example is still subclassed from 
CMFCore.PortalContent (the default) and therefore doesn't behave
like a dataskin ..

any ideas ?

is the order in wich the modules are loaded known or changeable ??

if this doesn't work .. I need to release the patches as diffs or tarballs
replacing CMFDefault and Core .. not as nice as just patching them ..

thanks

Ulrich Eck


___
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] ZODBCA for Python 2.1

2001-07-11 Thread Andy McKay


 Hey, AFAIK the src directory inside the ZODBCDA tarball is the
 source; I spent a few moments and rebuilt the SQL.PYD file for
 Python2.1.  The replacement SQL.PYD file is at

Doh! Thanks mate.

Thanks for rebuilding it, visual studio did a quick barf when I tried it.
We'll be putting this under some pressure so I'll let you know how it goes.

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



Re: [Zope-dev] Patching Zope Products .. next Question

2001-07-11 Thread R. David Murray

On Wed, 11 Jul 2001, Ulrich Eck wrote:
 the CMFDefault.Document for example is still subclassed from 
 CMFCore.PortalContent (the default) and therefore doesn't behave
 like a dataskin ..
 
 any ideas ?

You can hotpatch the __bases__ attribute of the derived class.

--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] Patching Zope Products .. next Question

2001-07-11 Thread marc lindahl

Would this approach be appropriate?

http://dev.zope.org/Members/Caseman/Dynamic_HotFix_News/Dynamic_Hotfix

 From: Ulrich Eck [EMAIL PROTECTED]
 Date: Wed, 11 Jul 2001 19:33:15 +0200
 To: ZOPE-DEV Mailingliste [EMAIL PROTECTED]
 Subject: [Zope-dev] Patching Zope Products .. next Question
 
 can I do this with:
 --
 import Products.CMFCore.PortalContent
 
 define myclass here 
 
 InitializeClass(myclass)
 Products.CMFCore.PortalContent.PortalContent = myclass
 --
 
 ok this works but there is another tricky thing now ...
 
 I need to patch two products: CMFCore and CMFDefault.
 
 first i patch CMFCore and I think this works (at least a portalfolder
 is a customizerfolder :)
 
 I have now 2 new Classes PortalFolder and PortalContent ..
 
 but 
 
 the CMFDefault.Document for example is still subclassed from
 CMFCore.PortalContent (the default) and therefore doesn't behave
 like a dataskin ..
 
 any ideas ?
 
 is the order in wich the modules are loaded known or changeable ??
 
 if this doesn't work .. I need to release the patches as diffs or tarballs
 replacing CMFDefault and Core .. not as nice as just patching them ..
 
 thanks
 
 Ulrich Eck
 
 
 ___
 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] How long below the radar?

2001-07-11 Thread jimbo

Case in point.

I'm at my local technical college library looking for material.  No books on UML or 
Python. Ok fine they don't teach either one. They don't plan on carring a copy of the 
Zope book when it comes out.

btw wondering when do the people that won *free*  copies get theirs.
  I should be on that list.
I made suggestions on what I could do to petition/campaign them to carry the book, and 
they said write something up.
  Personally when I think of *library* I think of a respository of tidbits of 
information stored in some manner for me to conviently access.  Zope is free for 
anyone to access and use. It is a tool and it is knowledge.
  Something must be wrong if the library is skewed towards closed source commercial 
products because students aren't getting the *big* picture.

  If you asked me and I were in charge of and the leader of OSS I would go after half. 
If commercial products are going to be in public schools like Cisco, and Microsoft, 
then so should OSS. This way if you shoot for half you'll end up with something.


Doing my part,
-Jimbo

___
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] guid

2001-07-11 Thread Mark McEahern

Hi, does Python or Zope have native facilities (i.e., not depending on
CoCreateGuid()) for generating guids?

If not, what do folks generally use to generate globally unique identifiers?

Thanks,

// mark


___
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] masquerading python products as functions

2001-07-11 Thread Lalo Martins

On Wed, Jul 11, 2001 at 11:38:20PM +1200, Mick wrote:
 Hi,
 
 I am trying to make a product act like an external method, or dtmlmethod.
 Basically I have taken the minimal product and added a __call__ function.
 It works fine, and can be called as a function of the object that contains
 it.  The problem is that the minimal objects namespace is also pushed onto
 the stack, and to get out of it I need to go through self.aq_parent.

You may want to try out Shared.DC.Scripts.Script.

I have a (preliminary) HOWTO at
http://www.zope.org/Members/lalo/scriptclass-dev

[]s,
   |alo
   +
--
http://www.laranja.org/mailto:[EMAIL PROTECTED]
 pgp key: http://www.laranja.org/pessoal/pgp

Brazil of Darkness (RPG)  ---   http://www.BroDar.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] Help !!!

2001-07-11 Thread atul dedhia
Hi,
I'm a student, doing my Masters in Clinet/Server Computing. I was interested in Content Server stuff, thats why I decided to do my master project on Content Server. 
I was going through the web, and found Zope Application server, and decided to work on it.Right now Zope works with any web server that supports the Common Gateway Interface (CGI). I want to develope some adapter that willenable Zopeworking with any web serverthat supports ASP. 
I downloaded the Zope source code that is available at http://www.zope.org/Products/Zope/2.3.3 
I want to play with the source code of Zope application server to have a better idea of this application, butcouldn't find any good documentation. I'm wandering whether thats the only peace of code availble for users? Is that full source code for Zope Application server, if not where can I get the full source code? Do u know any documentation which will be helpful for understanding and playing aound with source code??
Please respond to this mail if u have answer to my questions.
Thanks,
AtulDo You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!http://personal.mail.yahoo.com/

RE: [Zope-dev] Help !!!

2001-07-11 Thread Mark McEahern



One of 
the links on that page ends in -src.tgz. That's the source to 
Zope.

Cheers,

// 
mark

-Original Message-From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of atul dedhiaSent: 
Wednesday, July 11, 2001 10:34 PMTo: 
[EMAIL PROTECTED]Subject: [Zope-dev] Help !!!
Hi,
I'm a student, doing my Masters in Clinet/Server Computing. I was interested 
in Content Server stuff, thats why I decided to do my master project on Content 
Server. 
I was going through the web, and found Zope Application server, and decided 
to work on it.Right now Zope works with any web server that supports the 
Common Gateway Interface (CGI). I want to develope some adapter that 
willenable Zopeworking with any web serverthat supports ASP. 

I downloaded the Zope source code that is available at http://www.zope.org/Products/Zope/2.3.3 

I want to play with the source code of Zope application server to have a 
better idea of this application, butcouldn't find any good documentation. 
I'm wandering whether thats the only peace of code availble for users? Is 
that full source code for Zope Application server, if not where can I get the 
full source code? Do u know any documentation which will be helpful for 
understanding and playing aound with source code??
Please respond to this mail if u have answer to my questions.
Thanks,
Atul


Do You Yahoo!?Get personalized email addresses from Yahoo! Mail - 
only $35 a year!http://personal.mail.yahoo.com/