[Zope-dev] ZCatalog comments

2001-04-27 Thread Chris Withers

Michel Pelletier wrote:
 
 +There are some rules to consider when querying this method:
 +
 +- an empty query mapping (or a bogus REQUEST) returns all
 +  items in the
 +catalog.

Is it only me that finds this really irritating? Surely a blank query mapping
should return nothing, not everything?
(at the least it'd be nice if this was configurable ;-)

 +Depending on the type of index you are querying, you may be
 +able to provide more advanced search parameters that can
 +specify range searches or wildcards.  These features are
 +documented in The Zope Book.

Wildcards? Hmmm... that's enticing, where and how will they be supported? 

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] CST 0.8 Question

2001-04-27 Thread Chris Withers

Hi Chris,

While writing the CST 0.7 - 0.8 updater, I noticed something weird in
SessionIdManager.py.
In constructSessionIdManager(), you call SessionIdManager.__init__ with a final
parameter called 'rewritemode'.
I don't know what that's meant to do, but all I can see is that it results in a
call to self.turnOn() when you create the manager.

The name would suggest that something else should probably happen, but maybe
rewritemode is just a relic from a previous version?

Hope you can shed some light,

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] makerequest.py

2001-04-27 Thread Chris Withers

Hi,

This is quite a useful little utility, but it creates a REQUEST object without
any AUTHENTICATED_USER beign present.

Should this be remedied? If so, how?

I do have memories that REQUEST.AUTHENTICATED_USER has been deprecated. In
which, case, how should you get hold of the current user's object and can this
be made to work in a testing environment?

Nirvana here would be not having to import Zope so that we can run tests while
Zope is still up and running in a non-ZEO situation.
Does ZUnit help with this? If so, how?

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] a plea for help (again)

2001-04-27 Thread tav

sorry for sending this to the list again, but i would _really_ appreciate
some help with the matter. thanks =)



heyas

i created a zope product called, XnetPage, which is basically a folderish
dtml document/zwikipage

the source for the product can be seen at
http://mu2.espnow.com/~tav/XnetPage.py

it's been a bumpy ride, but everything's gone well so far.

however, i have run into a problem which is beyond me. it is with regards to
error messages.

whenever, the text of the xnetpage is rendered, and there's an error... lets
say that i call dtml-var hmz and hmz, hasn't been defined... instead of
displaying a NameError, or whatever the appropriate error should be, it
gives me a TypeError

i even installed ZDebug, but, it's of no help here :/

in fact, the error message is over-ridden by the one in HTTPResponse.py

i have included a sample error traceback below, and hope that someone can
enlighten me as to what's wrong.

most of the code in the product is from the zwiki product, and some of the
voodoo magic is beyond me ;p

thanks in advance


  File /home/zope/k1/lib/python/DocumentTemplate/DT_String.py, line 538, in
__call__
(Object: test_page)
  File /home/zope/k1/lib/python/Products/ZDebug/DTMLDebug.py, line 259, in
debug_render_blocks
  File /home/zope/k1/lib/python/Products/ZDebug/DTMLDebug.py, line 228, in
debugException
  File /home/zope/k1/lib/python/Products/ZDebug/DTMLDebug.py, line 155, in
debugWithNamespace
  File /home/zope/k1/lib/python/Products/ZDebug/DTMLDebug.py, line 74, in
explodeNamespaceStack
  File /home/zope/k1/lib/python/ZPublisher/HTTPRequest.py, line 935, in
__str__
  File /home/zope/k1/lib/python/Products/XnetPage/XnetPage.py, line 811, in
__repr__
(Object: test_page
TypeError: call of non-function (type string)


--
best regards, tav
[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] a plea for help (again)

2001-04-27 Thread Chris Withers

tav wrote:
 
   File /home/zope/k1/lib/python/Products/XnetPage/XnetPage.py, line 811, in
 __repr__
 (Object: test_page
 TypeError: call of non-function (type string)

OK, the code around this is:
def __repr__(self):
return (%s %s at 0x%s
% (self.__class__.__name__, `self.id()`, hex(id(self))[2:]))

I'm betting self.id isn't a methodm hence your error.
That said, I dont' really see the point of this whole __repr__ method, maybe try
removing it completely?

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] a plea for help (again)

2001-04-27 Thread tav

 CW == Chris Withers [EMAIL PROTECTED] wrote:

CW OK, the code around this is:

def __repr__(self):
return (%s %s at 0x%s
% (self.__class__.__name__, `self.id()`,
hex(id(self))[2:]))

CW I'm betting self.id isn't a methodm hence your error.
CW That said, I dont' really see the point of this whole
CW __repr__ method, maybe try removing it completely?

w00p! you rock!

thanks!

this is what happens when you copy paste someone else's code and don't know
wtf you are doing.

just commented it out, and works like a charm!

once again, loadsa thanks!

--
best regards, tav
[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] CST 0.8 Updater Fixed...

2001-04-27 Thread Chris Withers

Chris Withers wrote:
 
 It's running and working okay, but every so often, when running it, I get:
 
 2001-04-27T09:15:23 PANIC(300) ZODB A storage error occurred in the last phase o

I stopped the above by wrapping the code as follows:


get_transaction().begin()
 path = self.getSessionDataContainerPath()
 timeout_mins = self.getInternalDCTimeoutMins()
 onstart = self.getOnStartPath()
 onend = self.getOnEndPath()
 
 container = self.aq_parent
 ob = SessionDataManager(id, path, title, timeout_mins, onstart, onend)
 container.manage_delObjects(ids=[id])
 container._setObject(id, ob)
get_transaction().note(Done '%s' % notepath)
get_transaction().commit()

I wonder why it's necessary? Something to do with the weirdy mounted internal
session data container?

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: a plea for help (again) (tav)

2001-04-27 Thread Tim McLaughlin

Tav,

I don't see why you need to reimplement __repr__ in the first place.  I
believe that what yours is trying to do is the default implementation on a
class.  (somebody tell me if I am wrong)  But this probably is not the
fundamental issue.

TIm

___
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] Trying to set roles/permissions programmatically - Now I have a headache!

2001-04-27 Thread Danny William Adair

Hello!

I want to set the roles of a permission and turn acquisition of a permission
(mapping) on and off programmatically. And of course I want to get a
permission by its name. This looks definitely more complex than simply
changing an object's property!

I took a look at the management screens(Role.py -
manage_changePermissions). The aX and pYrZ mapping for the *checkboxes*
(=sole purpose) gave me a lot of confusion, I first thought this was Zope
internal naming :-). Then I took a look at Permission.py (setRoles). But I
haven't dealt with this before, and it all looks a little weird. I managed
to write a couple of functions that give me roles to permissions and
permissions to roles or check if a permission setting has been acquired and
so on, but I'm stuck with *setting* permissions with a function of my own.

a) Could this be correct?

# roles as list: acquisition will be turned on
roles=['Anonymous','Manager']

# roles as tuple: acquisition will be turned off
roles=tuple(roles)

# set as specified
some_permission.setRoles(roles)


b) How can I get a hold of some_permission when I know its name? This does
not work:

def setRolesForPermission(ob, permission, roles, setacquired):
  permission_trans = '_' + replace(permission, ' ', '_') + '_Permission'
  p = getattr(ob, permission_trans) # this does *not* give me the permission
itself!
  if not setacquired:
roles=tuple(roles)
  p.setRoles(roles)

It must have something to do with acquisition :-)
If it is turned on for that permission, getattr() won't find the attribute.
If it's turned off, it returns a tuple. Where's the permission instance
itself?

I see that ac_inherited_permissions(1) gives me a list of permission names,
but I don't know how to access a specific permission directly.

This *did* work:

def permissionAcquired(ob, permission):
# Tell me if acquisition has been turned on
# (There's also some other way, checking if the returned is of type List or
Tuple, I think I saw that somewhere in Role.py)

  permission_trans = '_' + replace(permission, ' ', '_') + '_Permission'
  return (not hasattr(ob.aq_base, permission_trans))


Help!
Thank you so much in advance,

Danny


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

2001-04-27 Thread Chris Withers

Hi Shane,

will you be releasing a new version of BTreeFolder that makes use of the new
funky BTrees at any stage?

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] 27 million objects.

2001-04-27 Thread Erik Enge

On Thu, 26 Apr 2001, Dieter Maurer wrote:

 Are the imported object CatalogAware?

They are.

 The old (pre 2.3.1) catalog implementation was know not to be very
 storage friendly. If a significant portion of the catalog indexes
 would be affected by imports, then you would see a quadratic storage
 increase.

I'm using Zope 2.3.1b1 so that shouldn't be a problem?


___
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] 27 million objects.

2001-04-27 Thread Erik Enge

On Thu, 26 Apr 2001, Chris McDonough wrote:

 This level of growth doesn't seem like a sane level of growth... what
 Zope version are you using?

Zope 2.3.1b1 
 
  Someone told me that ZEO and bulk-adding could be a thing to look at...
 
 Isn't bulk-adding what you're doing now?

It is, but I'm not using ZEO.


___
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] 27 million objects.

2001-04-27 Thread Chris Withers

Erik Enge wrote:
 
  The old (pre 2.3.1) catalog implementation was know not to be very
  storage friendly. If a significant portion of the catalog indexes
  would be affected by imports, then you would see a quadratic storage
  increase.
 
 I'm using Zope 2.3.1b1 so that shouldn't be a problem?

Yes, it will be. I'd go for 2.3.2b2 and make sure you you run the catalog
updater.
I'm just about to upload a product which will update all the ZCatalogs in a
ZODB.

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] 27 million objects.

2001-04-27 Thread Erik Enge

On Fri, 27 Apr 2001, Chris Withers wrote:

 Erik Enge wrote:
  
  I'm using Zope 2.3.1b1 so that shouldn't be a problem?
 
 Yes, it will be. [...]

So the bug in Zope 2.3.1b1 which makes the ZODB grow dramatically is
gone in Zope 2.3.2b2?



___
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] 27 million objects.

2001-04-27 Thread Chris Withers

Erik Enge wrote:
 
 On Fri, 27 Apr 2001, Chris Withers wrote:
 
  Erik Enge wrote:
  
   I'm using Zope 2.3.1b1 so that shouldn't be a problem?
 
  Yes, it will be. [...]
 
 So the bug in Zope 2.3.1b1 which makes the ZODB grow dramatically is
 gone in Zope 2.3.2b2?

Not so much a bug as a complete rewrite of the data structures used by ZCatalog.
After the amount of work Chris M and Jim F put in, I don't think they'd be happy
having it described as 'just a bug' ;-)

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: BTreeFolder

2001-04-27 Thread Shane Hathaway

Chris Withers wrote:
 will you be releasing a new version of BTreeFolder that makes use of the new
 funky BTrees at any stage?

We've done some work on it; in fact Jim came up with a bold new idea
that makes them inherently faster. Now to find the time. :-)

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] Updaters for ZCatalog and Core Session Tracking Available

2001-04-27 Thread Chris Withers

Hi,

I've done some Updaters to help with the move to the new ZCatalog and Core
Session Tracking implementations.

These updaters help you quickly update all objects of a particular type in a
ZODB.

The and information about them can be found at:
http://www.zope.org/Members/chrisw/UpdateSupport

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] Re: BTreeFolder

