[Zope-dev] Zope Tests: 5 OK

2008-05-12 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Sun May 11 11:00:00 2008 UTC to Mon May 12 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Sun May 11 20:52:02 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009535.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Sun May 11 20:53:32 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009536.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Sun May 11 20:55:02 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009537.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Sun May 11 20:56:32 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009538.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Sun May 11 20:58:02 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009539.html

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


[Zope-dev] Re: BrowserIdManager help!

2008-05-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Miles wrote:
 Hi,
 
 I am attempting to integrate a zope site with some other applications.
 
 I'm trying to get another application to set the _ZopeId browser/session 
 cookie, so that users can move between the two with a single login.
 
 This requires me to reproduce the code below, so a valid broser Id is 
 returned:
 
 (from Products.Sessions.BrowserIdManager 505:512)
 
 def getB64TStamp(
  b2a=binascii.b2a_base64,gmtime=time.gmtime, time=time.time,
  b64_trans=b64_trans, split=string.split,
  TimeStamp=TimeStamp.TimeStamp, translate=string.translate
  ):
  t=time()
  ts=split(b2a(`TimeStamp(*gmtime(t)[:5]+(t%60,))`)[:-1],'=')[0]
  return translate(ts, b64_trans)
 
 Unfortunately, I don't know any C, and the TimeStamp function is only 
 available in C.  I'm hoping someone can spare a few minutes to explain 
 how this function could be coded in python so I can understand it, and 
 produce a non-python function to return valid browser ids.
 
 I hope that makes sense!

This should do to get the eight-byte representation used by TimeStamp
(the value inside the backquotes):

- --- % ---
import struct
from time import gmtime
from time import time

SCONV = 60.0 / float(116) / float(116)

def _toEightBytes(year, month, day, hour, minutes, seconds):
years_offset = year - 1900
months_offset = (years_offset * 12) + (month - 1)
days_offset = months_offset * 31 + (day - 1)
hours_offset = (days_offset * 24) + hour
minutes_offset = (hours_offset * 60) + minutes
seconds_exp = int(seconds / SCONV)
return struct.pack('L',
   minutes_offset) + struct.pack('L', seconds_exp)

def TimeStamp__data(now=None):
 Return the current time as an 8-byte string.

if now is None:
now = time()
zulu = gmtime(now)
seconds = now % 60
args = zulu[:5] + (seconds,)
return _toEightBytes(*args)
- --- % ---



Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIKGNx+gerLs4ltQ4RAlQYAKDPZTJakP3crES4Bk3B06HAxJ1uTQCgn+Vm
oeZIFt1Whn2vxTmL4yrBFYg=
=u0+E
-END PGP SIGNATURE-

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


[Zope] Getting records X to X+20 of catalog search

2008-05-12 Thread Sinang, Danny
Dear All,
 
How do we get records X to X+20 of a catalog search ?
 
We're aware of the limit parameter of the search () function, but this
only gives us the top Z rows. 
 
If I want to show records 90 to 100, I'm trying to avoid having to fetch
records 1 to 89.
 
Regards,
Danny
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting records X to X+20 of catalog search

2008-05-12 Thread Andreas Jung



--On 12. Mai 2008 16:39:02 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Dear All,

How do we get records X to X+20 of a catalog search ?

We're aware of the limit parameter of the search () function, but this
only gives us the top Z rows.

If I want to show records 90 to 100, I'm trying to avoid having to fetch
records 1 to 89.


Catalog operations become basically expensive when you call getObject(). 
Slicing the resultset first should not be harmful.


-aj

pgpThfb7arqNY.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Confused about permissions

2008-05-12 Thread Brenda Bell
I have a simple use case for Zope where a group of users need to be able 
to manage content stored in external files.  I installed ExternalFile 
and it seems to be working as expected for the admin user.

I've created a folder where all ExternalFile objects reside.  I've 
defined a local role Editor for that folder, added a user and assigned 
that user to the Editor role.

What I can't seem to do is get the permissions right such that a user in 
the Editor role can add new External Files.

I've checked every box on the Security tab for the Editor role.  Users 
in the Editor role can view and modify existing ExternalFile's but still 
cannot add new ones.

I thought maybe the problem had to do with permissions on the 
ExternalFile product itself, but when reading the description on the 
Define Permissions tab I couldn't really figure out what it was trying 
to say:

The first column below lists the permissions for this object. The 
second specifies the permissions that should have this permission in 
this product or ZClass. For ZClass methods, only permissions that are 
defined for the ZClass are permitted.
In general, any permissions that include operations that change (mutate) 
an object should be disabled.

What exactly does this mean?

More to the point:  What permissions do I need to assign to my Editor 
role so users can add External Files?

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )