Re: [Zope] Find a object in a zope list

2005-05-07 Thread Andreas Jung

--On Samstag, 7. Mai 2005 19:52 Uhr -0700 Allen Huang <[EMAIL PROTECTED]> 
wrote:

I have a fold and I used objectValues['Image'] to make a array list of
images. I have rename each image using AUTHENTICATED_pic.jpg and want to
use an if statement to find the image with the same name in the array
list. Can someone tell how?? Is there a findObject function or something??

if someid in folder.objectIds(['Image']):
...
-aj

pgpsIuFZEaHvG.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] Find a object in a zope list

2005-05-07 Thread Allen Huang
I have a fold and I used objectValues['Image'] to make a array list of images. I have rename each image using AUTHENTICATED_pic.jpg and want to use an if statement to find the image with the same name in the array list. Can someone tell how?? Is there a findObject function or something??
		Yahoo! Mail 
Stay connected, organized, and protected. Take the tour___
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] Zope stops responding on hpux

2005-05-07 Thread Jens Vagelpohl
On May 7, 2005, at 23:45 , Samuel Bieri wrote:
Dear list-members
I am desperately trying to get our zope application run on hpux,  
and any help is greatly appreciated. I have the following problem:
I know this isn't really helpful, but when it comes to exotic  
operating systems like HP-UX you might be all on your own and there  
won't be many people to help. If you really want to use Zope it might  
be easier and cheaper in the long run to buy a i386-based commodity  
server and put Linux on it.

jens
___
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] Re: RSS feed: post-processing?

2005-05-07 Thread Eva Miller
MILLER Eva  multcolib.org> writes:

So far, I've written the following python script to accomplish what I'm trying
to do:

# Finds ISBNs in a link and creates a new link to search a library catalog

import re,string, urllib,urllib2

def librarylookup ():

href = open("booktest.txt")

line = href.read()

isbn = re.search ('(is[bs]n=)([0-9]*)',line)

lookup="http://ipac.multcolib.org/ipac20/ipac.jsp?index=ISBN&term=%s>Check the
catalog" % (isbn)

print lookup

librarylookup()
---

My problem is the booktest.txt part. I'm just doing that to test the rest of the
script, which seems to work. What I actually need the script to do is read the
input from an RSS feed on pages like this one:
http://demo.plinkit.org/interestsideas/goodreads/sinList?synmap=HardcoverFiction

I want the script to insert a link to a public library catalog that searches for
this item. So, it has to read the RSS feed and leave behind the link. It would
have to be invoked for every ISBN, I guess. I'm using CMFSin to get the feeds.

I know I have to create this as an external method then call it. Kinda unsure
how to do that part, too.

Someone out there surely knows more than I do. Actually, almost everyone out
there knows more than I do. Help the poor librarian!

Eva

___
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] Zope stops responding on hpux

2005-05-07 Thread Samuel Bieri
Dear list-members
I am desperately trying to get our zope application run on hpux, and any 
help is greatly appreciated. I have the following problem:

When I click on a tal-object ("Page Template") to edit it, then zope 
stops responding. No error is logged, nothing. I even cannot stop zope 
anymore with "zopectl stop" or control-c if started with runzope. It 
seems that zope silently crashes... However, I can create a tal-object, 
it only happens when I try to edit.

The last entries in tracert.log are:

B 1087990040 2005-05-07T22:52:27 GET /temp_folder/tz/manage_workspace
I 1087990040 2005-05-07T22:52:27 0
A 1087990040 2005-05-07T22:52:27 302 370
E 1087990040 2005-05-07T22:52:27
B 1087991560 2005-05-07T22:52:27 GET /temp_folder/tz/pt_editForm
I 1087991560 2005-05-07T22:52:27 0
crash
The last entries in Z2.log:

127.0.0.1 - admin [07/May/2005:22:51:57 +0200] "POST 
/temp_folder/manage_addProduct/PageTemplates/manage_addPageTemplate 
HTTP/1.1" 302 215 
"http://localhost:8080/temp_folder/manage_addProduct/PageTemplates/manage_addPageTemplateForm"; 
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) 
Gecko/20050414 Firefox/1.0.3"
127.0.0.1 - admin [07/May/2005:22:51:57 +0200] "GET 
/temp_folder/manage_main HTTP/1.1" 200 15638 
"http://localhost:8080/temp_folder/manage_addProduct/PageTemplates/manage_addPageTemplateForm"; 
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) 
Gecko/20050414 Firefox/1.0.3"
127.0.0.1 - admin [07/May/2005:22:51:57 +0200] "GET 
/misc_/PageTemplates/zpt.gif HTTP/1.1" 304 258 
"http://localhost:8080/temp_folder/manage_main"; "Mozilla/5.0 (Windows; 
U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3"
127.0.0.1 - admin [07/May/2005:22:52:27 +0200] "GET 
/temp_folder/tz/manage_workspace HTTP/1.1" 302 370 
"http://localhost:8080/temp_folder/manage_main"; "Mozilla/5.0 (Windows; 
U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3"
---crash