2001-04-27 Thread Chris Withers

Shane Hathaway wrote:
 
 Chris Withers wrote:
  will you be releasing a new version of BTreeFolder that makes use of the new
  funky BTrees at any stage?
 
 We've done some work on it; in fact Jim came up with a bold new idea
 that makes them inherently faster. Now to find the time. :-)

Cool. From my point of view it'd be great if the default folders in the CMF
could be these new 'super folders'
I can think of some situations where I might end up with _large_ number of
objects in a CMF folder :-S

thanks for the reply,

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] CST 0.8 Updater Fixed...

2001-04-27 Thread Chris Withers

Chris Withers wrote:
 
 Chris Withers wrote:
 
  It's running and working okay, but every so often, when running it, I get:
 
  2001-04-27T09:15:23 PANIC(300) ZODB A storage error occurred in the last phase o
 
 I stopped the above by wrapping the code as follows:

Unfortunately, it still sometimes hangs on certain instances :-S
No error, no crash, just stops doing what it's doing (and Zope drops right of
'top' IUKWIM)

Playing with this, I noticed that Zope doesn't stop processing a request if the
browser goes away. Is that a bad thing? I would have thought so if you
inadvertantly set an expensive method off (like recataloging several big
catalogs all in one go ;-) and then want to back out...

help appreciated as always :-)

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] Zope Server hanging :-(

2001-04-27 Thread Chris Withers

Hi,

Well, I thought the upgrade to 2.3.2b2 would solve the problem but it hasn't :-(
I have a (very important :-S) Zope instance which hangs at what seems like the
slightest touch.

The symptoms are as follows:
1. Go to a given URL, which doesn't respond (browser sits and spins)
2. Doing a 'top' on the server shows python nowhere to be seen (so it's not
infinite-loop-processor-hogging)
3. ps shows the python threads are all still there, but none of them will
respond.
3. doing a ./stop sucessfully stops Zope (the broswer returns a 'reset by peer')
4. doing a ./start yields the following the the stupid log file:

2001-04-27T15:05:38 PANIC(300) z2 Startup exception
Traceback (innermost last):
  File /usr/local/zope/Zope-2.3.2b2-src/z2.py, line 566, in ?
  File string, line 1, in ?
  File /usr/local/zope/Zope-2.3.2b2-src/lib/python/Zope/__init__.py, line 110,
in ?
  File /usr/local/zope/Zope-2.3.2b2-src/lib/python/ZODB/FileStorage.py, line
264, in __init__
  File /usr/local/zope/Zope-2.3.2b2-src/lib/python/ZODB/lock_file.py, line 101,
in lock_file
StorageSystemError: Could not lock the database file.  There must be
another process that has opened the file.
p

5. The only way I can get Zope to start again is do do a:
killall -9 python

...now start behaves normally and the cycle begins again (averaging around once
every 10 minutes now :-( )

Can anyone suggest how I might go about tracking this down? It's really
beginning to piss me off. That said, I've seen quite a few posts now complaining
about Zope hanging and crashing, so I'm actually beginning to worry about using
Zope from a stability point of view.

Help!

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: CST 0.8 Question

2001-04-27 Thread Chris McDonough

Oops, thanks for the bugrep!!  It does no harm currently, but this will be
fixed in the next version.

- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 3:55 AM
Subject: CST 0.8 Question


 Hi Chris,

 While writing the CST 0.7 - 0.8 updater, I noticed something weird in
 SessionIdManager.py.
 In constructSessionIdManager(), you call SessionIdManager.__init__ with a
final
 parameter called 'rewritemode'.
 I don't know what that's meant to do, but all I can see is that it results
in a
 call to self.turnOn() when you create the manager.

 The name would suggest that something else should probably happen, but
maybe
 rewritemode is just a relic from a previous version?

 Hope you can shed some light,

 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] ZCatalog comments

2001-04-27 Thread Chris McDonough



 Michel Pelletier wrote:
 
  +There are some rules to consider when querying this method:
  +
  +- an empty query mapping (or a bogus REQUEST) returns all
  +  items in the
  +catalog.

 Is it only me that finds this really irritating? Surely a blank query
mapping
 should return nothing, not everything?
 (at the least it'd be nice if this was configurable ;-)

This is for hysterical reasons.  Lots of code depends on:

dtml-in Catalog
...
/dtml-in

.. Principia's/ZTable's original customers (newspapers) decided it was
better to show *all* the classified ads instead of *none* of the classified
ads if the search spec matched nothing.  I agree with you, however.  That
said, I don't think it's that big of a deal, and it can be dealt with
through documentation.


  +Depending on the type of index you are querying, you may be
  +able to provide more advanced search parameters that can
  +specify range searches or wildcards.  These features are
  +documented in The Zope Book.

 Wildcards? Hmmm... that's enticing, where and how will they be supported?

It's in there already for text indexes.  ? and * do the right thing.

 cheers,

 Chris

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



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



Re: [Zope-dev] Waagh! More fun games with the CST 0.8 Updater

2001-04-27 Thread Chris McDonough

Darn.  No idea.  If you can boil it down to an always-fails test, I can
probably fix it.

- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 5:18 AM
Subject: [Zope-dev] Waagh! More fun  games with the CST 0.8 Updater


 It's running and working okay, but every so often, when running it, I get:

 2001-04-27T09:15:23 PANIC(300) ZODB A storage error occurred in the last
phase o
 f a two-phase commit.  This shouldn't happen. The application may be in a
hosed
 state, so transactions will not be allowed to commit until the
site/storage is r
 eset by a restart.
 Traceback (innermost last):
   File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\Transaction.py, line 335, in
commit
   File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\Connection.py, line 657, in
tpc_fini
 sh
   File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\BaseStorage.py, line 219, in
tpc_fin
 ish
 (Object: SessionStorage)
 error: release unlocked lock

 The relevant bit of code is:

 path = self.getSessionDataContainerPath()
 timeout_mins = self.getInternalDCTimeoutMins()
 onstart = self.getOnStartPath()
 onend = self.getOnEndPath()

 container = self.aq_parent
 ob = SessionDataManager(id, path, title, timeout_mins, onstart, onend)
 container.manage_delObjects(ids=[id])
 container._setObject(id, ob)

 Any ideas?

 cheers,

 Chris

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



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



Re: [Zope-dev] makerequest.py

2001-04-27 Thread Chris McDonough



 Hi,

 This is quite a useful little utility, but it creates a REQUEST object
without
 any AUTHENTICATED_USER beign present.

Uh huh.


 Should this be remedied? If so, how?

Maybe it should be a parameter of the makerequest function.

 I do have memories that REQUEST.AUTHENTICATED_USER has been deprecated. In
 which, case, how should you get hold of the current user's object and can
this
 be made to work in a testing environment?

from AccessControl import getSecurityManager
user = getSecurityManager().getUser()

And yes, this can be made to work in a testing environment.  You'll always
get the Anonymous User from within a test, however.

For an example of a way to *set* the user with the same facility, see
CoreSessionTracking's SessionDataManager.EventWrapper.__call__ method.

 Nirvana here would be not having to import Zope so that we can run tests
while
 Zope is still up and running in a non-ZEO situation.
 Does ZUnit help with this? If so, how?

Dunno.  It's not really possible if you depend on database operations.  This
is why it's important to factor your products into bits testable outside of
the Zope framework.



___
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] CST 0.8 Updater Fixed...

2001-04-27 Thread Chris McDonough

 I stopped the above by wrapping the code as follows:

snip

Cool!

 I wonder why it's necessary? Something to do with the weirdy mounted
internal
 session data container?

As Colonel Klink says so well, I see nussing!



___
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: BTreeFolder

2001-04-27 Thread Michael Bernstein

Shane Hathaway wrote:
 
 Chris Withers wrote:
  will you be releasing a new version of BTreeFolder that makes use of the new
  funky BTrees at any stage?
 
 We've done some work on it; in fact Jim came up with a bold new idea
 that makes them inherently faster. Now to find the time. :-)

