Re: [Zope-dev] Still no safe seperators :P

2000-08-17 Thread Evan Simpson

From: "Chris Withers" <[EMAIL PROTECTED]>
> Looks like the colon it is then, there's even a patch now ;-)

There a patch sitting around waiting for DTML syntaxgeddon which allows
slash-separated paths in object names everywhere, not just in entity syntax.
That could easily be extended to also allow colons as separators.

Cheers,

Evan @ 4-am & digicool


___
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] "stemmed and stopped": problems with stopwords andthe 'and' operator

2000-08-17 Thread R. David Murray

On Thu, 17 Aug 2000, Martijn Pieters wrote:
> No clues as to where you'll find the stopword code, but the Persistence
> thingy is caused by the magic that ZODB performs: it initializes the
> correct Persistence module when it itself is imported. This way Jim
> managed to have ZODB3 and BoboPOS2 exist in the same Zope distribution.
> 
> Do an import ZODB before you do your Splitter import, and all will be
> dandy.

Thanks, worked like a charm.

I think I've found the stopword code.  To cement my understanding
I'm going to write this up.  Maybe somebody will find it useful .

UnTextIndex accesses the splitter through the Splitter method of the
Lexicon associated with the index.  That Lexicon instance is created
when the Vocabulary or Catalog are created.  (Comments in the code
indicate that in the future each TextIndex could have its own Lexicon,
which makes sense to me.)  A Lexicon instance can be passed a list
of stop words (and/or synonyms) when it is initialized.  Vocabulary
does this for Lexicon (but not GlobbingLexicon, which internal
comments indicates does not use stopwords).  The Lexicon instance
stores this list in a property, and passes it to the real Splitter
when its Splitter method is called.

So the fix that I submitted earlier today to the collector for the 'and'
involving stopwords should work for 'listed' stopwords as well as
the punctuation and numbers that I was able to test it on.  (In my
comments in the patch I said I wasn't sure).  I still can't test it
because I'm using a Globbing lexicon .

In perusing the code I'm also feeling more confident that the
change I made to __getitem__ in that fix is in fact semantically
correct.  Or at least consistent with the rest of the __getitem__ code.

GlobbingLexicon not using stopwords also explains the few hits
on 'the and car' that I got that I was confused by.  Those entries
really must have 'the' as an indexed term, unlike the rest.

Oh, by the way, the comments in TextIndex seem to agree with me
as to the conventional meaning of the word 'stemmed' .

--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] Data.fs

2000-08-17 Thread R. David Murray

On Thu, 17 Aug 2000, Andre Schubert wrote:
> My Questions are: is there a way to delete the last transaction from

One answer: use tranalyzer to find the offset of the start of the
last transaction and truncate the file there.

> Data.fs, and can i backup the Data.fs when Zope is running. Is the

Yes.

> backup of Data.fs inconsitent when i make the backup at the same time a
> user writes to it?

No.  If the last transaction in Data.fs s incomplete, Zope will ignore it on
startup.

--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] Re: Acquisition ( slightly less Confusion ;-)

2000-08-17 Thread Evan Simpson

From: Chris Withers <[EMAIL PROTECTED]>
> Ah, okay... so really, prettymuch all Zope objects should be wrapped
> with only one or two exceptions, most of which aren't actually objects
> as such but simple data types?

Yes.

> > Also, there is a
> > very limited range of "natural" ways to construct the wrappers.  Once
> > contructed, of course, we can fool with them in arbitrary ways.
>
> So I see, does this reduce efficiency at all?

Sure, but the question is, does it reduce efficiency *unacceptably*, and I
can't answer that.

> > container.  The simplification is the rule (A o B) o (B o C) => A o (B o
C).
>
> I don't see how this simplification actually makes a difference...

In the next step, if we ask for a D and it's found in B, we get:

(A o (B o C)).D => (B o C).D o (A o (B o C)) => ((D o B) o (B o C)) o (A o
(B o C)) => (D o (B o C)) o (A o (B o C))

instead of

((A o B) o (B o C)).D => (A o B).D o ((A o B) o (B o C)) => ((D o B) o (A o
B)) o ((A o B) o (B o C))

The search order with simplification is D, B, C, A (containment first),
while without it's D, B, A, C (just plain weird).

Cheers,

Evan @ digicool & 4-am


___
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] Still no safe seperators :P

2000-08-17 Thread Chris Withers

Phil Harris wrote:
> 
> How about >
> 
> as in
> 
> &dtml-path>to>file>object>wotsit;
> 
> nah, looks really ugl

And I'm damn sure that's bad XML ;-)

Looks like the colon it is then, there's even a patch now ;-)

cheers,

Chris

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




Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Phil Harris

How about >

as in

&dtml-path>to>file>object>wotsit;

nah, looks really ugl




- Original Message -
From: "Chris Withers" <[EMAIL PROTECTED]>
To: "Phil Harris" <[EMAIL PROTECTED]>
Cc: "Shane Hathaway" <[EMAIL PROTECTED]>; "Jonothan Farr" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, August 17, 2000 10:27 PM
Subject: Re: [Zope-dev] Aaargh, no safe seperators :S


> Phil Harris wrote:
> >
> > -, that;s a hyphen to you
>
> and that can appear in ids ;-)
>
> cheers,
>
> Chris


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




Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Chris Withers

Phil Harris wrote:
> 
> -, that;s a hyphen to you

and that can appear in ids ;-)

cheers,

Chris

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




[Zope-dev] patch for &dtml-foo:bar:baz;

2000-08-17 Thread Steve Alexander

This patch changes lib/python/DocumentTemplate/DT_HTML.py so that you
can use paths for traversal in DTML entity syntax. The delimiter is ':',
as it is valid as part of an XML entity, but not valid as part of a Zope
object id.

You can use &dtml-:foo:bar; to ensure that traversal occurs from the
root object.

This patch is against Zope 2.2.1b1. It relies on the
restrictedTraverse() api.

A 2.1.x version would be possible, but would be rather messy.

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

*** DT_HTML.py.old
--- DT_HTML.py
***
*** 98,104 
 end_match=regex.compile('[\0- ]*\(/\|end\)',
 regex.casefold).match,
 start_search=regex.compile('[<&]').search,
!ent_name=regex.compile('[-a-zA-Z0-9_.]+').match,
 find=find,
 strip=strip,
 replace=replace,
--- 98,104 
 end_match=regex.compile('[\0- ]*\(/\|end\)',
 regex.casefold).match,
 start_search=regex.compile('[<&]').search,
!ent_name=regex.compile('[-a-zA-Z0-9_.:]+').match,
 find=find,
 strip=strip,
 replace=replace,
***
*** 156,162 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! d[3]=d['args']=args+' html_quote'
  return s
  else:
  nn=find(args,'-')
--- 156,165 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! d[3]=d['args']=':' in args \
! and '"_.render(restrictedTraverse(\''+ \
! replace(args,':','/')+'\'))" html_quote' \
! or args+' html_quote'
  return s
  else:
  nn=find(args,'-')
***
*** 164,171 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! args=(args[nn+1:]+' '+
!   replace(args[:nn],'.',' '))
  d[3]=d['args']=args
  return s
  
--- 167,178 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! path=args[nn+1:]
! args=(':' in path 
! and  '"_.render(restrictedTraverse(\''+
! replace(path,':','/')+'\'))" ' 
! or path+' ') \
! +replace(args[:nn],'.',' ')
  d[3]=d['args']=args
  return s
  



[Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Chris Withers

Shane Hathaway wrote:
> That would probably work, but isn't kind of ugly?  Now we'd be forcing
> people to realize that colons can be path separators.  Only Mac users
> know this. :-)

Well, 

  / and \ are bad XML

  ; is bad XML, and _really_ ugly

  . confuses when there's .'s in ids

Any other suggestions :S

cheers,

Chris

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




Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Phil Harris