My configuration are:
Python 2.3.3 compiled from source downloaded from the HP site: 
http://hpux.connect.org.uk/hppd/hpux/Languages/python-2.3.3/
This is the only python I manage to compile with-threads enabled.

Zope 2.7.6-final compiled from source
hpux version:
$ uname -a
HP-UX zuse B.11.11 U 9000/800 647349392 unlimited-user license
Zope Version

(Zope 2.7.6-final, python 2.3.3, hp-ux11)
Python Version

2.3.3 (#40, May 3 2005, 09:18:26) [GCC 3.4.3]
System Platform

hp-ux11
I have also compiled and run zope versions 2.7.0/3/5, with no luck and 
always the same problem.

Has anyone seen a similar problem with zope?
Is anyone running zope successfully on hpux? Information on zope on hpux 
is very scarce, so I fear that I am very lonely in the field...
Any hint is greatly appreciated where I can look at or how I could debug 
zope.

Thank you very much
Samuel
___
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] Is it possible to extend Zopes WebDAV authentication?

2005-05-07 Thread mark hellewell
On 5/7/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Well, in theory its possible if the client accepts cookie to just
> store the amount of wrong attempts via cookie (or id - which would
> be the same) and deny any password, be it even the correct one
> when it comes via basic auth.

Store the incorrect login count client-side in a cookie?! No way! :)
 
> But I strongly believe this does not save from abuse because
> its just too easy to remove the cookie or just not accept
> it in the first place. So I'd say its not worth the work.

Yes, I think it would be a bad idea.

mark
___
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] Is it possible to extend Zopes WebDAV authentication?

2005-05-07 Thread mark hellewell
On 5/7/05, Chris McDonough <[EMAIL PROTECTED]> wrote:
> Web Folders pass cookies around too, FWIW, so it's probably not strictly
> necessary to use http basic auth.  But without using http basic auth,
> there is no way to log in unless you have them go to the web interface
> first, then launch a web folder, so maybe impractical.

That's exactly what's happening at the moment; the WebDAV access is
linked to via the web interface after they log in (it's only one small part
of a larger system). They log in via the web, gaining a cookie which
is passed to the Explorer 'web folders' thing, so when they click on the
link to the WebDAV part of the site the cookie is still valid and they don't
have to log in to WebDAV. *

All I'm trying to do is boost the security of the system overall by ensuring
an attacker can't simply sidestep the 'three login failure lockout' just by
repeatedly trying to log in via WebDAV.

mark

* A thought occurs to me after writing it like this. Might it be possible
to forbid HTTP Basic auth logins to WebDAV, so that only cookies
are the allowed authentication type?

> - C
___
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] Is it possible to extend Zopes WebDAV authentication?

2005-05-07 Thread Tino Wildenhain
Am Samstag, den 07.05.2005, 12:04 -0400 schrieb Chris McDonough:
> Web Folders pass cookies around too, FWIW, so it's probably not strictly
> necessary to use http basic auth.  But without using http basic auth,
> there is no way to log in unless you have them go to the web interface
> first, then launch a web folder, so maybe impractical.

Well, in theory its possible if the client accepts cookie to just
store the amount of wrong attempts via cookie (or id - which would
be the same) and deny any password, be it even the correct one
when it comes via basic auth.

But I strongly believe this does not save from abuse because
its just too easy to remove the cookie or just not accept
it in the first place. So I'd say its not worth the work.

___
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] A memory leak in Zope, PageTemplateFile and macros?

2005-05-07 Thread Dieter Maurer
Marco Bizzarri wrote at 2005-5-6 22:35 +0200:
> ...
>However, if you access start_html, which uses the standard_template_html 
>as a macro, you can see an increase.

I saw a small one after thousands of requests.
> ...

>You're mentioning that these could be normal causes, 
>but what are these causes?

Small memory consumption increases can be caused by an effect
known as memory fragmentation. The "C" runtime library (and Python
on top of it) does not support memory compaction. Therefore, free memory
areas can only be joined together if they are adjacent (and even then
memory management may not do it). As a consequence, the free memory
tends to be fragmented in a large number of small blocks.

> ...
>I've tried this both on 2.7.3 and 2.7.6, and in both cases I'm 
>experiencing the problem. Do you have any suggestion on what I could 
>possibly investigate?

The usual approach in investigating memory leaks works as follows:

  *  you flush the ZODB caches
 ("Control_Panel --> Database Management -->  --> Flush cache
 --> "minimize").

  *  you visit "Control_Panel --> Debug information" and
 "update snapshot"

  *  you perform your test

  *  you flush the ZODB caches

  *  you visit "Control_Panel" --> "Debug information"
 and analyse the changes in reference counts (in the middle
 of the page).

This allows you to recognize leaks at the level of instances (of classes).
The "LeakFinder" product helps you with the above steps.


I did this for your case and could not determine leaking instances.


