[Zope-dev] ZWikiZC comments

2000-08-28 Thread Ross Boylan

Two substantive comments, and some editorial ones.

You write that you are thinking of different schemes for generating
paths and ids.  I suggest one of the things you consider is whether
your scheme will work if someone cuts the ZWikiZC and pastes it
somewhere else in the tree.

I'm not sufficiently versed in the different methods you discussed to
understand their implications--they seem to involve yet more
undocumented interfaces in Zope.


Second, I think the facility for email notification of changes is
really interesting.  It seems to me that a problem with the Wiki
concept (for some uses) is that they are very difficult to monitor for
changes.  Sending email, perhaps combined with diff, could help with
this.


Editorial comments:

"Summary" is spelled with an "a" (not summery).
"Product" is spelled with a "c" (not produkt).
Since these words are prominent in the documentation, and at least one
(summary) is to be a critical method, it would be good to clean this up.

The "!" in the paths baffled me (e.g., "!WikiPage").

Why Catalogs distinguish metadata from indices also eludes me.  It
should be explained in the Z/Catalog writeup, but since it's not, it
was there to bother me while I read your description.

It's hazardous to claim a performance advantage without benchmarks.


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

2000-08-28 Thread Steve Alexander

In the latest Zope source, I've noticed calls to inheritedAttribute in
the Python code.

I've found the C source code in ExtensionClass.c, but it doesn't help me
understand when I should use it from Python, and why.


*reads more source*

Ah! About 70 lines further on in ExtensionClass.c:

   "inheritedAttribute(class,name) -- Get an inherited attribute\n\n"
   "Get an attribute that would be inherited if the given (extension)\n"
   "class did not define it.  This method is used when overriding\n"
   "inherited methods.  It provides 2 advantages over accessing\n"
   "\n"
   "attributes directly through a superclass:\n"
   "\n"
   "1. The superclass need not be known,\n"
   "\n"
   "2. The superclass may be a Python class.  Without this method, it
would\n"
   "   be possible to override methods inherited from python classes
because\n"
   "   unbound methods gotten from Python classes cannot be called with
\n"
   "   extension class instances.  \n"


Is there some documentation of this on zope.org or dev.zope.org that
I've missed?

Thanks.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
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] New version of BTreeFolder

2000-08-28 Thread Shane Hathaway

Hi gang,

This version just fixes a bug with the folder contents tab on Windows. 
For some reason, on Windows 95 (and perhaps other platforms) the Python
interpreter behaves differently enough that if you use a class
attribute from a different module and put it in your own class, you may
in fact be modifying its global context.  It's probably a bug in
Python.  As a workaround, this version of BTreeFolders doesn't have the
"details" tab anymore.

http://www.zope.org/Members/hathawsh/BTreeFolder/BTreeFolder-0.1.1.tar.gz

BTW has anyone done any semi-formal speed tests?  It's rumored that a
custom getattr in Python can cause a bit of a slowdown.  We could write
a custom getattr in C to solve the problem.  But we don't want to do
any premature optimization.

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 )




[Zope-dev] Transaction question

2000-08-28 Thread Johan Carlsson

I just want to check if things work the way I think (hope) it does.

In a transaction, are objects attributes safe from other threads.

self._v_mytemp in my request does not conflict with other requests?

(I suppose the have to be otherwise REQUEST's would interfere with each other.)

I know that _v_* attributes aren't persistent but do they remain active in memory
and there by accessible to other requests after the transaction commit?

(I suppose class attributes needs to be protected to be thread-safe?
 Does anybody have an example how to do that?)

Regards,
Johan

___
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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread LEE Kwan Soo

Oh, well, I'd bet this is a silly question. But I can not resist nor find answer by 
myself.

Q: Why don't you BTree-fy all the subclasses of ObjectManager? 
Is there a reason that anyone but can a newbie see?

LEE Kwan Soo.

ps. I only hope to be able to make clear statement in English, but i am already too 
sleepy now. sorry.

- Original Message - 
From: "Shane Hathaway" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 28, 2000 10:26 PM
Subject: [Zope-dev] New version of BTreeFolder


 Hi gang,
 
 This version just fixes a bug with the folder contents tab on Windows. 
 For some reason, on Windows 95 (and perhaps other platforms) the Python
 interpreter behaves differently enough that if you use a class
 attribute from a different module and put it in your own class, you may
 in fact be modifying its global context.  It's probably a bug in
 Python.  As a workaround, this version of BTreeFolders doesn't have the
 "details" tab anymore.
 
 http://www.zope.org/Members/hathawsh/BTreeFolder/BTreeFolder-0.1.1.tar.gz
 
 BTW has anyone done any semi-formal speed tests?  It's rumored that a
 custom getattr in Python can cause a bit of a slowdown.  We could write
 a custom getattr in C to solve the problem.  But we don't want to do
 any premature optimization.
 
 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 )
 
 

___
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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread Shane Hathaway

LEE Kwan Soo wrote:
 
 Oh, well, I'd bet this is a silly question. But I can not resist nor find answer by 