Does this have any implications for the BTree implementation
used in ZPatterns Racks?

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 )



Re: [Zope-dev] 27 million objects.

2001-04-27 Thread Chris McDonough



 Erik Enge wrote:
 
  On Fri, 27 Apr 2001, Chris Withers wrote:
 
   Erik Enge wrote:
   
I'm using Zope 2.3.1b1 so that shouldn't be a problem?
  
   Yes, it will be. [...]
 
  So the bug in Zope 2.3.1b1 which makes the ZODB grow dramatically is
  gone in Zope 2.3.2b2?

 Not so much a bug as a complete rewrite of the data structures used by
ZCatalog.
 After the amount of work Chris M and Jim F put in, I don't think they'd be
happy
 having it described as 'just a bug' ;-)

Bug is fine.  ;-)

Here's a FAQ about it:

http://www.zope.org/Members/mcdonc/HowTos/UpgradeToNewCatalog/index_html


___
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] Updaters for ZCatalog and Core Session Tracking Available

2001-04-27 Thread Chris McDonough

Rock!

 These updaters help you quickly update all objects of a particular type in
a
 ZODB.



___
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 Server hanging :-(

2001-04-27 Thread Tim McLaughlin

Chris (and all),

We seem to be having similar crashing issues.  And interestingly enough,
they don't seem to show up on any of our servers except the 2.3.0 upgraded
to 2.3.1.

1.  Hangs on anything from Pythonscript or dtml
2.  top shows no significant mem or cpu usage
3.  threads are all unresponsive
4.  restart usually yields a .trX file (an aborted transaction I suppose)

Any ideas?   Maybe it was something fixed in 2.3.1?  The causes seem to be
somewhat different except that they all modify the ZODB

Tim

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



OT: hogans heroes club was: [Zope-dev] CST 0.8 Updater Fixed...

2001-04-27 Thread Chris McDonough

You are correct sir!

The Zope community appreciates this effort!  ;-)

- C

- Original Message -
From: Schmidt, Allen J. [EMAIL PROTECTED]
To: 'Chris McDonough' [EMAIL PROTECTED]; Chris Withers
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 12:58 PM
Subject: RE: [Zope-dev] CST 0.8 Updater Fixed...


 Sorry to contradict you Chris, but it was actually Sgt. Shultz who stated
 that famous line.

 It's not often I can contribute so I thought I would give something back!
 8^)

 Allen
 (active member of ZA  -  -Zopaholics Anonymous)

 -Original Message-
 From: Chris McDonough [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 12:21 PM
 To: Chris Withers; [EMAIL PROTECTED]
 Subject: Re: [Zope-dev] CST 0.8 Updater Fixed...


  I stopped the above by wrapping the code as follows:
 
 snip

 Cool!

  I wonder why it's necessary? Something to do with the weirdy mounted
 internal
  session data container?

 As Colonel Klink says so well, I see nussing!



 ___
 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] CST 0.8 Updater Fixed...

2001-04-27 Thread Schmidt, Allen J.

Sorry to contradict you Chris, but it was actually Sgt. Shultz who stated
that famous line.

It's not often I can contribute so I thought I would give something back!
8^)

Allen
(active member of ZA  -  -Zopaholics Anonymous)

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 12:21 PM
To: Chris Withers; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] CST 0.8 Updater Fixed...


 I stopped the above by wrapping the code as follows:

snip

Cool!

 I wonder why it's necessary? Something to do with the weirdy mounted
internal
 session data container?

As Colonel Klink says so well, I see nussing!



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

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



Re: [Zope-dev] Zope Server hanging :-(

2001-04-27 Thread Chris McDonough



 I forgot to mention... our neither our z2.log or stupid_log show anything
 upon freezing.  afterwards the stupid_log shows the failed transaction
 cleanup, but that's it.

Hmmm... it might be useful to turn on detailed request logging (-M logging)
in the start file (see z2.py).

Attached is a script that I just checked into the trunk to do analysis of
the file generated by the -M log.  It can help you figure out if there's a
pattern to the hangs (whether it happens on a particular method, whether it
happens at heavy load time, whether it happens at a particular time of day,
etc.)  Do you think you'd be willing to play around with it a little bit to
try to discover a pattern?




 Tim

 -Original Message-
 From: Tim McLaughlin
 Sent: Friday, April 27, 2001 12:41 PM
 To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
 Subject: [Zope-dev] Zope Server hanging :-(


 Chris (and all),

 We seem to be having similar crashing issues.  And interestingly enough,
 they don't seem to show up on any of our servers except the 2.3.0 upgraded
 to 2.3.1.

 1.  Hangs on anything from Pythonscript or dtml
 2.  top shows no significant mem or cpu usage
 3.  threads are all unresponsive
 4.  restart usually yields a .trX file (an aborted transaction I suppose)

 Any ideas?   Maybe it was something fixed in 2.3.1?  The causes seem to
be
 somewhat different except that they all modify the ZODB

 Tim

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



#!/usr/bin/env python
##
# 
# Zope Public License (ZPL) Version 1.0
# -
# 
# Copyright (c) Digital Creations.  All rights reserved.
# 
# This license has been certified as Open Source(tm).
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions in source code must retain the above copyright
#notice, this list of conditions, and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions, and the following disclaimer in
#the documentation and/or other materials provided with the
#distribution.
# 
# 3. Digital Creations requests that attribution be given to Zope
#in any manner possible. Zope includes a Powered by Zope
#button that is installed by default. While it is not a license
#violation to remove this button, it is requested that the
#attribution remain. A significant investment has been put
#into Zope, and this effort will continue if the Zope community
#continues to grow. This is one way to assure that growth.
# 
# 4. All advertising materials and documentation mentioning
#features derived from or use of this software must display
#the following acknowledgement:
# 
#  This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/).
# 
#In the event that the product being advertised includes an
#intact Zope distribution (with copyright and license included)
#then this clause is waived.
# 
# 5. Names associated with Zope or Digital Creations must not be used to
#endorse or promote products derived from this software without
#prior written permission from Digital Creations.
# 
# 6. Modified redistributions of any form whatsoever must retain
#the following acknowledgment:
# 
#  This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/).
# 
#Intact (re-)distributions of any official Zope release do not
#require an external acknowledgement.
# 
# 7. Modifications are encouraged but must be packaged separately as
#patches to official Zope releases.  Distributions that do not
#clearly separate the patches from the original work must be clearly
#labeled as unofficial distributions.  Modifications which do not
#carry the name Zope may be packaged in any form, as long as they
#conform to all of the clauses above.
# 
# 
# Disclaimer
# 
#   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
#   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS 

Re: [Zope-dev] Re: BTreeFolder

2001-04-27 Thread Phillip J. Eby

At 09:19 AM 4/27/01 -0700, Michael Bernstein wrote:
Shane Hathaway wrote:
 
  Chris Withers wrote:
   will you be releasing a new version of BTreeFolder that makes use of 
 the new
   funky BTrees at any stage?
 
  We've done some work on it; in fact Jim came up with a bold new idea
  that makes them inherently faster. Now to find the time. :-)

Does this have any implications for the BTree implementation
used in ZPatterns Racks?

Yes.  Whenever I get around to updating ZPatterns for Zope 2.3.x, I plan to 
switch to the new BTrees.

However, if you can't wait for that, you can always hand-edit the import 
statements in Rack.py to do the right thing.  That will only work for new 
rack objects, or at any rate for racks that haven't yet created their BTree.

Now, what *I*'d like to know is what the bold new idea is, since it 
sounds like it's something even newer than the 
forward-chained-buckets-plus-conflict-resolution stuff that's already been 
released.


___
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] Heads up -- big changes on trunk

2001-04-27 Thread Chris McDonough

Additionally, other mass changes to the trunk will occur when Andreas merges
the work he's done to rid the codebase of regex in favor of re.

One of the more major shifts is the deprecation of the old structured text
in favor of StructuredTextNG, which is serviced via a compatibility module.
The compatibility module is known to break the Zope Tutorial product
currently, but everything else in the core that uses StructuredText (e.g.
dtml-var fmt=structured-text and the help system) seems to work well.  The
tutorial will work again once 2.4 final is released.


- Original Message -
From: Shane Hathaway [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 1:40 PM
Subject: [Zope-dev] Heads up -- big changes on trunk


 This notice only applies to developers who are following the bleeding
 edge of Zope, the CVS trunk.  It does not apply if you downloaded Zope
 from a web site.

 We're about to check in to the trunk the unified restricted code
 implementation which is currently on the RestrictedPython branch.  The
 documentation and rationale can be found here:


http://dev.zope.org/Wikis/DevSite/Projects/SupportPython21/RestrictedPython

 We looked at using Bastion and rexec, but neither of them provide the
 kind of granularity demanded by the Zope security model.  So we created
 a new module, RestrictedPython, which is in fact usable outside Zope.

 Although the driving goal was to support Python 2.1, this project has
 given us an opportunity to work on some long-standing issues as well.
 The restrictions are clearer and finally both DTML and scripts use the
 same code to implement security.

 We've tried hard to make the new code work just right, including new
 unit tests and a couple of optimizations.  But there is bound to be some
 breakage.  Also, as the community was warned previously, the new code
 requires Python 2.1.

 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 )



[Zope-dev] manage_debug

2001-04-27 Thread Andy McKay

Clicking on manage_debug kills Zope, honest. Anyone else seen this? Nothing
printed to stderr or anything useful. Sigh.

B 29501752 2001-04-27T17:50:02 GET /Control_Panel/DebugInfo/manage_main
I 29501752 2001-04-27T17:50:02 0

Windows 2K, Zope 2.3.0.

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] manage_debug

2001-04-27 Thread Chris McDonough

What version?

- Original Message -
From: Andy McKay [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 1:56 PM
Subject: [Zope-dev] manage_debug


 Clicking on manage_debug kills Zope, honest. Anyone else seen this?
Nothing
 printed to stderr or anything useful. Sigh.

 B 29501752 2001-04-27T17:50:02 GET /Control_Panel/DebugInfo/manage_main
 I 29501752 2001-04-27T17:50:02 0

 Windows 2K, Zope 2.3.0.

 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 )



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

2001-04-27 Thread Chris McDonough

Gad, I have a rough time with that reading the version thing, sorry.  ;-)

I haven't seen this behavior.


- Original Message -
From: Andy McKay [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 1:56 PM
Subject: [Zope-dev] manage_debug


 Clicking on manage_debug kills Zope, honest. Anyone else seen this?
Nothing
 printed to stderr or anything useful. Sigh.

 B 29501752 2001-04-27T17:50:02 GET /Control_Panel/DebugInfo/manage_main
 I 29501752 2001-04-27T17:50:02 0

 Windows 2K, Zope 2.3.0.

 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 )



___
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: BTreeFolder

2001-04-27 Thread Shane Hathaway

Phillip J. Eby wrote:
 Now, what *I*'d like to know is what the bold new idea is, since it
 sounds like it's something even newer than the
 forward-chained-buckets-plus-conflict-resolution stuff that's already been
 released.

It's simple, really.  BTreeFolders play havoc with acquisition because
every time you pass through them, looking for some name, they perform a
lookup in a BTree.  This wouldn't be an issue if it weren't for the fact
that many sites use implicit acquisition heavily--I once measured 4500
lookups in a simple request to the management interface.

But if the items stored in the BTree follow some simple pattern, we
don't have to perform a BTree lookup for things that don't follow the
pattern.  The most useful pattern would be a string prefix followed by
an integer, which would allow us to use an IOBTree (meaning integer keys
and object values) for storage.  Jim claims an IOBTree is faster. :-)

So when scripts go looking all the way up the tree for the name REQUEST
a hundred times (a common thing to do), the BTreeFolder can ignore it.

The other cool idea he came up with is allowing the folder to decide
what the ID of a new object is going to be so the folder can try to
avoid conflicts with other ZEO clients.  Many Zope applications use time
stamps for IDs, but doing that can lead to frequent conflicts.  Random
IDs avoid conflicts.

However, purely random IDs would cause all the buckets to be loaded in
memory all the time, so Jim's third idea was to have each client
increment sequentially from a random ID and move to a new random ID if
conflicts ever occur.

So, all things considered, you get faster access, fewer conflicts, and
less RAM usage.  Can't beat that. :-)

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] url traversal

2001-04-27 Thread Dieter Maurer

Brett Carter writes:
  I have the classic problem of wanting my method 'foo' to work like:
  http://localhost/foo/a/b/c
  where a,b,c are parameters passed to foo.  I've found some info in the
  mailing list archives, namely:
  http://lists.zope.org/pipermail/zope-dev/2000-May/005197.html
  
  Has the 'Traversal' interface been implemented?  What are the
  specifics of implementing something like I describe above?
Traversal has been implemented for Python Scripts,
when they define the sub_traversal binding.



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] Trying to set roles/permissions programmatically - Now I have a headache!

2001-04-27 Thread Dieter Maurer

Danny William Adair writes:
  I want to set the roles of a permission and turn acquisition of a permission
  (mapping) on and off programmatically. And of course I want to get a
  permission by its name. This looks definitely more complex than simply
  changing an object's property!
My standard response to questions like this:

  You know, you can do this via the Management Interface.

  Its code will tell you, how you can do it: the necessary
  method names and their parameters.
  After you know the names, you look for further documentation:
  the Zope Help, maybe the new Zope Developer Guide,
  the source.

  The source for the updating of permissions is
  AccessControl/dtml/access.dtml.
  The methods are defined in various Python files
  in AccessControl.


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] makerequest.py

2001-04-27 Thread Dieter Maurer

Chris Withers writes:
  I do have memories that REQUEST.AUTHENTICATED_USER has been deprecated. In
  which, case, how should you get hold of the current user's object and can this
  be made to work in a testing environment?
Your company is hosting these great searchable list archives?
They help memory very much.

Your question has been answered some days ago...

  getSecurityUser documented in AccessControl.DTML



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] ZCatalog comments

2001-04-27 Thread Dieter Maurer