When instances of static types (e.g. strings, integers, dictionaries, ...)
leak, they cannot be detected in this way. Neither can
leaked caused by fragmented memory.

Python can be build in a special way to analyse leaks of
any Python objects. Note, however, that all "C" extensions
(especially Zope) must be then build in a consistent way.

Tracking down such leaks is even more expensive that
those involving standard Zope objects.


There are tools around to analyse leaks at the "C" level.
I had used the commercial product "purify" once (a long time ago).
Andreas (Jung) told me that some open source project (I think
it was KDE) has built a similar tool.

-- 
Dieter
___
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] Debugging product init with zopectl?

2005-05-07 Thread Dieter Maurer
J Cameron Cooper wrote at 2005-5-6 11:48 -0500:
> ...
>I agree, it would be nice to have zLOG work on startup, but I don't know 
>how easy/possible that is.

It would be very easy -- with the exception of people that
run Zope as "root" (and later switch the process user).

This silly silent logging during startup was only
implemented to avoid problems occuring when Zope starts up
as root and later switches.

Zope could easily start logging as soon as it had read
the configuration file and had seen that it is not going
to switch users.

>In debug mode (the default) Zope fails when a Product fails to init. 
>This is useful when running 'runzope' since you don't have to kill Zope. 
>Without debug mode, Zope will start up, but the Product will be broken, 
>and its failure listed in the Products section of the Control Panel.

But unfortunately, there are errors that are not reported
via the product's "Traceback" tab.
The only reliable source is the logfile.

-- 
Dieter
___
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] Security framework troubles

2005-05-07 Thread Dieter Maurer
Anders Bruun Olsen wrote at 2005-5-6 18:19 +0200:
> ...
>  security = ClassSecurityInfo()
>  security.setDefaultAccess("deny")
>  security.declareProtected("View Bookbase", "index_html")
> ...
>When the template tries to access container/title an access denied
>expection is raised. With VerboseSecurity I get this explanaition:
>
>Unauthorized: The container has no security assertions. Access to
>'title' of (Bookbase at /bookbase) denied.
>
>What exactly am I missing here?

Up to Zope 2.8, you cannot protect access to objects
of simple type (such the "title" attribute of type "string")
in an easy way.
Access to such attributes are dually protected:

   By the "Object Permission" (set via "security.declareObjectProtected")
   *and* the "setDefaultAccess".

"setDefaultAccess" can in fact take dictionaries and callables
as arguments. Read the Zope Developper Guide for the
types available for "__allow_access_to_unprotected_subobjects__"
and how they are interpreted.
"setDefaultAccess" just causes its argument to be assigned
to "__allow_acc...".

-- 
Dieter
___
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] Debugging product init with zopectl?

2005-05-07 Thread Chris McDonough
On Fri, 2005-05-06 at 12:48, J Cameron Cooper wrote:
> I agree, it would be nice to have zLOG work on startup, but I don't know 
> how easy/possible that is.

FWIW, the reason zLOG doesn't start writing to the log at an earlier
time is that it waits until the process can switch effective users.  If
it didn't and Zope started by root (or another user that isn't the
desired effective user), some log files might be written as root, and
would become unwritable at a second startup (this used to be a FAQ
before Zope 2.7 prevented it from happening).  Probably some work can be
done here to be smarter in cases where this doesn't matter.

- C


___
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] Is it possible to extend Zopes WebDAV authentication?

2005-05-07 Thread Chris McDonough
Web Folders pass cookies around too, FWIW, so it's probably not strictly
necessary to use http basic auth.  But without using http basic auth,
there is no way to log in unless you have them go to the web interface
first, then launch a web folder, so maybe impractical.

- C


On Sat, 2005-05-07 at 06:31, Jens Vagelpohl wrote:
> On May 6, 2005, at 23:52 , mark hellewell wrote:
> 
> > On 5/6/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> >
> >> Actually, it does not. You have no such thing like a session
> >> when all you have is webdav. I dont know if many dav-clients
> >> store cookies too - it may depend on your usecase.
> >>
> >
> > Yes the use-case is Windows Explorer users only.
> 
> If this is supposed to use that "Web Folder" thingy in Windoze  
> Explorer you might want to reconsider. That WebDAV implementation is  
> seriously broken. Installing helpers like WebDrive on Windoze seems  
> to make WebDAV access work for many people.
> 
> jens
> 
> ___
> 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 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] Is it possible to extend Zopes WebDAV authentication?

2005-05-07 Thread Jens Vagelpohl
On May 6, 2005, at 23:52 , mark hellewell wrote:
On 5/6/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
Actually, it does not. You have no such thing like a session
when all you have is webdav. I dont know if many dav-clients
store cookies too - it may depend on your usecase.
Yes the use-case is Windows Explorer users only.
If this is supposed to use that "Web Folder" thingy in Windoze  
Explorer you might want to reconsider. That WebDAV implementation is  
seriously broken. Installing helpers like WebDrive on Windoze seems  
to make WebDAV access work for many people.

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