-, that;s a hyphen to you
- Original Message - 
From: "Chris Withers" <[EMAIL PROTECTED]>
To: "Shane Hathaway" <[EMAIL PROTECTED]>
Cc: "Jonothan Farr" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 17, 2000 9:57 PM
Subject: [Zope-dev] Aaargh, no safe seperators :S


> Shane Hathaway wrote:
> > That would probably work, but isn't kind of ugly?  Now we'd be forcing
> > people to realize that colons can be path separators.  Only Mac users
> > know this. :-)
> 
> Well, 
> 
>   / and \ are bad XML
> 
>   ; is bad XML, and _really_ ugly
> 
>   . confuses when there's .'s in ids
> 
> Any other suggestions :S
> 
> cheers,
> 
> Chris
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )


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




[Zope-dev] Re: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Carl Robitaille

Hi,

Just for the record, Criss' suggestion didn't work for me. I don't
quite get why though Here's the code again, where images is a
Folder:


 
 
  
EQUAL
  
NOT EQUAL
  
 
 

The error I get from Zope is:

File /home/zope/Zope2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
  (Object:
_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images))
  (Info: images)
File , line 0, in ?
File /home/zope/Zope2/lib/python/DocumentTemplate/DT_Util.py, line 140,
in careful_getattr
AttributeError: aq_base

It's looks like aq_base is not available. I read Shane's Acquisition
Understander How-To. I created the ExternalMethod that used aq_base and
it works like a charm. I tried a lot of things even if I didn't have a
good undersanding of the problem. The only time I got a valid code (Zope
not complaining when hitting the Change button) was with that line:

  

You probably know why it doesn't give the right result, but I don't
have a clue. It's still not returning true when sequence-item is
matching the images Folder. Is there anything I can read to understand
what I'm dealing with? Or maybe somebody knows what I'm doing wrong...
again


Carl


> Carl Robitaille wrote:
> > Hi Criss,
> >
> > Thanks a lot for your quick response!! Since I'm a new Zope user, I
> > guess I'll just cut-paste the line you suggest without trying to
> > understand for the moment  ;-)
> 
> Nih!
> 
> Welcome to the deep end ;-)
> 
> cheers,
> 
> Chris

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




[Zope-dev] Extending dtml entity syntax

2000-08-17 Thread Steve Alexander

Chris Withers has suggested extending the DTML Entity syntax to include
traversal information.

For example: &dtml-foo/bar/baz;

I just checked the XML standard. This isn't allowed in XML entities.

  http://www.w3.org/TR/1998/REC-xml-19980210#NT-Nmtoken

  EntityRef ::= '&' Name ';'

  NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar
   | Extender
  
  Name ::= (Letter | '_' | ':') (NameChar)*

However, we could consider &dtml-foo.bar.baz; instead.

I can't think of a nice alternative to mean &dtml-/foo/bar/baz; "from
the root, traverse as follows".

--
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] Cool, we like the . :-)

2000-08-17 Thread Chris Withers


Steve Alexander wrote:
> I can't think of a nice alternative to mean &dtml-/foo/bar/baz; "from
> the root, traverse as follows".

&dtml-.foo.bar.baz;

not nice, btu I can't think of anything better :(

cheers,

Chris

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




Re: [Zope-dev] ZPatterns, Transactions, _register/_unregister

2000-08-17 Thread Phillip J. Eby

At 11:13 AM 8/14/00 +0200, Bob Pepin wrote:
>Hi,
>I've encountered some weird behaviour in the ZPatterns Transactional class
when
>I was trying to write a User Source for the Login Manager Product.
>
>I'm using Zope 2.2.0 with LoginManager 0.8.7a1 and ZPatterns 0.4.1snap1
>
>The problem is that _unregister seems to be trying to delete the
_v_registered
>attribute of an object that doesn't have it set whenever I return None from
>authenticateUser(). The weird thing is that the object seems to be
>_register()ed and _v_registered appears to be set to 1 in _register(), but
when
>_unregister() is called it has the value 'None' again.
>

Hmmm.  Just a thought, but, does your user source object change itself in
any way during the transaction?  It is possible that it is getting reloaded
from the ZODB during transaction abort, and that would delete the
_v_registered attribute and mess the whole thing up.

Looking at your source code, I see that you are incrementing self.i in your
dbg() method, which is called from other methods that would be active
during the transaction, so this would produce the behavior you're seeing.
Specifically, failing to authorize a user results in an Zope exception
being thrown, causing the transaction to roll back.  As part of the
rollback, the ZODB will invalidate the in-memory state of your UserSource
object (since it was changed during the transaction) and the _v_ attribute
values are lost.  Ironically, you could fix this by changing your debug
code to use a _v_ attribute as well.

Arguably this behavior is an architectural flaw in either Transactional or
the way it is used in DataManager derivatives such as Rack and UserSource.
I'll have to give it some thought, but the cure may be worse than the
disease as I suspect it may require circular references.  :(


___
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: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Chris Withers

Carl Robitaille wrote:
> Hi Criss,
> 
> Thanks a lot for your quick response!! Since I'm a new Zope user, I
> guess I'll just cut-paste the line you suggest without trying to
> understand for the moment  ;-)

Nih!

Welcome to the deep end ;-)

cheers,

Chris

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




[Zope-dev] Re: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Carl Robitaille

Hi Criss,
 
Thanks a lot for your quick response!! Since I'm a new Zope user, I
guess I'll just cut-paste the line you suggest without trying to
understand for the moment  ;-)

Carl


> Carl Robitaille wrote:
> >  
> >  
> >  
> 
> > 
> > 
> 
> Congratulations, you've just been bitten by the thing that confused me
> for half a day...
> You see, while they say , they're actually
> lying ;-)
> 
> The objects you're comparing are actually acquisition wrappers.
> 
> IMHO, == should work with acquisition to make problems like the above
> not happen. I suggested this, and Jim Fulton agreed:
> http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/08240A8E0D50AEE0
> 
> Sadly, nothing seems to have been done about it :(
> Maybe you should chuck it in the collector as a bug in the
> ExtensionClass?
> 
> cheers,
> 
> Chris
> 
> PS: In the meantime, the following should work:
> 
>  
> 
>
>"_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images)">
> EQUAL
>   
> NOT EQUAL
>   
> 
>  

___
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] Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Chris Withers

Carl Robitaille wrote:
>  
>  
>  

> 
> 

Congratulations, you've just been bitten by the thing that confused me
for half a day...
You see, while they say , they're actually
lying ;-)

The objects you're comparing are actually acquisition wrappers.

IMHO, == should work with acquisition to make problems like the above
not happen. I suggested this, and Jim Fulton agreed:
http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/08240A8E0D50AEE0 

Sadly, nothing seems to have been done about it :(
Maybe you should chuck it in the collector as a bug in the
ExtensionClass?

cheers,

Chris

PS: In the meantime, the following should work:

 
 
  
EQUAL
  
NOT EQUAL
  
 
 

___
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] Comparing folder instances

2000-08-17 Thread Carl Robitaille

Hi,

A quick question. How do I compare folder instances ?(or any instances
as a matter of fact).

Here is a simple code showing what I tried:



 
 
 



Here is now the resulting HTML




0




0

Why isn't the first comparison returning true? What I want to use is
something like:




 
   EQUAL
 
   NOT EQUAL
 



Thanks a lot in advance for your comments.

Carl

___
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 ( slightly less Confusion ;-)

2000-08-17 Thread Shane Hathaway

Chris Withers wrote:
> How should I got about petitioning
> for
>  to become valid syntax?

There's one little (okay, big) problem with this idea: aq_context
strips the security context.  In fact, it could be used to confuse the
security machinery.

Let's say I'm Joe Hacker and I have set up membership at
www.zope.org/Members/jhacker.  I create a DTML method called index_html
with this:



  



Line 2 might be written as .

Now I may have accessed the member folder for hathawsh with the local
roles that are supposed to be in effect only in my own folder.  Zope
acquires the local roles from anything in the path
/Members/jhacker/Members/hathawsh/index_html.  Normally the local roles
would be determined by /Members/hathawsh/index_html, in which case Zope
would find no local roles for jhacker.