myself.
 
 Q: Why don't you BTree-fy all the subclasses of ObjectManager?
 Is there a reason that anyone but can a newbie see?

Obviously what BTreeFolder does should be available in standard
folders.  That is a long-term goal for Zope.  BTreeFolder only exists
to scope out the need for big folders as well as provide the capability
in the short term.

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] New version of BTreeFolder

2000-08-28 Thread Kapil Thangavelu

Shane Hathaway wrote:
 
 Hi gang,
 
 This version just fixes a bug with the folder contents tab on Windows.
 For some reason, on Windows 95 (and perhaps other platforms) the Python
 interpreter behaves differently enough that if you use a class
 attribute from a different module and put it in your own class, you may
 in fact be modifying its global context.  It's probably a bug in
 Python.  As a workaround, this version of BTreeFolders doesn't have the
 "details" tab anymore.
 
 http://www.zope.org/Members/hathawsh/BTreeFolder/BTreeFolder-0.1.1.tar.gz
 
 BTW has anyone done any semi-formal speed tests?  It's rumored that a
 custom getattr in Python can cause a bit of a slowdown.  We could write
 a custom getattr in C to solve the problem.  But we don't want to do
 any premature optimization.
 
 Shane

I'll work on some tests.

Kapil

___
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] Transaction question

2000-08-28 Thread Chris McDonough

Using a mutex by way of example, without using anything Zope-specific
(the following uses the Python threading module):

import threading
lock = threading.Lock()
myglobal = []

def changeglobal(val):
lock.acquire()
try:
myglobal.append(val)
finally:
lock.release()

  (I suppose class attributes needs to be protected to be thread-safe?
   Does anybody have an example how to do that?)
 
 You can use allocate_lock() to accomplish thread safety with class
 attributes.

___
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] Transaction question

2000-08-28 Thread Erik Enge

[Shane Hathaway]

| Johan Carlsson wrote:
|  
|  I just want to check if things work the way I think (hope) it does.
|  
|  In a transaction, are objects attributes safe from other threads.
|  
|  self._v_mytemp in my request does not conflict with other requests?
| 
| This is correct (or it's supposed to be.) 

What do you mean by "supposed to be"?  Is it, or is it not correct?

___
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] Transaction question

2000-08-28 Thread Shane Hathaway

Erik Enge wrote:
 
 [Shane Hathaway]
 
 | Johan Carlsson wrote:
 | 
 |  I just want to check if things work the way I think (hope) it does.
 | 
 |  In a transaction, are objects attributes safe from other threads.
 | 
 |  self._v_mytemp in my request does not conflict with other requests?
 |
 | This is correct (or it's supposed to be.)
 
 What do you mean by "supposed to be"?  Is it, or is it not correct?

It means that a correctly operating ZODB will behave this way.  I
suspected that Johan may have been facing some kind of ZODB bug,
therefore I qualified my statement.  The phrasing was designed to
elicit a response if he were indeed facing a defect.

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] Transaction question

2000-08-28 Thread Johan Carlsson

  | 
  |  I just want to check if things work the way I think (hope) it does.
  | 
  |  In a transaction, are objects attributes safe from other threads.
  | 
  |  self._v_mytemp in my request does not conflict with other requests?
  |
  | This is correct (or it's supposed to be.)
  
  What do you mean by "supposed to be"?  Is it, or is it not correct?
 
 It means that a correctly operating ZODB will behave this way.  I
 suspected that Johan may have been facing some kind of ZODB bug,
 therefore I qualified my statement.  The phrasing was designed to
 elicit a response if he were indeed facing a defect.

I haven't experienced any problems so far, but I havn't tested it yet either.
The reason I asked was to not make any stupied assumptions before starting
coding.
If I experience any problems I'll let you know, naturally :-)

Cheers,
JOhan



___
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] Transaction question

2000-08-28 Thread Erik Enge

[Shane Hathaway]

| It means that a correctly operating ZODB will behave this way.

Oh, I see.  Thanks for clarifying that.  :)

___
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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread Bill Anderson

Shane Hathaway wrote:
 
 LEE Kwan Soo wrote:
 
  Oh, well, I'd bet this is a silly question. But I can not resist nor find answer 
by myself.
 
  Q: Why don't you BTree-fy all the subclasses of ObjectManager?
  Is there a reason that anyone but can a newbie see?
 
 Obviously what BTreeFolder does should be available in standard
 folders.  That is a long-term goal for Zope.  BTreeFolder only exists
 to scope out the need for big folders as well as provide the capability
 in the short term.


Any chance at a BTree Folder w/customizer suppor tin the near future? :)

--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread Shane Hathaway

Bill Anderson wrote:
 Any chance at a BTree Folder w/customizer support in the near future? :)

It should be quite easy to do.  I vaguely recall Steve A or Steve S
might have done it.

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] New version of BTreeFolder. Just a Newbie Question

2000-08-28 Thread Steve Alexander

Bill Anderson wrote:

 
 Any chance at a BTree Folder w/customizer suppor tin the near future? :)

I did some work towards this. However, I didn't continue.