Chris Withers writes:
   +- an empty query mapping (or a bogus REQUEST) returns all
   +  items in the
   +catalog.
  
  Is it only me that finds this really irritating? Surely a blank query mapping
  should return nothing, not everything?
  (at the least it'd be nice if this was configurable ;-)
No! Please not!

It is very natural that an empty query returns everything
when subqueries are combined with AND.

   Any time, you add a subquery, the result set is a subset of the former
   one. For this to work out without boundary exceptions
   (we all hate them, I hope!), the empty query must be the complete
   set.

Of course, if subqueries are combined with OR, the empty
query should return no hits

   +Depending on the type of index you are querying, you may be
   +able to provide more advanced search parameters that can
   +specify range searches or wildcards.  These features are
   +documented in The Zope Book.
  
  Wildcards? Hmmm... that's enticing, where and how will they be supported? 
Did you look in the Zope Book?

  The section above says, your question would be answered there.



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] manage_debug

2001-04-27 Thread Andy McKay

I removed some twofish.dll's and this solved this problem. Wierd.
--
  Andy McKay.


- Original Message -
From: Chris McDonough [EMAIL PROTECTED]
To: Andy McKay [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 10:55 AM
Subject: Re: [Zope-dev] manage_debug


 Gad, I have a rough time with that reading the version thing, sorry.
;-)

 I haven't seen this behavior.


 - Original Message -
 From: Andy McKay [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, April 27, 2001 1:56 PM
 Subject: [Zope-dev] manage_debug


  Clicking on manage_debug kills Zope, honest. Anyone else seen this?
 Nothing
  printed to stderr or anything useful. Sigh.
 
  B 29501752 2001-04-27T17:50:02 GET /Control_Panel/DebugInfo/manage_main
  I 29501752 2001-04-27T17:50:02 0
 
  Windows 2K, Zope 2.3.0.
 
  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 )
 


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

2001-04-27 Thread Chris McDonough

What the heck is a twofish.dll?

- Original Message -
From: Andy McKay [EMAIL PROTECTED]
To: Chris McDonough [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 3:52 PM
Subject: Re: [Zope-dev] manage_debug


 I removed some twofish.dll's and this solved this problem. Wierd.
 --
   Andy McKay.


 - Original Message -
 From: Chris McDonough [EMAIL PROTECTED]
 To: Andy McKay [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, April 27, 2001 10:55 AM
 Subject: Re: [Zope-dev] manage_debug


  Gad, I have a rough time with that reading the version thing, sorry.
 ;-)
 
  I haven't seen this behavior.
 
 
  - Original Message -
  From: Andy McKay [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, April 27, 2001 1:56 PM
  Subject: [Zope-dev] manage_debug
 
 
   Clicking on manage_debug kills Zope, honest. Anyone else seen this?
  Nothing
   printed to stderr or anything useful. Sigh.
  
   B 29501752 2001-04-27T17:50:02 GET
/Control_Panel/DebugInfo/manage_main
   I 29501752 2001-04-27T17:50:02 0
  
   Windows 2K, Zope 2.3.0.
  
   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 )
  
 
 
  ___
  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] manage_debug

2001-04-27 Thread Andy McKay

Its part of the twofish encryption modules. I can live without them for a
while.

http://twofish-py.sourceforge.net/

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] Re: BTreeFolder

2001-04-27 Thread Hannu Krosing

Shane Hathaway wrote:
 
 
 However, purely random IDs would cause all the buckets to be loaded in
 memory all the time, so Jim's third idea was to have each client
 increment sequentially from a random ID and move to a new random ID if
 conflicts ever occur.

Can't one just assign some unique id to each ZEO client and somehow use 
_that_  for making up ids ?

It would have the added benefit of knowing which client made up which
id.
 
---
Hannu

___
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: BTreeFolder

2001-04-27 Thread Shane Hathaway

Hannu Krosing wrote:
 
 Shane Hathaway wrote:
 
 
  However, purely random IDs would cause all the buckets to be loaded in
  memory all the time, so Jim's third idea was to have each client
  increment sequentially from a random ID and move to a new random ID if
  conflicts ever occur.
 
 Can't one just assign some unique id to each ZEO client and somehow use
 _that_  for making up ids ?
 
 It would have the added benefit of knowing which client made up which
 id.

I suppose, but I don't see much value in that for most ZEO setups, since
a browser is not bound to a specific client.

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] ZStyleSheets

2001-04-27 Thread Romain Slootmaekers

Yo,
when trying to use the ZStyleSheets, we only found a zip, but no tarball.
After unzipping, it didn't work because appearantly the zip was made for
some OS that has a  case-insensitive file-system.
after renaming the files (zstylesheet* - ZStyleSheets* aso) everything
behaved as expected.

It's a cool product though.
 
you guys be warned.

have fun,

Sloot



___
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] ANNOUNCE: Zope 2.3.2 released

2001-04-27 Thread Brian Lloyd

Hello all,

  Zope 2.3.2 has been released - you can download it from
  Zope.org:

  http://www.zope.org/Products/Zope/2.3.2/


  Zope 2.3.2 contains no changes from 2.3.2 beta 2 other than 
  two small fixes that were accidentally committed to the release 
  branch (it was supposed to be frozen between the final beta and 
  the final release). Since the changes were tiny and easily 
  verifiable, we verified them and left them in.

  For more information on what is new in this release, see the 
  CHANGES.txt and HISTORY.txt files for the release:

- http://www.zope.org/Products/Zope/2.3.2/CHANGES.txt

- http://www.zope.org/Products/Zope/2.3.2/HISTORY.txt


  For more information on the available Zope releases, guidance for 
  selecting the right distribution and installation instructions, 
  please see: 

  http://www.zope.org/Documentation/Misc/InstallingZope.html


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 




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



Re:[Zope-dev] Trying to set roles/permissions programmatically - Now I have a headache!

2001-04-27 Thread Danny William Adair

Hello Dieter!