"aq_containment" should be fine, however.

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] Data.fs

2000-08-17 Thread Andre Schubert

Hi,

I'am using Zope 2.1.6 and my Data.fs is going corrupted and i don't have
found a way for backup this file.
My Questions are: is there a way to delete the last transaction from
Data.fs, and can i backup the Data.fs when Zope is running. Is the
backup of Data.fs inconsitent when i make the backup at the same time a
user writes to it?
I want to a backup Data.fs twice a day. so i want to have 14 data.fs
files every week. On this way i can find out when the error occurs and i
can restore an older version of  Data.fs.

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 )




[Zope-dev] Acquisition ( slightly less Confusion ;-)

2000-08-17 Thread Chris Withers

Evan Simpson wrote:
> > > - never expose a "bare" object, or even one with an incomplete context
> >
> > Why? You can get at it through aq_base anyway, surely?
> 
> Only from unrestricted code.  DTML and (CVS) Python Methods only let you
> access aq_parent.  This only applies to objects that are part of the
> containment hierachy, of course.  Brand new objects aren't wrapped, nor are
> simple non-persistent types like lists and dicts.

Ah, okay... so really, prettymuch all Zope objects should be wrapped
with only one or two exceptions, most of which aren't actually objects
as such but simple data types?


> > Would it matter if the
> > wrappers were structured differently to provide a different search
> > order?

> Only to anyone who depends on the current behavior :-) 

Heh, ain't backward compatability a bitch ;-)

> Also, there is a
> very limited range of "natural" ways to construct the wrappers.  Once
> contructed, of course, we can fool with them in arbitrary ways.

So I see, does this reduce efficiency at all?

> We want to be able to find out what an object's container is, regardless of
> what we acquired it from.  In raw acquisition, there's no straightforward
> way to do this.  In simplified acquisition, aq_inner.aq_parent is the
> container.  The simplification is the rule (A o B) o (B o C) => A o (B o C).

I don't see how this simplification actually makes a difference...
In what way does it change the search order?
>From what I read, I though it just reduced the number of checks you had
to do...

> All of these would search the dotted expression from right to left, so they
> would give you B's I.
> > 
> > 
> > 

cool :-)

> All of these would search the containers of the right-most object, so the
> first two would give you A's I, and the third B's I.
> > 
> > 
> > 

weird ;-S (but I suppose someone might find it useful ;-)

The external methods were very cool. How should I got about petitioning
for 
 to become valid syntax?

cheers,

Chris

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




Re: [Zope-dev] Caching problems

2000-08-17 Thread Bob Pepin

On Wed, Aug 16, 2000 at 05:31:29PM +0100, Carlos Neves wrote:
> You directly change a nonpersistence participant object.
> As stated in
> http://www.python.org/workshops/2000-01/proceedings/papers/fulton/zodb3.html :
[...]
> but mainly... RTFM ;-)

Well, thanks, but too bad the only FM I've been able to find about Zope are
those .py files in lib/python/...

I spent a whole day looking for documentation on ZODB internals on zope.org and
zdp.zope.org, without being able to find anything... how about adding that
paper to the search engine on zope.org? Is there more documentation like that
one out there?

___
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] "stemmed and stopped": problems with stopwords and the 'and' operator

2000-08-17 Thread Martijn Pieters

On Thu, Aug 17, 2000 at 02:23:59AM -0400, R. David Murray wrote:
> I can do 'from SearchIndex.Splitter
> import Splitter', and call Splitter, and see that stopwords are
> not removed, but I can't do 'from SearchIndex.UnTextIndex import
> Splitter' because it complains about not being able to import
> Persistent from Persistence.  (*That* problem was reported by someone
> else in another context not too long ago.)

No clues as to where you'll find the stopword code, but the Persistence
thingy is caused by the magic that ZODB performs: it initializes the
correct Persistence module when it itself is imported. This way Jim
managed to have ZODB3 and BoboPOS2 exist in the same Zope distribution.

Do an import ZODB before you do your Splitter import, and all will be
dandy.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-

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