I realised that I could get the same effect by having a BTreeFolder 
inside a Customizer Folder. The only downside is a slightly longer URL 
for objects in the BTreeFolder.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
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] ZPatterns bug with patch

2000-08-28 Thread Steve Alexander

"Phillip J. Eby" wrote:
 
 At 10:22 AM 8/27/00 +0100, Steve Alexander wrote:
 
 I've fixed this by adding a test to the start of __set_attr__ of
 DataSkins.py:
 
 def __set_attr__(self,name,val,_v_dm_=_v_dm_):
 +   if name=='id' and val==self.__dict__['id']:
 +   return
 dm = self.__dict__[_v_dm_]
 
 This looks reasonable, and backward-compatible, since __init__ guarantees
 the dict will have an id.  I'm not thrilled with adding more overhead to
 attribute setting, however, so I'll probably do it like this:
 
 try:
 dm = self.__dict__[_v_dm_]
 except KeyError:
 if name=='id' and val==self.__dict__['id']: return
 raise
 
 Hopefully this should only perform the extra computations when the first
 part fails...

Are Python classes derived from DataSkin supposed to call
DataSkin.__init__ ?

Anyway, perhaps this would be a small improvement:

try:
dm = self.__dict__[_v_dm_]
except KeyError:
if (name=='id' and self.__dict__.has_key('id') 
and val==self.__dict__['id']): return
raise


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
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] New version of BTreeFolder

2000-08-28 Thread Shane Hathaway

Steve Alexander wrote:
 BTreeFolder doesn't do the
 
 from Globals import default__class_init__
 default__class_init__(BTreeFolder)
 
 thing.
 
 Does that matter at all?
 
 As none of the classes it is derived from have a __init__ method, I
 guess not. Or, does default__class_init__ do anything else?

It converts __ac_permissions__ into usable permissions declarations
(__roles__ attributes.)  default__class_init__ really ought to be
there; it's only recently that Brian started saying we need to use it
everywhere.  I forgot.  :-)

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] ZPatterns bug with patch

2000-08-28 Thread Steve Alexander

 "Phillip J. Eby" wrote:
  
  try:
  dm = self.__dict__[_v_dm_]
  except KeyError:
  if name=='id' and val==self.__dict__['id']: return
  raise
  
  Hopefully this should only perform the extra computations when the first
  part fails...

 Are Python classes derived from DataSkin supposed to call
 DataSkin.__init__ ?

 Anyway, perhaps this would be a small improvement:

 try:
 dm = self.__dict__[_v_dm_]
 except KeyError:
 if (name=='id' and self.__dict__.has_key('id') 
 and val==self.__dict__['id']): return
 raise

What rubbish! I didn't mean that at all!

I think what I meant was this:

try:
dm = self.__dict__[_v_dm_]
except KeyError:
if name=='id':
if self.__dict__.has_key('id') and val==self.__dict__.['id']:
return
else:
self.__dict__['id']=val
return
raise  


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
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] ZPatterns bug with patch

2000-08-28 Thread Steve Alexander

Steve Alexander wrote:
  
 What rubbish! I didn't mean that at all!
 
 I think what I meant was this:
 
 try:
 dm = self.__dict__[_v_dm_]
 except KeyError:
 if name=='id':
 if self.__dict__.has_key('id') and val==self.__dict__.['id']:
 return
 else:
 self.__dict__['id']=val
 return
 raise

I think what I *really* meant was this:

try:
dm = self.__dict__[_v_dm_]
except KeyError:
if name=='id':
if self.__dict__.has_key('id') and val==self.__dict__['id']:
return
else:
self.__dict__['id']=val
self._p_changed = 1
return
raise

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
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] ANN: ZWikiZC version 0.7.3 alpha

2000-08-28 Thread Johan Carlsson

The ZWikiZC version 0.7.3 alpha completely rely on ZCatalog
for looking up WikiPages from WikiNames.

No references are stored in the ZWikiZG page letting cutpaste,
delete and other management actions ignore updating links.

I bellew this is a more scalable solution than in the version 0.7.2 alpha.
Bottle neck might be if a page contains alote of WikiNames.

I also cleaned it up a bit (remove some hacky stuff from the old ZWiki).

Also added are keywords, wiki_meta_types and author_ids.

http://www.zope.org/Members/johanc/ZWikiZG/wiki

Cheers,
Johan Carlsson


___
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] ANN: ZWikiZC version 0.7.3 alpha

2000-08-28 Thread Johan Carlsson

The ZWikiZC version 0.7.3 alpha completely rely on ZCatalog
for looking up WikiPages from WikiNames.

No references are stored in the ZWikiZG page letting cutpaste,
delete and other management actions ignore updating links.

I bellew this is a more scalable solution than in the version 0.7.2 alpha.
Bottle neck might be if a page contains alote of WikiNames.

I also cleaned it up a bit (remove some hacky stuff from the old ZWiki).

Also added are keywords, wiki_meta_types and author_ids.

http://www.zope.org/Members/johanc/ZWikiZG/wiki

Cheers,
Johan Carlsson


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