As you can see in my email (after the first paragraph), I did look through
management interface and AccessControl/*.py

Before writing to the list and annoying others with my little problems, I
1. try it myself (for a short time)

2.
- search the mailing list archives
- search all available docs: Guides, ZB, HowTos, ZQR
- saerch zope.org (wikis)
- try to see if there is a similar situation already solved (management
interface, other products)

3.
- try on my own again (found something useful), this time longer than on 1.

And I have read chapter3 :-)

Unfortunately, setting permissions programmatically has never been a hot
topic for Zopistas (too easy to talk about?).

What I was looking for was a way to get a hold of some sort of Permission
object instance. After strolling the sources, I finally found out what this
is (apparently) all about, and that I was looking for the wrong thing.
(permissionEdit.dtml - Role.py's manage_changePermission -
Permission.py's Permission.__init__)

--
Here's the result, works alright for me:
(Hey nuno! Hth, you asked for something like this on the list a month ago)
--
def setRolesForPermission(ob, permission, roles, acquire):
  for p in ob.ac_inherited_permissions(1):# A
name, value = p[:2]n
if name==permission:
  p=Permission(name,value,ob) # B
  if acquire: roles=list(roles)
  else: roles=tuple(roles)
  p.setRoles(roles)
  return
  raise 'Invalid Permission', (The permission em%s/em is invalid. %
permission)
--
(ok, assigning a value (maybe lots of times) where it's only needed in one
case is inefficent)

A and B were the hints I missed when I wrote the last mail.
So you really *do* run through all the permissions, get their names and
check against your string parameter until you match. (Is this a must?) Then
you *instantiate* a Permission. (see
Permission.__init__(self,name,data,obj,default=None)) Yes, and setRoles
(and acquisition setting) works like I expected, phew.

Thanks anyway,

Danny

 -Ursprungliche Nachricht-
 Von: Dieter Maurer [mailto:[EMAIL PROTECTED]]
 Gesendet: Samstag, 28. April 2001 06.26
 An: Danny William Adair
 Cc: [EMAIL PROTECTED]
 Betreff: Re: [Zope-dev] Trying to set roles/permissions programmatically
 - Now I have a headache!


 Danny William Adair writes:
   I want to set the roles of a permission and turn acquisition
 of a permission
   (mapping) on and off programmatically. And of course I want to get a
   permission by its name. This looks definitely more complex
 than simply
   changing an object's property!
 My standard response to questions like this:

   You know, you can do this via the Management Interface.

   Its code will tell you, how you can do it: the necessary
   method names and their parameters.
   After you know the names, you look for further documentation:
   the Zope Help, maybe the new Zope Developer Guide,
   the source.

   The source for the updating of permissions is
   AccessControl/dtml/access.dtml.
   The methods are defined in various Python files
   in AccessControl.


 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] Permissions to change Acquire Permissions?

2001-04-27 Thread Tim R Ansell

I was wondering if it would be possible for a new permission to be
created, this permission would let (or stop) people from changing the
Acquire Permissions check boxes found in the Security Tab.

The reason I would like a permissions like this is that some users that
need to give people permissions are exactly trusted. This means that
they could change the acquire permissions and circumvent people with
Manager or higher privileges. 

This type of permission could be very useful for zope to have but would
most properly require changing of how permission changing is handled?

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 )



[Zope-dev] ZPT 1.2, TAL 1.2, ZTUtils 1.0 Released

2001-04-27 Thread Evan Simpson

Actually, I uploaded these at 5pm today, then I had to run and catch a
plane.  I still haven't updated the Project wiki, but if you visit:

http://www.zope.org/Members/4am/ZPT

...you can pick up the latest.  You need to download all three;
PageTemplates goes in a Products directory, TAL and ZTUtils go in
'lib/python'.

There's a trio of example Page Templates (with support data) that you
can try out by copying PageTemplates/examples/zpt_examples.zexp into
your import directory and importing it somewhere.  One of them shows off
batching, another shows how to make a tree widget, and the third calls
DTML from ZPT.

Cheers,

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



[Zope-dev] Waagh! More fun games with the CST 0.8 Updater

2001-04-27 Thread Chris Withers

It's running and working okay, but every so often, when running it, I get:

2001-04-27T09:15:23 PANIC(300) ZODB A storage error occurred in the last phase o
f a two-phase commit.  This shouldn't happen. The application may be in a hosed
state, so transactions will not be allowed to commit until the site/storage is r
eset by a restart.
Traceback (innermost last):
  File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\Transaction.py, line 335, in commit
  File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\Connection.py, line 657, in tpc_fini
sh
  File E:\Zope\23CF7D~1.2B2\lib\python\ZODB\BaseStorage.py, line 219, in tpc_fin
ish
(Object: SessionStorage)
error: release unlocked lock

The relevant bit of code is:

path = self.getSessionDataContainerPath()
timeout_mins = self.getInternalDCTimeoutMins()
onstart = self.getOnStartPath()
onend = self.getOnEndPath()

container = self.aq_parent
ob = SessionDataManager(id, path, title, timeout_mins, onstart, onend)
container.manage_delObjects(ids=[id])
container._setObject(id, ob)

Any ideas?

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] create user object for testing purposes (ZUnit)

2001-04-27 Thread Karim Yaici

Hi,
I need some help on the creation of a (dummy?) user object using Python.  I
am trying to test a zope product using ZUnit. I have been able to 'simulate'
a request by using the makerequest.py module (Lib/Python/Testing). Here is
how I used it:

import makerequest
app = makerequest.makerequest(Zope.app())
request = app.REQUEST

Now, the REQUEST object does not contain any AUTHENTICATED_USER, and this
causes me problem because my product is using the user object, in other
words, the product can not be fully tested.

So, is it possible create (or simulated) an AUTHENTICATED_USER in the
REQUEST? if it is, then I'll like to know how.

Thank for your time and help

Cheers,

Karim




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