[Zope-dev] Re: CRITICAL!!!! CVS: Zope/lib/python/OFS - Image.py:1.141.4.3

2002-12-17 Thread Paul Winkler
On Tue, Dec 17, 2002 at 07:51:08PM +0100, Maik Jablonski wrote:
 Andy McKay wrote:
 Well there you go, I deleted my sandbox and did clean cvs checkout and it
 seems to have updated correctly. I've put back Paul's patches as he
 originally intended them to be.
 
 Sorry about that.

Partly my fault, Andy - you asked me yesterday to verify that
you'd checked in everything I'd sent you, and I said yes.

There was also a change to lib/python/Products/OFSP/help/Response.py
that was part of my fix for #342 as well, did that make it in?
 
-- 

Paul Winkler
http://www.slinkp.com
Welcome to Muppet Labs, where the future is made - today!

___
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] z3 sprint at pycon?

2002-12-20 Thread Paul Winkler
Is anybody planning a zope 3 sprint at pycon?

would be a good excuse for me to dive into
z3 :)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's COMPLEX ICE WITICIST!
(courtesy of isometric.spaceninja.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] Zope Publishing

2003-01-08 Thread Paul Winkler
On Wed, Jan 08, 2003 at 02:04:23PM -0800, Sameer Maggon wrote:
 Hi,
 
 In some CMS we have different environment for Development (Authoring),
 Staging and Production. The CMS Database that resides in the Development
 setup is usually more bulky than the database in the production and staging
 site. Can any body tell me how Zope fits into this situation, is there any
 component that takes care of this?

We use ZSyncer to push changes from development to staging, and 
then to multiple production systems.  It requires some carefulness
because zsyncer is very very slow when pushing a lot of stuff at once.
(It basically exports in memory the objects to be synced,
transfers the export data across the network, and imports them
on the remote machine with an xmlrpc call. All three stages of this
process can potentially take a long time.)

We're also having issues with zsyncer reporting incorrect sync status
(both falsely reporting out-of-date status, AND falsely reporting OK status).
I hope to block out some time to work on zsyncer soon and fix this.

 My major concern is that, it might be that my repository contains huge
 number of images but actually the site uses only some of them. So when
 actually deploying a site, the system should resolve those images and put
 the required files.

I don't know of any existing tool to do that for zope.
You'd have to write your own.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's PERFORMANCE ARTIST A-THON!
(courtesy of isometric.spaceninja.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] AdaptableStorage

2003-01-15 Thread Paul Winkler
On Wed, Jan 15, 2003 at 05:30:58PM +, seb bacon wrote:
 Shane, AdaptableStorage is insane and beautiful - congratulations :-)

It seems to inspire insanity :) kosh and i got into a discussion on #zope
about using AdaptableStorage with reiserfs4, mapping zope properties
to reiserfs4 properties... finally, a fully really transparent 
unix filesystem - ZODB solution that isn't a half-assed version of either! 
didn't get into detail but it seems like it should be doable.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE BUTTERY THIGH!
(courtesy of isometric.spaceninja.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] [PATCH] Forking daemon in debug mode, and new start scripts

2003-01-21 Thread Paul Winkler
On Tue, Jan 21, 2003 at 07:26:11PM -0500, Chris McDonough wrote:
 z2.py -Z0 STUPID_LOG_FILE=
 
 ... which prevents Zope from detaching from the terminal but doesn't
 imply debug mode.  This may only work on recent checkouts, the semantics
 of -Z have changed recently.

Interesting!  In 2.6.0 the -Z flag is documented thus:

  -Z 0 or 1

UNIX only! This option is ignored on Windows.

This option controls whether a management process will be created
that restarts Zope after a shutdown or crash.

If the argument to -Z is non-null (e.g. -Z1 or -Zyes), a
management process will be used.  If the argument to -Z is -, or
0, (e.g. -Z- or -Z0), a management process will not be used.
On UNIX, the default behavior is to create a separate management
process (e.g. -Z1) if the -Z option is not specified.

(Note: the -Z option in Zopes before Zope 2.6 used to be used to specify
a pidfile name for the management process.  This pidfile no longer
exists).

  Speaking of the (side-)effects of debug mode, what exactly are they?
  Is it just the automatic re-loading of DTMLFiles and PageTemplates
  from disk?
 
 It's that... and, unfortunately, god knows what else.  To find out for sure,
 we'd need to audit the codebase (looking mostly for Z_DEBUG_MODE and __debug__).

at least in  2.6 it also toggled whether tracebacks were
displayed openly (debug mode) or embedded in an html comment.
 
 I'd like to address these problems for Zope 2.7, but I doubt it's going
 to be possible in the short term.

What he said. :(


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE TONGUE!
(courtesy of isometric.spaceninja.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] [PATCH] Forking daemon in debug mode, and new start scripts

2003-01-21 Thread Paul Winkler
On Tue, Jan 21, 2003 at 08:07:01PM -0500, Guido van Rossum wrote:
  On January 21, Guido van Rossum wrote:
   There may be a Zope debug mode, but it's not related (even if it
   uses the same envariable).
  
  I'm sorry, I'm talking about Zope's debug mode.
 
 Eh?  This started with your suggesting a change to ZEO/start.py, to
 which I objected.
 
 Oh well.  What a waste of time.

Now I'm lost.  
He posted a patch to lib/python/zdaemon/Daemon.py.
Nobody said anything about ZEO/start.py.

-- 

Paul Winkler
http://www.slinkp.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 )



[Zope-dev] absolute_url: why not publishable?

2003-02-05 Thread Paul Winkler
Visit foo/absolute_url and you will find that it 
has an empty or missing docstring.
Is this by design, or is it just something that nobody has needed?
I would like to propose making it callable TTW, unless somebody
knows a reason it should not be.

I could make use of it in two ways:

1) every now and then I forget that it doesn't work, and I type stuff like 
http://my_zope_site/foo/bar/baz/absolute_url
when I'm not sure if baz is being acquired from foo, from bar, or the site root 
(or maybe even a CMF skin) and I want to find out quickly.

2) (kind of esoteric)  It would be nice to be able to easily get normalized
URLs from zope objects into non-zope systems that link to Zope content.
e.g. today I wished I could tell a JSP developer at my company to
use something like 

a href=%= stupidHttpClient('http://zope_server/foo/bar/absolute_url') %

(... and yes, we do have something like a stupidHttpClient.)
 

-

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's HIGHLY TOXIC PIRATE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] absolute_url: why not publishable?

2003-02-05 Thread Paul Winkler
On Wed, Feb 05, 2003 at 05:08:35PM -0500, Shane Hathaway wrote:
 I don't know whether absolute_url should be accessible via URL, but 
 here's a way to get the same thing (almost): add a script at the root of 
 your site called AbsoluteURL, with the body return 
 context.absolute_url().  Then just use 
 http://example.com/foo/bar/AbsoluteURL; instead of 
 http://example.com/foo/bar/absolute_url;.

sure, I can do that... i'm just surprised it's not on by default.

Here's another argument:
Image.tag is callable via URL.  absolute_url is not.
Inconsistency is confusing, especially to newbies.

if I had the time, I'd go through the API Reference and
catalog methods that are callable by URL and methods that
are not, and try to make some sense of it.
I suspect it would be pretty random ;-)

For now, I think I will file a feature request  patch in the
collector.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's OCTO FLAGELLA FIGHTER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] What makes Zope twirl?

2003-02-06 Thread Paul Winkler
Or: when zope goes into a nonresponsive state,
what can you do to diagnose the cause?

The even that prompts this question:

Our production system (2 zeo clients) went down today.
Platform: Linux 2.4, Zope 2.5.1 from source (wo_pcgi), 
Python 2.1.3 from source, running behind Apache
for one site, and a custom java proxy for another site
(don't ask). ZServer is not exposed to anything
except the servers running Apache and the Java proxy.

All the zope processes were still running,
CPU usage was low (almost nil for python), * 
there was plenty of free physical memory  swap. 
Yet Zope was not responding to requests.
A look at the access logs revealed that
zope had not logged anything since the time
we noticed the outage. Nothing
unusual before that except AltaVista crawling our site
(a measly 2 requests / second).

A restart seemed to fix everything, though one
of the zeo servers went down again (same symptoms)
about 20 minutes after starting. Restarted it again
and both servers have been fine for hours now.

This seems to be rare; I haven't seen it before on
this particular server, but I saw a similar wedge
on our dev machine about 3 weeks ago.

I've looked at ALL the logs (access log, zeo log,
zope stdout / stderr log) and found nothing at all
unusual, just the aforementioned AltaVista crawl
and a couple of RAM Cache errors from non-pickleable
objects that I need to dis-associate from the cache.
But none of this is new.

Is it time for Big M? WOuld that give me anything
useful?


* this does not sound like other zope spins
I have heard of, in which python eats 99% CPU
indefinitely due to (probably) an application error.
see for example:
http://www.zopezen.org/Members/zopista/News_Item.2003-01-28.1025 


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CAPTAIN STETOSCOPE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] What makes Zope twirl?

2003-02-07 Thread Paul Winkler
On Fri, Feb 07, 2003 at 10:06:55AM -0500, Shane Hathaway wrote:
 You have to keep it in perspective.  Spin prevention is a small part of 
 the stability equation.  Zope is quite stable--if it weren't, CBS, SGI, 
 and others wouldn't use it.

Indeed. To put this in perspective, I have had exactly 1 spin
on a production zope system since Jan 1. My group has had
*several* BEA server crashes in the same time.
I consider Zope to be much more reliable than BEA.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's LORD ORIGINATOR I LOVE YOU!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] Zope Server Control

2003-02-07 Thread Paul Winkler
On Fri, Feb 07, 2003 at 10:32:44AM -0800, [EMAIL PROTECTED] wrote:
 If there is any interest in a framework that could provide the underlying
 functionality to multiple UI front-ends, as well as automated stuff like
 alerts/monitoring, I would certainly be interested in using and contributing
 to development of such a beast.

Oooh! Oooh! One more: build in a window with a python prompt
that connects straight in to a ZEO debugging session (
(possibly remotely).

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's BETA CAPTAIN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] Zope Server Control

2003-02-07 Thread Paul Winkler
On Fri, Feb 07, 2003 at 03:16:46PM -0500, Shane Hathaway wrote:
 Okay, I added some features to the mockup:
 
 http://hathaway.freezope.org/Images/controller_snapshot2.png

I dig it.

(clicking on the mockup buttons) Ungh. Can't seem to make it work.
(drool drool)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's AMERICAN TWIN THE MAYOR OF REVENGE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Bare except dangerous to ZODB? was Re: [Zope-dev] Accept-Charset hearders causing 500 internal server error.[correct but not lenient]

2003-02-10 Thread Paul Winkler
On Mon, Feb 10, 2003 at 06:11:15PM -0200, Leonardo Rochael Almeida wrote:
 Please, please, please, don't use generic except:. They can cause ZODB
 corruption if they catch ConflictErrors.

Can anyone else confirm or deny???
If true, it needs to be much more widely publicized!

$ cd /usr/src/Zope-2.6.1-src/lib/python/Products/
$ find . -name *py -exec grep -H except: {} \; | wc -l
170

well, this is all stuff that comes with Zope, hopefully
they have been vetted... but then there's all these
3rd-party products:

$ cd $INSTANCE_HOME/Products
$ find . -name *py -exec grep -H except: {} \; | wc -l
133


Great, so there's at least 133 things to examine to see if they
could catch a ConflictError.  And I only wrote about 15 of those.
The rest could be very time-consuming to audit.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE GOBLET!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] Multiple author and reviewer roles in Zope CMF

2003-02-12 Thread Paul Winkler
On Wed, Feb 12, 2003 at 03:20:39PM -0200, Leonardo Rochael Almeida wrote:
 Local Roles rule and should have more visible placement in the Security
 tab...

I constantly forget that it exists :)
While we're on the subject - are local roles acquired
in subfolders?
 
 Hmm, maybe I should file that as a Feature Request bug.

+1

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's JANITORIAL-BROOM-NINJA ANDREA KEG!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )



Re: [Zope-dev] Multiple author and reviewer roles in Zope CMF

2003-02-12 Thread Paul Winkler
On Thu, Feb 13, 2003 at 11:14:18AM +1100, Adrian van den Dries wrote:
 On February 12, Paul Winkler wrote:
  While we're on the subject - are local roles acquired
  in subfolders?
 
 Yes, to the point that globals roles are actually redundant, but serve
 as an optimisation of a local role at the same level as your
 userfolder.

thanks, that's good to know.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ULTRA BONOBO FIGHTER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] LOTS of roles?

2003-02-21 Thread Paul Winkler
has anybody ever set up a site with a large number of roles?
we're contemplating a security model for our app that might
lead to ~ 100 Roles within a year, possibly thousands 
within the next 5 years.  (Outline of the actual problem is
at the end of this message)

(The users and roles will be managed in LDAP, by the way;
we plan to use LDAPUserFolder for this and not do any
user or role administration in Zope.)

I seem to recall the Zope Book or some other text
advising against large numbers of roles, but IIRC that
was only because of the UI. Obviously the ZMI default 
Security tab will not scale.
I think I can replace that without too much trouble:
possibly have the main page list only the roles vertically,
with each one being a link to manage_roleForm as it is currently.
As the number of roles grows very large this main page
could be broken into batches if necessary.
And of course there'd be a link to another page with a list
of permissions to manage, and each of those would link
to manage_permissionForm.
i'm also thinking to use checkboxes as the current UI is too easy
to unselect everything by accident.

The question is, if I can solve the interface issues, are
there other reasons not to have hundreds or thousands of roles?
It seems to me that there should not be performance issues,
since I assume that finding the current user's roles
is just a dictionary lookup which should scale pretty well...
we're not talking millions of roles here, and each user
will have only a handful of roles.

comments?

more about our scenario:

* We must anticipate users at hundreds of locations

* there might be 10 or so users at each location

* permissions can be grouped pretty well into tasks, but are
  specific to a location - permission to do a task at one
  location must not mean permission at all locations.
  To me this suggests several Roles per location, corresponding
  to the grouped tasks at that location.

* each user might work from several different locations

* each user might need different permissions when working
  at different locations

* We have multiple applications, not all in zope, so LDAP is looking
  attractive.  


-- 

Paul Winkler
http://www.slinkp.com

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-02-22 Thread Paul Winkler
On Sat, Feb 22, 2003 at 02:24:10PM +0100, Oliver Bleutgen wrote:
 With locations, do you mean physical locations of the clients (i.e. 
 IP-adresses), or the locations of objects inside zope (i.e. 
 /department1, /department2 etc.)?

Both.
Let's call them sites instead of locations, because they're
physical sites: a discrete physical resource that our users need to 
manage. One user may have certain permissions
at one of these sites, and different permissions at another.
Unfortunately this is a required feature.

It's also true that there may be specific content 
and applications in zope which correspond to a specific 
physical site, but not to the whole group of sites.
and that's why zope needs to be involved with
such a complex security model.

example:


Three physical sites, 1 2 and 3.

Three tasks, X Y and Z. 
task X involves reading some class of data.
task Y involves reading some other class of data.
task Z involves writing some class of data.

Two users, A and B.

User A working at site 1 performs tasks X and Y.
User A working at site 2 performs tasks Y and Z.
User A working at site 3 cannot do anything.

User B working at site 1 cannot do anything.
User B working at site 2 performs task X.
User B working at site 3 performs tasks X, Y, and Z.


The solution we are considering is to have one
role per site per task.
If we were to name the roles after the site and task identifiers,
we'd end up with something like:

User A has roles 1X, 1Y, 2Y, 2Z
User B has roles 2X, 3X, 3Y, 3Z

... but this obviously leads to an explosion of roles.
e.g. 10 tasks * 200 sites = 2000 roles.
Hence my original question. :)

Bear in mind that we do not intend to do any of the user or
role management in Zope; that would all be done in LDAP, and
it would be officially Not My Problem. ;-)
So all I'd need to do in Zope would be to assign permissions
on particular folders to one or more of these 2000-some roles.
So I'd need to write a security UI for the ZMI that can handle this
well, because the default one cannot.

We've also discussed the possibility of making this modified
zope security UI available publically, if there is community interest.
Does anybody actually like the one huge security grid?
Try adding a couple roles to a CMF site and it already gets a bit unwieldy...

The other possibility I've considered is a custom UserFolder
which assigns the user's roles dynamically depending on what
physical site they are working on (which we can always find out).
This seems less bulky - many fewer roles from Zope's perspective -
but i'm concerned about introducing security bugs that might
go unnoticed, and I've never written a UserFolder so I don't know
how long it would take.  And I'm worried about session issues -
if user A is doing some remote work for site 1 and then switches
to site 2, would all of his roles be updated immediately and correctly?
And we may need to allow a user to work on two sites 
*simultaneously* which would not be possible in this model.

--

Paul Winkler
www.slinkp.com



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-02-24 Thread Paul Winkler
On Mon, Feb 24, 2003 at 12:41:01PM +0100, Oliver Bleutgen wrote:
 From that I gather that your sites don't map 1:1 to objects into 
 zope, so that you cannot use local roles for that, right?
 E.g, there are methods like doTaskX(location,...), where the permission 
 to execute that method depend on location, and location is not an object 
 inside zope.

That is correct.

 Well, for me roles are just a simplification/optimization for getting 
 permissions of a user (for an object) for the sake of easier management.
 From the mapping
 user_id - set of permissions, we go to
 user_id - set of roles - set of permissions, where the last mapping is 
 defined by mappings of the form role - set of permissions.
 This works, because for typical situations, you just need to define a 
 handful of roles.

i'm with you so far...

 Since your application might not be suited for that scheme, it might be 
 worth throwing out roles altogether. How about creating a role for each 
 user (i.e. user user_id get's just the role user_id, instead of 
 creating a role for for each possible (task,location) tuple.
 When creating a new user, the admin would have to just assign the 
 permissions, instead of roles. This task could be made easier by 
 creating template permission sets.

Interesting idea... tell me if I'm wrong, but I see two obvious
problems with this approach:

1)  for one-role-per-user:  we'd have to visit the security management for
N objects in Zope and adjust the permissions every time we add a user.
Whereas in my proposal, we only need to do that every time we add
a site or change the tasks, which happens much less frequently.  

2) for one-role-per-user, changing a user's privileges means wanding around
the ZMI setting permissions on N objects.
Whereas in my scheme, we can do that in one place (LDAP) by 
adding or removing a role or two.

 You might wind up with less roles and I bet administration is a lot easier.

my guess is that in our case, the number of roles would be comparable.
200 sites * 10 tasks = 2000 roles
200 sites * 10 users = 2000 roles

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-02-24 Thread Paul Winkler
On Sun, Feb 23, 2003 at 09:02:24PM +0100, Dieter Maurer wrote:
 I think (not sure, though) that Zope has the following time
 complexity for permission checking:
 
   If a user has u roles and a permission is allowed for
   a roles, then Zope checks for each of the u roles
   whether it is in the list of a roles.

That's correct, I just found this in lib/python/AccessControl/User.py,
in the definition of allowed:

   user_roles = self.getRoles()
   for role in object_roles:
   if role in user_roles:
   if self._check_context(object): 
   return 1
   return None

(_check_context ensures that the object is not acquired from some
other context where this user doesn't exist.)


   The complexity is u * a whith can be too high for
   large u and a.

Indeed... and object_roles seems likely to be bigger than user_roles
(in general, but drastically moreso in my scenario). which means
that it's quite likely we'd iterate for quite some time before
findign a match.

   It is easy to optimize this to u + a (via a dictionary),
   then thousands of roles should not be a problem.

would that mean you have to build a (potentially huge) dictionary every 
time?  I'd greatly appreciate it if you could expand on this suggestion.

Thanks!


-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-02-24 Thread Paul Winkler
On Mon, Feb 24, 2003 at 07:18:21PM -0300, Leonardo Rochael Almeida wrote:
 
 I don't think a multitude of roles is the way to go. The way your
 problem sounds, you need users being allowed/forbiden to do certain
 tasks depending on which part of the site they are. This is what
 local-roles are for: parameterizing the permissions of a user based on
 the location of the objects inside Zope.

Yes, except that Oliver hit the nail on the head when he said:

From that I gather that your sites don't map 1:1 to objects into
zope, so that you cannot use local roles for that, right?
E.g, there are methods like doTaskX(location,...), where the permission
to execute that method depend on location, and location is not an object
inside zope.


 However you do mention that you need to manage this centrally,
 especially since this information won't be used by Zope alone (and even
 if it was, you need centralized administration of these local roles,
 something that Zope doesn't give you, unless you consider Zope central
 :-), which I think you don't, because you consider LDAP central. Is
 this correct?).

yes.

 So I think you need dynamically calculated local roles. This can be
 achieved by a user folder that returns a user object that overrides
 .getRolesInContext(object) to take the location (or any other
 attribute, such as an acquired site) of object and check it against
 your central authorization source (eg. LDAP).

hmmm... now i'm leaning back this way again.
some quick testing with a large number of roles (10,000 added
via a ZEO debug session) reveals that performance does indeed
suck with that many roles. i could pursue the optimization that 
Dieter suggested but i'm no longer sure that I want to; the lots of roles
idea was a lot more attractive when I thought it would be only
a UI issue.  Instead it looks like I'd have to make substantial
changes in lib/python/AccessControl and there's a few more thousand
lines of code in there which I haven't even looked at yet.

 exUserFolder has had modifications to allow construction of
 authentication sources that override user.getRolesInContext, but none of
 its default auth sources use this so far.
 
 Hope I made some sense :-)

I think so. This stuff makes my head hurt. :)

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-02-25 Thread Paul Winkler
On Tue, Feb 25, 2003 at 11:33:54PM +0100, Dieter Maurer wrote:
 Paul Winkler wrote at 2003-2-24 16:27 -0500:
   ...
  It is easy to optimize this to u + a (via a dictionary),
  then thousands of roles should not be a problem.
   
   would that mean you have to build a (potentially huge) dictionary every 
   time?  I'd greatly appreciate it if you could expand on this suggestion.
 
 Even when you create the dictionary anew each time, it will have
 (almost) u+a complexity.
 
 However, the dict might be cachable in volatile variables
 (i.e. _v_ variables).

good idea, thanks.

 As it is not my problem, I am a bit reluctant to search
 for optimazation possibilities.

understandable... for anyone else who's interested, i just found this
by Alex Martelli:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52303

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] LOTS of roles?

2003-03-04 Thread Paul Winkler
On Tue, Feb 25, 2003 at 06:33:16PM +, Florent Guillaume wrote:
 Leonardo Rochael Almeida  [EMAIL PROTECTED] wrote:
  So I think you need dynamically calculated local roles. This can be
  achieved by a user folder that returns a user object that overrides
  .getRolesInContext(object) to take the location (or any other
  attribute, such as an acquired site) of object and check it against
  your central authorization source (eg. LDAP).
 
 Note that you'll also want to change validate() if you go that route.
 It has a short-circuited version of getRolesInContext in it.

I'm now looking into doing this...
and i haven't found what you mean.
there are a bunch of validates() in various modules in AccessControl,
which are you talking about?

]$ grep def validate( * 2 /dev/null
AuthEncoding.py:def validate(reference, attempt):
AuthEncoding.py:def validate(self, reference, attempt):
AuthEncoding.py:def validate(self, reference, attempt):
AuthEncoding.py:def validate(self, reference, attempt):
SecurityManager.py:def validate(self, accessed=None, container=None, name=None, 
value=None,
User.py:def validate(self, request, auth='', roles=_noroles):
User.py:def validate(self, request, auth='', roles=_noroles):
ZopeSecurityPolicy.py:def validate(self, accessed, container, name, value, 
context,
cAccessControl.c:   /*| def validate(self, accessed, container, name, value, 
context


are you sure it's not BasicUser.allowed() that you mean?
there's a comment in there about checking roles manaully
rather than with getRolesInContext...

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Declaring Dependencies for XML documents (Was: HowTo Improve Cache Coherency for RAM/Disk Cache Manager...?)

2003-03-04 Thread Paul Winkler
On Tue, Mar 04, 2003 at 02:32:31PM -0500, Shane Hathaway wrote:
 Ah, but you might have something there.  What if there were a cache 
 manager that simply dropped its contents whenever anything changes in 
 ZODB?  You could associate nearly all scripts and templates with that 
 cache manager without any fear of stale cache entries.  For many sites, 
 it could be an instant win.

interesting idea. there's certainly plenty of sites, though, where
the cache would get invalidated so often that the cache would be
of limited value.  e.g. a busy squishdot-type site, or many CMF sites.
and on those kind of sites, the busiest times are when you most need
the cacheing...

but the simplicity is certainly appealing...  and in my case, i 
have a CMF site where this would likely be quite useful since
the public never logs in, only our content management team, and
we tend to make changes on dev servers and push them to production
in a big bunch.

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: [Vote] PEP308 voting began

2003-03-04 Thread Paul Winkler
On Tue, Mar 04, 2003 at 03:21:57PM -0600, Evan Simpson wrote:
 Is this worth a robust implementation, ZPT folks?

maybe, but i'd rather first wait and see how the PEP goes.
it would suck to have to constantly deal with two totally
different flavors of ternary.

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: Security internals, was Re: [Zope-dev] LOTS of roles?

2003-03-06 Thread Paul Winkler
On Fri, Mar 07, 2003 at 08:56:59AM +1100, Adrian van den Dries wrote:
 (/me revisits LDAPUserFolder)
 
 Looks like the work is already done for you anyway: allowed() and
 friends check if the context has an attribute acl_satellite, and
 queries it for any additional roles, and it even keeps a cache.


!!  OMG !!!

thank you - for some obscure reason it never would have occurred to
me in a million years that LDAPUserFolder already does this.
Well, duh.

 Huzzah open-source software!

Amen!

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: [Vote] PEP308 voting began

2003-03-07 Thread Paul Winkler
On Fri, Mar 07, 2003 at 07:33:44AM +0100, Joachim Werner wrote:
 If I understood the intentions of ZPT right one of the ideas was to get 
 rid of too much application logic in the template. But currently ZPT 
 seems to be extended to become very similiar in functionality to DTML. 
 I'd prefer to see an approach where Python is used wherever it makes 
 sense and ZPT is kept as simple and stupid as possible.


+sys.maxint

ugly python expressions in ZPT is to me a clear signal that
you need to refactor and that's a GOOD THING.  And refactoring
is easy when you can just start by copy / pasting the
python expressions into a Script.  If they were some
new-fangled if: then: else: syntax in TAL, you'd have to
rewrite from scratch...  and we're right back in the
mess we got into with DTML: the poor developer is forced
to learn many ways of doing the same thing.


-- 

Paul Winkler
http://www.slinkp.com
look! up in the sky! it's secretary The Archer of Doom
(randomhero courtesy isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Proposed installation changes for review

2003-03-10 Thread Paul Winkler
A few questions / concerns listed below, otherwise it looks
fine to me...

On Mon, Mar 10, 2003 at 04:41:48PM -0500, Chris McDonough wrote:
   debug mode

does this still toggle a whole bunch of things?

   production installation (on/off)

what's this mean?

   network servers (http, dav, ftp, monitor, etc)

is this where you set the ports?

One thing I didn't see in your list is a way to extend the products
path (currently I do that with $PRODUCTS_PATH).  We need that.

One more question: Does zopectl.py always detach from the terminal
(booo) or not (yay) ?  
Or does it behave like z2.py and this depends on debug mode (booo) ?


-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Proposed installation changes for review

2003-03-10 Thread Paul Winkler
On Tue, Mar 11, 2003 at 12:11:25PM +1100, Adrian van den Dries wrote:
 Debug mode needs to be broken out into directives for its real
 effects.

+L

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ULTRA PENGUIN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope] Re: [Zope-dev] Proposed installation changes for review

2003-03-10 Thread Paul Winkler
On Mon, Mar 10, 2003 at 10:31:13PM -0500, Fred L. Drake, Jr. wrote:
 Detaching, or daemonizing, will be a separate configuration
 parameter from everything else.

great, that is exactly what i really want.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's GARGANTUAN SKULL OF THE REVOLUTION!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope] Re: [Zope-dev] Proposed installation changes for review

2003-03-11 Thread Paul Winkler
On Tue, Mar 11, 2003 at 04:25:09PM -0500, Guido van Rossum wrote:
   Oops, I stand corrected.  But Zope 2.7 does include ZEO!
  
  Very good!  But in that case, shouldn't the new Zope 2.7 install and 
  startup stuff support it?
 
 Well, in a typical installation, you won't be running ZEO on the same
 machine as Zope, right?  ZEO has its own install and config stuff,
 which is very similar to that for Zope, but ZEO is not installed as
 part of the main Zope install.

i suppose it's not typical but we run zeo on all our systems including
the dev boxes, because

* we like to have the same environment everywhere for sanity's sake

* interactive debugging is very cool and has saved my butt more
  than once.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's FAT BOY!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope] Re: [Zope-dev] Proposed installation changes for review

2003-03-11 Thread Paul Winkler
On Tue, Mar 11, 2003 at 10:01:53AM -0500, Dan L. Pierson wrote:
 I don't see an equivalent to ./zctl.py debug anywhere.  This starts up an 
 interactive Python as
 a ZEO client with ZServer and Zope imported and app = Zope.app().  I use it 
 constantly.  Please?

+1.  I also use zctl.py debug nearly every day.

of course it's just a convenience, but it's an important
convenience because nearly every document i can find
on debugging Zope says roughly ...and of course you
can use ZEO, but that's beyond the scope of this article...

-- 

Paul Winkler
http://www.slinkp.com

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: [Zope3-dev] How (in)secure is Zope?

2003-03-13 Thread Paul Winkler
On Wed, Mar 12, 2003 at 09:39:02PM -0500, Tres Seaver wrote:
 Now let me describe another configuraton, running in production now for
 years (one process in the cluster had an uptime of 400 days at a recent
 hardware-induced reboot):
 
   - Two Zope application servers run behind a load balancer and an
 Apache proxy (non-caching), serving requests against data in a
 shared storage server.
 
   - The server permits through-the-web registration, with minimal
 identity check (only a valid e-mail address.  As of this writing,
 there are 18000+ user accounts.
 
   - Users of the site get a member folder where they can create
 templates, Python scripts, and content within the ZODB.  Some
 minimal workflow exists, controlling basically whether the user's
 content is included in site searches.

Hmmm, I wonder what this site is. ;-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's GIRL ATHON!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Versions: should they die?

2003-06-04 Thread Paul Winkler
To anyone not following the Problem committing  zope 'version' objects
thread on [EMAIL PROTECTED]:  It's been proposed that Versions should be
at least stamped in the ZMI with big warnings, or possibly disabled
altogether.  Numerous users have been bit by the fact that versions
basically do not work as advertised, leading in various cases to zodb 
corruption or work that can't be saved.  There are other security issues
that Oliver Bleutgen raised privately which I won't state here.

Comments?  Could we get at least some warnings in the ZMI before
2.6.2 final?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE COSMIC!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] funky side-effects, possible bug in HTTPRequest.py

2003-06-20 Thread Paul Winkler
On Fri, Jun 20, 2003 at 03:07:18AM -0700, Jamie Heilman wrote:
 Anyway, it was a learning experience for me, but I'm not convinced
 this isn't a bug.  What do you think?

From the POV of a poor web monkey, my opinion is that this is 
purely awful. It's the kind of thing that can easily waste hours of
debug time.

I was just saying to Andy McKay yesterday that sometimes I think
zope 2 is designed around the principle of greatest consternation
rather than the principle of least suprise. Case in point.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ANTHROPOLOGIST MAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Patching object class

2003-06-20 Thread Paul Winkler
On Fri, Jun 20, 2003 at 04:56:26PM +0200, Florent Guillaume wrote:
 I have the need to update some persistent objects in a ZODB to change 
 their class.
 
 One use case comparable to the one I have would be to change all objects 
 of type Folder to OrderedFolder.
 To do that, I envisionned finding all thoses objects and doing
 
   ob.__class__ = OrderedFolder
   ob._p_changed = 1
 
 Would this work ?

See the thread Renaming a product just a few days ago.
The conclusion was that this would not work.

 If not, what other hack could I do ? The idea being that I don't want to 
 recreate all the objects.

You might not have a choice.
A conversion script might take a while to run and your ZODB might
get a bit more bloated, but otherwise, it'll work fine.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ULTRA BULLET FROGMAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] WebDAV interoperability event

2003-07-16 Thread Paul Winkler
I just stumbled across this... I think it would be really cool if
there was a zope presence.

http://www.webdav.org/other/interop03/

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's PORPOISE MADE OF BUTTER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 03:59:58PM +1000, Richard Jones wrote:

 Say a method listFilesByUser returns a list of (user, [files]) 
 it'd be nice to  be able to::
 
tal:repeat=user,files here/listFilesByUser
 
 or similar. Currently we would have to use a python: expression to manually 
 unpack the tuple. Kinda yucky.
 
 Any comments?

hmm... so you want to extend the language so you can write:

  span tal:repeat=user,files here/listFilesPerUser
div tal:content=user 
  user goes here 
/div
div tal:repeat=file files
 tal:content=file 
  file goes here 
/div
  /span


I disagree... There's probably a million little things that
would be nice in ZPT. Rather than feature-creep TAL/TALES, which
are pretty simple currently, let's leave the heavy lifting to
our favorite tried-and-true general-purpose language.

In this case, consider a trivial change to (or wrapper around) 
listFilesByUser to make it return a sequence of dictionaries
like {'user': some_user, 'files': (file1, file2...)}
Then your zpt could look like:

  span tal:repeat=fpu here/listFilesPerUser
div tal:content=fpu/user 
  user goes here 
/div
div tal:repeat=file fpu/files
 tal:content=file 
  file goes here 
/div
  /span


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's TWINKLY-GIANT WOMAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 10:48:10AM -0400, Shane Hathaway wrote:
 Think of prefixes as site-wide, generally useful Python scripts.

That's fine and dandy... but please please PLEASE don't let that
be the only way to call them. Put them in ZTUtils, or
Products.PythonScripts.standard, or someplace generally available.

What bothers me is the tendency in z2 to improve one tool with 
little features that would be nice to have, adding functionality 
that is either not provided elsewhere, or is provided elsewhere in a 
totally different way. So please, if there's new functionality
you want to add, consider: how would I use this
functionality from a script? from dtml? from a product?

 Quite 
 often some API returns something that's intuitively easy to present, but 
 ZPT's syntax makes it somewhat difficult to present.  For example, it 
 should not be necessary to write a Python script or expression every 
 time you want to format the number 5 as $5.00.

No script needed, and I *like* that zpt encourages python
expressions. Makes it easy to refactor things out into Scripts when 
you realize that your page template is doing too much work.

In this case, the expression you need is documented
(although it really needs an explicit example) in the Zope Book,
API Reference:

span tal:define=pss modules/Products/PythonScripts/standard
  div tal:content=python:pss.dollars_and_cents(5.0)
   $1.00
  /div
/span

You could argue against the define at the beginning, but I think of
those as being analogous to python import statements:
before I get started, I'm going to give myself convenient access
to the stuff I need.

You could also argue that we need a non-US-centric currency formatter,
and I agree; but I say again that we need it everywhere and not only via
some special syntax in ZPT.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's OUR ROCKET PERVERT!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 11:07:20AM -0500, Evan Simpson wrote:
 ...  This would allow 
 options/a_mapping/key:items/index:0 rather than 
 python:options['a_mapping']['items'][0].

Why is that an improvement? surely it's not saving 3 characters
that makes the new syntax worthwhile...

 options/a_mapping/by:key/items/by:index/0.

do you find this easier to read or write than the python version?

I guess I don't understand the goal. Are we trying to make it
so that zpt authors don't have to know any python?
I really think that's a mistake.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's RED ORIGAMI SNOWMAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 02:04:51PM -0400, Fred L. Drake, Jr. wrote:
 There are those that consider using python: expressions in ZPT should
 be discouraged, primarily because it's yet another syntax for a web
 developer to learn.
 
 I'm not necessarily one of them, but I am sympathetic with that
 reasoning.

I'm definitely not one of them. I am sympathetic with the impulse
- don't place too many burdens on the web developer - but I think that
in this case it's misguided. I don't mean to be harsh, but
I feel very strongly about this:

I think it is wrong to think that one can be an effective web developer 
with zope and never have to write a single python expression.
WHen I started using zope, lots of people were trying to build
entire applications with nothing but DTML and propertysheets
and the like. The result was some really horrid DTML.
I am still maintaining some of this gunk, and I'm really looking
forward to the day I can finally rewrite our oldest running zope apps.

The solution to DTML-from-hell was to refactor the logic into scripts 
written in - guess what - python. This is now widely regarded as 
best practice for quick through-the-web scripting and site development 
in zope.

I always thought that one of the key design goals for TAL/TALES was to
be very minimal and *force* the developer to offload anything difficult 
into python.  I think ZPT is successful partly because of this feature.

My concern is that ZPT will grow so many conveniences that it will 
become easier to abuse it in the same way that DTML has been 
widely abused. New zope developers will then be more tempted to
avoid python (i don't have time to learn another language) and
with the best intentions will do themselves a serious disservice: 
a lot of things will still be unnecessarily difficult compared to 
using python, and a lot of logic will be in templates where it 
doesn't belong.


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's LORD MC-FJUKER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 05:15:48PM -0400, Shane Hathaway wrote:
 Paul Winkler wrote:
 On Wed, Jul 23, 2003 at 02:04:51PM -0400, Fred L. Drake, Jr. wrote:
 
 There are those that consider using python: expressions in ZPT should
 be discouraged, primarily because it's yet another syntax for a web
 developer to learn.
 
 I'm not necessarily one of them, but I am sympathetic with that
 reasoning.
 
 That's not my reasoning either. :-)
 
 My feeling is that you should avoid mixing syntaxes in a single 
 document.  The more syntaxes you mix, the more perfection you require of 
 developers.

Ah. yes, i think there's something to that.

 Take the following code:
 
 pre tal:content=python: text.replace('\\n', 'br /') /
 
 This code has at least four errors (one XML, one HTML, one ZPT, one 
 Python--can you spot them?),

heheh, good example... took me a while to find 4 :-)

but it will work anyway without complaint. 
  This is hard to debug because it requires complete understanding and 
 perfect spelling of four languages at once: XML, ZPT, HTML, and Python.

yeah, that sucks. Maybe I'm just upset that you want to remove my
favorite of the four. :-)  Given the context, of course, python is 
the only one that's a candidate for removal from the template.

 I wholeheartedly agree that newcomers should learn Python as well as 
 ZPT, but there should be a clean separation of the two.

I think I'd have to try rewriting some of my complex templates with 
no python expressions whatsoever before I'd know if I agree with you.

 I have a slightly different concern.  You're concerned that people will 
 use path expressions when they could use Python expressions.  I'm 
 concerned that people will use *any* kind of complicated expressions 
 instead of Python code blocks.  To me, the choice between path 
 expression and Python expression isn't very meaningful; either way I'm 
 putting logic in a template, and if it's too complicated, it doesn't 
 belong there.  The better goal is to move complicated logic out of 
 templates and into Python code blocks, don't you think?

Yes, I do. But I've found that when I write templates, there is a typical
progression:

 1. Start with a simple path expression:

 request/foo

 2. Whoops, now I need to do something a bit more involved:

 python:here.do_something(request.foo, here.something_else, ...)

 3. ugh, it's getting too long - 
move the python expression into foo_script and change
the tales expression to:

 here/foo_script

The current proposals aim to reduce the need to go to step 2.
Nice goal - it is true much of my ugliest template code has
been caused by pushing 2 too far. But I find that going from step 2 
to step 3 is so easy that I don't mind refactoring and it's
usually very quick.

However... it should be noted that step 2 can be completely bypassed.
There's nothing preventing me from going from 1 directly to 3.
I only use 2 because it's there :-)  Thinking more about it, it
occurs to me that python expressions in TALES provide a huge hole
in the separation of presentation from logic. 

Consider the psychological factor - python expressions are 
convenient sometimes. Many of us do not have the willpower to 
resist. :-)  Adding features to TALES doesn't change this, it 
gives us another brand of rope to hang ourselves with.

 I know of two ways to avoid writing complicated expressions in templates:
 
 1. Move complicated expressions into Python code blocks.
 
 2. Provide a simpler equivalent for complicated expressions.

what about:

 0. make complicated expressions illegal

I'm only half-joking. Why are we arguing for adding more stuff to TALES
rather than removing python expressions? Can someone think of an 
example that *requires* a python expression and can't be done with a 
path expression and a Script? If so, is it solvable by improving
the interaction between templates and Scripts instead of adding
features to Templates?

I seriously doubt this would meet community approval for zope 2,
there's too much existing code that would break.  but maybe it should be 
considered (if it hasn't been already) for zope 3.

 Prefixes in the middle of path expressions attacks #2.

hm. i guess i would agree if I thought any of the proposals actually 
are significantly simpler!  Let's stick to your first point - 
python in ZPT is undesirable because ZPT already makes you deal with
3 languages (assuming the output is html and not just XML).

But since we are stuck with 3 languages in one file,
why do we want to make one of them more complex than it already is? 
And since we know that we very often need a fourth language in another file, 
why not leverage that capability to keep the template super-simple?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's PORN STAR OMEGA!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev

Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-23 Thread Paul Winkler
On Wed, Jul 23, 2003 at 06:15:46PM -0400, Paul Winkler wrote:
(snip)
 I think I'd have to try rewriting some of my complex templates with 
 no python expressions whatsoever before I'd know if I agree with you.
(snip)
 I only use 2 because it's there :-)  Thinking more about it, it
 occurs to me that python expressions in TALES provide a huge hole
 in the separation of presentation from logic. 

I didn't mean to sound schizo... i'm just thinking out loud! :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MOSTLY-PENGUIN WEARING A HAT!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-24 Thread Paul Winkler
On Thu, Jul 24, 2003 at 11:00:09AM +0200, Jean Jordaan wrote:
 Perhaps it's worthwhile for this thread to have a look at 
 http://www.eby-sarna.com/pipermail/transwarp/2003-July/000606.html
 http://www.eby-sarna.com/pipermail/transwarp/2003-July/000607.html
 and following to see what Phillip Eby is cooking up. 
 
 The templates he proposes have only two or three attributes, 
 keeping logic rigorously out of the template.

Very interesting idea. Here's an excerpt:


I think that ZPT still embed code in a web page, and that there's a better 
alternative.  If you've seen PSO (pso.sf.net), Twisted's Woven, or even JSP 
taglibs (though that's a bit of a stretch), you'll have a better idea of 
what PWT (peak.web.templates) looks like.  Here's an example, straight from 
the test suite:

body
  h1 model=foo view=textTitle Goes Here/h1
  ul model=bar view=list
li pattern=listItem view=text/li
  /ul
/body

'view' attributes identify the object factory used to create the tag, 
'model' attributes are a path to the data to be used, and 'pattern' 
attributes identify parameters that are supplied to the nearest containing 
'view', rather like a METAL macro slot (except that views are written in 
Python, rather than being templates, although I intend to make it possible 
to use a template as a view, too).  Views are looked up in a property 
namespace so you can configure access to arbitrary view components that 
your app (or anybody else) supplies


I don't totally grok it (an object factory creates a tag?
does he mean the contents of the tag? and since they're factories written
in python shouldn't they be called something other than 'views'? like
maybe 'factory'??).  But, odd terminology aside, it's compellingly simple. 
I guess that the 'view' and the 'model' only have to agree on an 
interface ('pattern' names).

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's DEPUTY SHERIFF OF JUSTICE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] breaking apart INSTANCE_HOME.

2003-07-25 Thread Paul Winkler
On Fri, Jul 25, 2003 at 09:52:14AM -0400, Chris McDonough wrote:
 - You can specify in the config file any number of
   Products directory paths and these will be knitted
   together into the Products pseudopackage.

Sounds good. One thing to watch out for - this needs to be tested
with CMF, specifically with the FilesystemDirectoryView product.
FSDV does not (as of zope 2.6) find its filesystem content if it
is anywhere other than under lib/python/Products or $INSTANCE_HOME/Products.
It is the only product I've tried that doesn't work anywhere else
on $PRODUCTS_PATH.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's UGLY-HAIRDRESSER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Functional testing of export/import?

2003-07-28 Thread Paul Winkler
I'm trying to write a functional test that verifies that an instance
of my Product works correctly after it's been exported and re-imported.
I'm stuck on how to give the test object a valid _p_oid which is needed
to do the export.

Background:
This Product is a dynamic content object for CMF. Its behavior depends on 
another CMF type instances, which it keeps a path to. So I need to ensure
that things work even when one or both objects have moved. I've got
moving  renaming handled well and now I want to test import/export.

So my test suite sets up a dummy CMF instance. I do this by swiping 
stuff from the CMFCore and CMFDefault tests; I subclass SecurityRequestTest
and then do

manage_addCMFSite(self.root, 'cmf_test_site' )
self.site = self.root.cmf_test_site

I've also got a portal folder in the site which I keep a handy 
reference to as self.fol1. 

All tests are passing, now I move on to writing the export / import tests.

Let's say the object I want to export is self.cmf_test_site.fol1.cp1.
I have a shorthand reference to this stored as self.cp1.
So I think the first thing I need to do is get the export data
like this:
data self.fol1.manage_exportObject('cp1', download=1)

... and once that works, I'll use the same data to do an import.

But the export fails. Using pdb and browsing some source I've learned 
that cp1 needs a _p_jar and _p_oid in order to be exported.  
The _p_jar I've already dealt with in my move / rename tests, by swiping
a hack from CMFCore/tests/test_portalFolder.py:

id = self.cp1.getId()

# W! must get _p_jar set
old, self.cp1._p_jar = self.cp1._p_jar, self.root._p_jar
try:
data = self.fol1.manage_exportObject(id, download=1)
finally:
self.cp1._p_jar = old

That seems to work fine. 

But now I'm stuck on _p_oid. How do I give the object a valid one?
I'm sure I can't just use the same trick and swipe the _p_oid of the app 
root :-P

I must say that using pyunit to write functional tests for zope 2 / CMF 
is a royal pain. It requires too much knowledge of implementation.
(why should i need to worry about _p_foo???)
Also I've found that if there's an error in your class' setUp(),
it can cause the test to hang and never show you a traceback.

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-29 Thread Paul Winkler
On Tue, Jul 29, 2003 at 06:22:38PM +0100, Chris Withers wrote:
 Paul Winkler wrote:
 
 On Wed, Jul 23, 2003 at 11:07:20AM -0500, Evan Simpson wrote:
 
 ...  This would allow 
 options/a_mapping/key:items/index:0 rather than 
 python:options['a_mapping']['items'][0].
 
 Why is that an improvement? 
 
 Personally, I find it much easier to read...

I find the opposite:

Assuming that the reader understands python, s/he has to
perform the mental translation anyway in order to understand
how this expression uses the objects it refers to.

Assuming that the reader does NOT understand any python, 
it doesn't make much sense. The immediate questions arise: What's a 
key? What's an index? What's the difference between them? 
How do I know when to use one or the other?
And, how do you answer those questions without talking about
python data structures?

 I wonder what non-python'ers would think?

well, that's a very good and relevant question, but I doubt
we will find them on this mailing list :-)
I would really like to know.

 I guess I don't understand the goal. Are we trying to make it
 so that zpt authors don't have to know any python?
 
 For me, that would be ideal...
 
 I really think that's a mistake.
 
 What leads you to believe that?

The appeal of TALES path expressions lies in their simplicity.
I don't want them to feature-creep into a general purpose 
programming language. The more complex these expressions get, the more 
work a zope developer (e.g. someone developing new content types, 
services, etc.) has to expend on mentally translating between different 
languages, which is always an opportunity to get something wrong
as we've already discussed.  We all know that Python has a near-unbeatable
record as an easy-to-use, well-designed, and downright fun language.
It has a great reputation as a first language.  These new proposals for 
TALES path expressions do not have any such track record, so I am
naturally skeptical that they are going to beat python at one of its
strengths: readability and novice-friendliness.

Consider what happened with Zope 2 and DTML: the templating
language had enough features that novice developers often got themselves
into trouble by writing excessively complex templates with embedded
logic. The zope 2 tutorial and most other available documents gave the
impression that you didn't need to learn python to get things done
in Zope. Since the addition of ZPT and Python Scripts, things have
improved enormously; but I remember a time when the [EMAIL PROTECTED] list 
was full of questions like how do I do my complex task in DTML. 
It was easy to get your feet wet, and without clear  explicit ways
to use python, it was easy to fall off the continental shelf where 
suddenly nothing worked anymore and nothing made sense.  

So I am very wary of ZPT becoming Son of DTML From Hell,
and that's what the proposed extensions smell like to me.

To frame it as a practical question: how is the template author going to 
get something non-trivial done? 

Assuming that TALES python expressions are banned/discouraged/whatever, 
there are 3 choices:

1) The template author writes some auxiliary python code 
(whether this is a script or a Product or a Persistent Module or 
whatever). This is the case most familiar to me - I'm usually doing 
most of my work alone.  In this case the author has to know both 
ZPT and python - but not both in the same document. 

2) Stretch the capabilities of the template language so that no
python is necessary anywhere.
I think we agree that *currently* this is bad practice, when it's
even possible.

3) Get somebody else to write the python code, and just
refer to the code objects with TALES path expressions.

This is what I think you are suggesting - yes? no?
It's hard for me to imagine working strictly in this fashion, because 
in my limited experience I've never worked that way and I don't know 
anybody who does.  *Do* people actually work this way?  If you don't 
know any python, isn't it tempting to write some icky template code 
yourself instead of waiting for the code guy to have time to help you?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's USELESS MEGA BOY!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Functional testing of export/import?

2003-07-29 Thread Paul Winkler
On Mon, Jul 28, 2003 at 02:49:33PM -0400, Casey Duncan wrote:
 You can usually commit a subtransaction to get a _p_jar and oid (I think) set. 
 You can still abort this at the end of the test to clean up.

yep, this seems to work very nicely! Thanks Casey!

def setUp(self):
   ...
   get_transaction().commit(1)
   ...


def tearDown(self):
   ...
   get_transaction().abort(1)
   ...

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's EXTRA YELLOW BLOWER CHEESEMONGER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-29 Thread Paul Winkler
 that
your class uses.

When it's time for zope 3, most of your work will then consist of rewriting
the wrapper (and maybe writing some zcml configuration file).
In zope 3, the wrapper should hopefully be simpler than what you need
for zope 2.

At least, that's the theory :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ROYAL ALTOIDS TIN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-29 Thread Paul Winkler
On Tue, Jul 29, 2003 at 04:43:21PM -0400, Shane Hathaway wrote:
 Python expressions won't be banned.  I will never consider them 
 discouraged for all cases, either.  There will always be a need for 
 constructs like:
 
 div tal:condition=python: a == b.../div
 div tal:condition=python: (a and b) or c.../div

ok.

 However, the following is quite bad:

And quite common :-)  Browse through some of the CMF skins...

  tal:x define=ss nocall:modules/Products/PythonScripts/standard
  a tal:attributes=href python: ss.url_quote(some_url) /
 /tal:x
 
 This is un-Pythonic in numerous ways.
 
 - You can't use the import statement.  In fact, you can't use any 
 statements at all--only expressions.

 - The nocall: prefix.

 - The name 'modules' is present automatically along with many other 
 names that aren't in the Python builtins namespace.

 - Importing using a path expression.

agreed on all 4.  although, import is the only time I miss statements.

 - Binding a variable to a value without an equal sign.

That took some getting used to.  I don't know why this was
chosen, but it seems a bit late to change it now.

 - You have to prefix Python expressions with python:.

That's a feature! If we didn't have that, how would you know the
difference between
   tal:replace=a/b 
and
   tal:replace=python:a/b

 Zope 2's method of slightly simplifying this is to write a two-line 
 script and find it through implicit acquisition.  The overhead of 
 invoking a script is somewhat large, but here's what the template would 
 look like anyway.
 
 a tal:attributes=href python: here.url_quote(some_url) /

yes, this is about the best you can do currently. In fact,
I quite like it. :)  

 Zope 3 will not have implicit acquisition.  In fact, no system but Zope 
 2 has implicit acquisition.  That leaves us with no possible way to 
 write the above statement in non-implicit Python!  No matter what you 
 do, you need some help from another kind of expression.  Until recently, 
 here was the way to write it in Zope 3.
 
 tal:x define=url_quote nocall:here/++acquire++url_quote
   a tal:attributes=href python: url_quote(some_url) /
 /tal:x
 
 That alternative is just as complicated and un-Pythonic as importing a 
 module in a template.  I can't think of a better way to write this given 
 the limitations of Zope 2 ZPT, without the giant implicit acquisition 
 band-aid.  Can you?
 
 Zope 3's new alternative looks about like this:
 
 a tal:attributes=href here/format:url_quote /

Where do you put the argument? I don't see some_url.

 To me, that's a vast improvment, and it's only one example.

It also raises some new questions that are about
on par with what would be needed to understand the zope 2 version: 
What kind of thingie is format:? Where can I find it if I want 
to learn what else it can do?  What do I do if I want 
format:some_custom_format?  How could I replace or augment
the format thingie and not break any template that uses it?

Not that it's bad to raise these questions ... I just want to point
out that the answers are far from self-evident.

 You know what was actually wrong with DTML?  The lack of Python Scripts. 
  Without Python Scripts, everyone used DTML as a programming language. 
  Once Python Scripts came around, DTML became a reasonable templating 
 language again.  If DTML used TALES expressions, it would be just as 
 clean as ZPT.

I think I just said this in another post :)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MUZZY ANTIDISESTABLISHMENTARIANISTIC FJUKER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] simpler TALES. (was Re: TALES idea: tuple unpacking)

2003-07-30 Thread Paul Winkler
On Tue, Jul 29, 2003 at 07:23:36PM -0300, Leonardo Rochael Almeida wrote:
 But right now the choice between adding or not the proposed TALES
 extensions is a choice between having to explain what all those python
 concepts mean before or after the poor template guy got confused why
 certain things don't work as expected:
 
 * Why must I use a tal:define=something here/getSomeObject and
 later a tal:content=something/someAttribute instead of just
 tal:content=here/getSomeObject/someAttribute.

you don't :)
it's a convenience (less stuff to type if you access the object a lot)
and/or an optimization (getSomeObject might be expensive).

 * Why does tal:content=request/form/items don't get me the
 items object that I'm expecting

you lost me there.

 In order to get to the ideal world Paul wants (and that I want too),
 maybe we need to restrict the things that TALES can navigate. That would
 mean we'd need to chose between TALES path navigating dictionary keys or
 attribute access, but not both.

Hm. Doesn't really matter - ObjectManager makes them equivalent
anyway (except that some keys cannot be spelled as attributes, 
e.g.  foo['bar.html']).

 Also, paths would not be able to call
 anything in the last segment.

eh? so tal:content=here/some_method would no longer work?

I don't really understand your proposal I'm afraid.

 On the other hand, we'd need to give
 python scripters the necessary tools, ex. before ZPT, I used to find it
 VERY anoying that I had to use the mapping attribute in DTML tags just
 because I couldn't create MyBrain objects thru python. PythonScripts
 should be able to generate the same kind of objects that ZCatalog and
 ZSQL queries generate.

Not sure what you mean. You want to wrap Brains around something
other than ZSQL results?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's TWITTY-PHYSICIAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: TALES idea: tuple unpacking

2003-07-30 Thread Paul Winkler
On Wed, Jul 30, 2003 at 12:13:41PM -0500, Evan Simpson wrote:
 The explanation isn't that hard, at least for a user with a basic 
 knowledge of data structures -- 

they have a basic knowledge of data structures but they can't be
taught to write a python script in about the same amount of time?

 you usually use key: with a dictionary, 
 and item: with a sequence.  The exception is when you have an integer 
 key in a dictionary.

That exception does smell a bit funny... 
having to say here/some_dict/item:0 just feels odd.
But I can't remember ever using integers as dictionary keys so it's 
probably not worth fussing over. :-)

 I hope that the list above makes the consistency clearer.

actually it does help a bit, thanks.
hmm. It's not horrible :-)
I'm just still on the fence about whether we really need it.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's BUTCHER BROMO-BOTTLE CAP!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: simpler TALES. (was Re: TALES idea: tuple unpacking)

2003-07-30 Thread Paul Winkler
On Wed, Jul 30, 2003 at 12:19:35PM -0500, Evan Simpson wrote:
 Paul Winkler wrote:
 you don't :)
 it's a convenience (less stuff to type if you access the object a lot)
 and/or an optimization (getSomeObject might be expensive).
 
 I believe that his example referred to the case where the intermediate 
 object must be called before path traversal can continue.

ah, i see. hm, well if getSomeObject is a Python Script, it's 
called anyway and it can only deal with someAttribute in its 
traverse_subpath anyway.

 Hm. Doesn't really matter - ObjectManager makes them equivalent
 anyway (except that some keys cannot be spelled as attributes, 
 e.g.  foo['bar.html']).
 
 Not quite.  Attribute access invokes acquisition, while item access 
 never does, so getattr(foo, 'bar.html') may succeed where 
 foo['bar.html'] fails.

Ugh. I don't know how I've been using zope 2 this long without noticing
that item access doesn't acquire. But i just checked and by golly, 
you're right. I have to say, that's pretty horrible. :-)
Is that documented anywhere? I've never seen it if so.

And getattr(foo, some.string.that's.not.a.valid.python.varname)
is just aesthetically bad. :-\

yay zope 2... principle of most surprise wins again :-(

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's OVERLY PADDLE SADIST!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: simpler TALES. (was Re: TALES idea: tuple unpacking)

2003-07-30 Thread Paul Winkler
On Wed, Jul 30, 2003 at 02:06:13PM -0400, Shane Hathaway wrote:
 Evan Simpson wrote:
 With prefixes, the simpler 
 here/getSomeObject/call:/someAttribute gets the job done.
 
 FWIW, I'd write this as here/call:getSomeObject/someAttribute.  I 
 suppose it's possible to support both.

really? How? If you support evan's version, then yours means
call whatever 'here' refers to, and pass getSomeObject as an argument.

 One interesting difference is 
 that my syntax says both get an attribute and call it, while yours 
 says only call it.  Mine is a method call, while yours is a function call.

How would you pass arguments in your version?  I'd say that passing
arguments accounts for a very large percentage of my need to use
TALES python expressions.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's UN-LIBIDO OMEGA!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: simpler TALES. (was Re: TALES idea: tuple unpacking)

2003-07-30 Thread Paul Winkler
On Wed, Jul 30, 2003 at 02:29:45PM -0400, Shane Hathaway wrote:
 How would you pass arguments in your version?  I'd say that passing
 arguments accounts for a very large percentage of my need to use
 TALES python expressions.
 
 If you need to pass arguments, use a Python expression.  Python 
 expressions are not on trial.

You said in another post:

My feeling is that you should avoid mixing syntaxes in a single
document.


So I'm getting mixed messages from you. :-)

I was bringing up a common case that results in mixing syntaxes,
and which won't be avoidable unless the new call: prefix allows
arguments.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CLOWN OF THE MOUNTAINS!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: simpler TALES. (was Re: TALES idea: tuple unpacking)

2003-07-30 Thread Paul Winkler
On Wed, Jul 30, 2003 at 04:49:19PM -0400, Shane Hathaway wrote:
 I'm tired of this. 

Yes indeed :-)

 Do you have a better alternative to subpath 
 prefixes?  The constraints are tight:
(snip)

 - You have to provide an easy way to access APIs.  It's important for 
 Zope 3.

are you talking about things like z3 services?
and/or zope 2 API stuff like foo.objectItems?

 - You have to provide a way to explicitly acquire.  It's important for 
 Zope 3!
 
 - You can't use Python statements in templates.

right, expressions only...

 - Everyone is going to argue over your solution for months.

really :-)

 I've tried very hard to invent a way to solve the problems with path 
 expressions without changing TALES.  I can't.  So I gave myself the 
 flexibility of using just one character that was reserved anyway in path 
 expressions, and the solution fell out.
 
 If you want to look for a solution, consider using *only* Python 
 expressions--no path expressions.  You'll get a lot of mileage that way, 
 but at the expense of syntax clashes.  Who knows, you might find a 
 pretty good solution.

I think this is what I'm going to investigate.
Who knows, I might find only bad solutions :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE SCIENTIFIC KING LEAR !
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


ZEO caching, was Re: [Zope-dev] more Zope2.6 fun: ZEO client death.

2003-07-31 Thread Paul Winkler
On Thu, Jul 31, 2003 at 10:06:08AM -0400, Shane Hathaway wrote:
 Jim and PythonLabs put a bunch of work into optimizing ZEO cache 
 validation earlier this year, and now it's quite speedy.

Which reminds me...  Is it expected that ZEO can take quite a while
to show a new object on all clients?

With zope 2.6.2b3, ZEO 2.0.2,  I can reliably get this behavior:

1) browser 1 looking at foofolder on client 1 adds a new object 
/foofolder/bar.

2) browser 2 on client 2 visits /foofolder/bar. Not found.

3) browser 2 on client 2 flushes the browser cache, 
quits / restarts the browser, etc.  
/foofolder/bar again. Still not found. 

3.5) Repeat step 3 intermittently for an hour (!). Not found.

4) client 2 is restarted. Browser 2 refreshes 
and immediately gets the expected object bar.

This is clearly problematic.  At what point is client 2 supposed to
see the new object??

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SADIST ITE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: ZEO caching, was Re: [Zope-dev] more Zope2.6 fun: ZEO client death.

2003-07-31 Thread Paul Winkler
On Thu, Jul 31, 2003 at 12:13:40PM -0400, Shane Hathaway wrote:
 This is clearly problematic.  At what point is client 2 supposed to
 see the new object??
 
 Immediately.  You are experiencing a bug. ;-)

OK... is this a known bug? Is it a bug in ZEO or Zope or what?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MAFIOSO LETTUCE-WAVER !
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: ZEO caching,was Re: [Zope-dev] more Zope2.6 fun: ZEO client death.

2003-08-07 Thread Paul Winkler
OK... more info... here's my setup.
1 ZEO server, 3 clients (client 1, client 2, client 3).
  
client 1 is on the same physical machine as the server.

client 2 is on a different machine, but close by
on a high-bandwidth network.

client 3 is on a third machine on the same network.

If I make changes on client 1:
  they are not seen on client 2 OR client 3 until I flush
  the database cache on that client.

If I make changes on client 2:
  they are immediately seen on client 1.
  client 3 does not see them until i flush its database cache.
  
If I make changes on client 3:
  they are immediately seen on client 1.
  client 2 does not see them until i flush its database cache.
 

I noticed that the system time on each machine was a bit off,
but that doesn't seem to be the culprit; they're very close now,
and it makes no difference which one is ahead of the other: I get
the same behavior described above regardless of whether clients 2 and 3
are slightly ahead or slightly behind client 1.

Next, will investigate ZEO logs as Shane suggested...

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NEGA SOCK IN PARIS!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: simpler TALES. (was Re: TALES idea: tupleunpacking)

2003-08-08 Thread Paul Winkler
On Wed, Jul 30, 2003 at 06:42:39PM -0400, Paul Winkler wrote:
 On Wed, Jul 30, 2003 at 04:49:19PM -0400, Shane Hathaway wrote:
  Do you have a better alternative to subpath 
  prefixes?  The constraints are tight:
 (snip)
  If you want to look for a solution, consider using *only* Python 
  expressions--no path expressions.  You'll get a lot of mileage that way, 
  but at the expense of syntax clashes.  Who knows, you might find a 
  pretty good solution.

This stuff is hard :-\   Attached is what I've been able to come up with.
(ducking)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE FISTY FIST !
(random hero from isometric.spaceninja.com)
evan's original examples...

---

   
 


   
  
   

   


These first examples are pretty trivial, and can mostly be done today 
as python expressions with no difficulty.
For the fmt: and var: examples, i'll just hand-wave, I think what I mean 
is pretty clear...

   
 


   
  
   

   


Now for Evan's tricky examples:

 options/foo/item:0 | request/foo/item:0 | default
 data/stat/fmt:thousands_commas | string:No data. 


My solution using Python expressions:
First of all, provide a namespace that provides access to
API stuff. We can argue later about how this can be named & organized.
This namespace is always available in ZPT, and can be imported 
in Python Scripts.

Next, we provide a function that behaves a little bit like the
existing path() function -  
given some names, for each successive pair it tries to find 
foo[bar] and getattr(foo, bar) and if both fail, we don't raise the 
AttributeError or KeyError - we just return false (more on this below).  
This allows you to chain function calls with "or".  TALES has to be 
modified a bit for this to work as I intend, as described below.  

This path lookup function should just take, as arguments, any number
of ids to look up.  You can pass a sequence using the *args 
notation.  Note that since it just tries __getitem__ and __getattr__ 
at each step, it works fine with mappings (e.g. the request object).
I can't think of a good name so i'm calling it zget.


Examples:

 original: 
   options/foo/item:0 | request/foo/item:0 | default
 mine: 
   zget('options','foo')[0] or zget('request','foo')[0] or default

 original:
   data/stat/fmt:thousands_commas | string:No data.
 mine:
   zope.fmt.thousands_commas(zget('data','stat')) or 'No data'

Note a significant difference in this latter example: in Evan's version,
the thousands_commas call can be short-circuited if data/stat
does not exist, while in mine it cannot be avoided (it is
merely called on an empty string).

How this works: the "false" value returned by zget is a 
bit special - it's a lightweight "null object". 
e.g. __len__ returns 0, while __getitem__, __getattr__, and __call__ 
return None ...  and __str__ (and __repr__?) returns ''.  It would also 
keep an _exception attribute which would be the exception that 
led to its creation (e.g. the AttributeError).

TALES would then have to be modified such that if the end result of
a TALES _expression_ is one of these special null objects, 
we re-raise its _exception. That way you still find out what the 
missing item was.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: simpler TALES. (was Re: TALES idea: tupleunpacking)

2003-08-14 Thread Paul Winkler
blargh, sorry about the .htm extension and resulting MIME confusion...
i forgot to rename it when i was done playing with it, even though
it was only really an html file for the first 5 minutes.

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Reading contents of a Page Template

2003-08-18 Thread Paul Winkler
On Mon, Aug 18, 2003 at 03:05:44PM -0500, J Cameron Cooper wrote:
 The condition check is pretty primitive. Probably a better one would 
 check for the presence of the objectValues method like
 
 tal:define=folderish nocall:item/objectValues
 tal:condition=folderish | nothing

That won't work as intended, you'll usually be able to acquire 
objectValues from the parent folder.

You might instead try:
tal:condition=item/isPrincipiaFolderish | nothing

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's GEORGE ULTRA PENIS!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Can't build 2.6.2-b5 on Redhat 7.3

2003-08-23 Thread Paul Winkler
Like the subject says... python2.1 wo_pcgi fails...

this is the same python 2.1.3 that I built from source, and which
I used to build and run zope 2.6.1 for a few months now...


--
Building extension modules
/usr/local/bin/python2.1 setup.py build_ext -i
running build_ext
building 'AccessControl.cAccessControl' extension
gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -Wstrict-prototypes 
-fPIC -I/zope/Zope-2.6.2b5-src/lib/Components/ExtensionClass/src 
-I/usr/local/include/python2.1 -c AccessControl/cAccessControl.c -o 
build/temp.linux-i686-2.1/cAccessControl.o
In file included from AccessControl/cAccessControl.c:54:
/zope/Zope-2.6.2b5-src/lib/Components/ExtensionClass/src/ExtensionClass.h:94:20: 
Python.h: No such file or directory
/zope/Zope-2.6.2b5-src/lib/Components/ExtensionClass/src/ExtensionClass.h:95:20: 
import.h: No such file or directory
error: command 'gcc' failed with exit status 1
Traceback (most recent call last):
  File wo_pcgi.py, line 45, in ?
if __name__=='__main__': main(sys.argv[0])
  File wo_pcgi.py, line 33, in main
import build_extensions
  File /zope/Zope-2.6.2b5-src/inst/build_extensions.py, line 24, in ?
do('%s setup.py build_ext -i' % sys.executable)
  File /zope/Zope-2.6.2b5-src/inst/do.py, line 32, in do
if i and picky: raise SystemError, i
SystemError: 256
make: *** [all] Error 1


-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's UBERMAESTRO DEPUTY SHERIFF KUMQUAT!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Can't build 2.6.2-b5 on Redhat 7.3

2003-08-25 Thread Paul Winkler
Never mind, operator error. Wasn't the python i thought it was...
it was a binary copied from another machine and built with a
different glibc apparently.


On Wed, Aug 20, 2003 at 07:19:01PM -0400, Paul Winkler wrote:
 Like the subject says... python2.1 wo_pcgi fails...
(snip)
-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CROTCHETY SUPER SNAIL-DOG!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Very severe memory leak

2003-08-25 Thread Paul Winkler
On Mon, Aug 25, 2003 at 02:57:50PM -0400, Shane Hathaway wrote:
 2.6 is also intended to be compatible with Python 2.2.  It's just that 
 here at ZC we haven't gone through the rigorous analysis we've been 
 planning.  Hmm, come to think of it, the community could actually do 
 that analysis.  It wouldn't be terribly difficult.  Any volunteers?

Maybe. I'd really like to run with python 2.2. What is involved in the
rigorous analysis? Is there a plan I could follow?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE BABY!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Why not ZODB 3.1.3 with Zope 2.6.2?

2003-08-26 Thread Paul Winkler
I downloaded the hidden 2.6.2b6 release (from 
http://zope.org/Products/Zope/2.6.2b6/Zope/view) and had 
a look in lib/python/ZODB/__init__.py, which gives its 
version as ZODB 3.1.2.  Is there any reason it's not ZODB 3.1.3?
Maybe just an oversight? 

I could easily check any ZODB-3.1.3 changes to the Zope-2.6 branch, 
unless somebody knows a reason not to do so.

Also, why doesn't ZODB/Tools come with zope? There's some really
handy stuff in there, some of which gets mentioned on the zope list
from time to time; it would be nice if newbies could get hold of it easily.

On a related note, NEWS.txt in ZODB 3.1.3 mentions that there is a new
Tools/README.txt ... but it's not actually in the tarball :-)

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Help!!

2003-08-28 Thread Paul Winkler
On Thu, Aug 28, 2003 at 12:30:11PM -0400, Todd Loomis, (SAIC) wrote:
 Paul,
 
 Thanks, however I've searched the mailing lists and found nothing.

http://zope.nipltd.com/public/lists/zope-archive.nsf/Main?SearchView=Query=DeprecationWarning

a lot of those are irrelevant - several will tell you the 
same thing I did.

 Also I
 consider this an error when Zope will not startup!

This is just a warning. It *cannot* prevent zope from starting.
Your problem is something else.  You say zope is not starting...
what happens when you try to start?  

What have you done to verify that zope isn't running?

What platform are you on?

What version of Zope?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE BOAT!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: [Zope3-dev] Zope 3 Newsletter: Issue 10

2003-09-05 Thread Paul Winkler
On Fri, Sep 05, 2003 at 09:46:52AM -0400, Gary Poster wrote:
   Python script support in TAL

I'm not sure whether to be overjoyed or very afraid :-)

IIRC, zope 3 does not currently have an equivalent to
zope 2's Script (Python). Chris McDonough and I were going to
consider this topic when we have time, but you know how that
goes.  

Sorry if i'm flogging a dead horse, but:

Think of the xp practice, refactor early and often.  I'd like
zope 3 to easily support that practice, whereas zope 2 
sometimes hinders it.

What I mean is: all ttw python code should be as compatible as 
possible. I don't want a situation analogous to zope 2 
where python has to be written differently in different 
contexts (e.g. here vs. context vs. the overly magical _).
Little variations like this mean that refactoring often
necessitates some gratuitous rewriting, which increases 
the chances of breakage. And it means that zope 2 newbies who
are new to python have an unnecessarily confusing introduction
to the language, and pythonistas who are new to zope 2 
may be frustrated (as I was) with the sometimes perlish
experience of working with zope 2.

Now, obviously it's not possible to reach from a Page Template into 
a z2-style Script (Python) and e.g. pull out a global variable, 
as is done in your embedded script example.  Maybe that's a use 
case for the Persistent Modules which I've heard Jim talk about? 
But the goal I have in mind is that, aside from such inevitable 
scoping issues, python code is python code and can (ideally) be  
completely portable between templates, Scripts, and Persistent
Modules.  (disclaimer: i haven't looked at Persistent Modules so maybe
they're not relevant to this discussion.)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SENATOR'S WIFE DOOM!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] PythonLibraries Product

2003-09-11 Thread Paul Winkler
On Wed, Sep 10, 2003 at 09:50:51PM -0400, Tres Seaver wrote:
 For the filesystem representation:  what if we just have two files for
 templates with libraries:  'foo.html' and 'foo.html.py'?  Tools will
 like that better than either of the approaches which try to preserve the
 twins as a single file:

sounds fine.

 I would vote for having the bound library's names inserted into the
 'template' TALES namespace, BTW.

+1

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ALPHABET METROID WINO!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Zope 2.6.2, Zeo 2.0.1b1 and python 2.2.3

2003-09-22 Thread Paul Winkler
On Mon, Sep 22, 2003 at 09:48:13AM -0400, Erik A.Dahl wrote:
 I'm trying to get this combo working (I know its not officially 
 supported).  It works fine except for when a second client updates zeo 
 the changes aren't seen from the first client (until its restarted).  I 
 ran the zeo tests with 2.2.3 and they all pass.  Zope 2.6.2 seems to 
 work fine even with zeo when only one client is doing updates.  Where 
 would I look to try and track down the problem (somewhere in the 
 caching code?)  Is this even worth pursuing?  I have another library 
 that I would like to use but it requires 2.2.3.

Known bug in ZEO 2.0.1b1, which is a bit old. 
Look in the zodb-dev archives.  Download a recent ZODB3 
(I use ZODB3-3.1.2) and copy the ZEO directory from there.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SNAKE NEGA MODESTO!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] current best of breed ZEO for Zope 2.6.2 in production?

2003-10-02 Thread Paul Winkler
On Thu, Oct 02, 2003 at 12:02:32PM -0300, Leonardo Rochael Almeida wrote:
 Hi, 
 
 I'm with a client in the process of setting up a production environment 
 with ZEO. 
 
 Which of the ZEOs should I use? 
 
 * Old (t)rusty ZEO 1.0? 

nope

 * ZEO 2.0? 

nope

 * any one of the ZEO releases at http://www.zope.org/Products/ZEO ? 

nope

 * a ZEO ripped off of a ZODB release? Which one? (maybe even this last RC?) 

Yes! Use ZEO from at least ZODB3-3.1.2.  I know that one is good,
I can't speak to later releases.

  * In this case, should I make the ZEO server out of this ZODB release or
should I just combine the ZEO server part into Zope and serve ZEO out of 
 that? 

the latter... just copy the ZEO directory into zope_source/lib/python/

  * If use a standalone ZODB release as ZEOServer, can/should I run it on 
 Python2.2
While using Python2.1 ZEOClients? (I'm not running Zope 2.6.2 on Python 
 2.2) 

no idea, sorry. I still use python2.1.3 for everything zope-related.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NIHIL COOKIE WITH AN ATTITUDE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Running the unit tests on 2.6.2?

2003-10-02 Thread Paul Winkler
Zope-2.6.2-src doesn't come with a script to run all the unit tests.
Looking at cvs.zope.org, I found test.py, but it's only for 2.7 -
it imports logging.config which doesn't exist in 2.6.2.

What do I do to run all the unit tests for zope 2.6.2?
-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's BRAINDEAD SINFUL PROFESSOR!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Running the unit tests on 2.6.2?

2003-10-02 Thread Paul Winkler
Never mind, I found the answer:

1) get testrunner.py from http://www.zope.org/Members/shh/TestRunner/testrunner.py/view

2) The help claims that -p ignore the line in the help that claims -p 
(add lib/python to the Python search path) is on by default.
For me, -p does not work at all! The tests did not run until
I exported PYTHONPATH=lib/python.

Sorry for the noise.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's YET ANOTHER LAGOMORPH IN THE CLOSET!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope] Re: [Zope-dev] Using 2.3.2 for Zope 2.7

2003-10-03 Thread Paul Winkler
On Fri, Oct 03, 2003 at 03:48:06PM +0100, Toby Dickenson wrote:
 On Friday 03 October 2003 15:33, Chris McDonough wrote:
  Jim is keen to get an audit going quickly before a 2.7
  final release, and the audit would be performed against Python 2.3.2.
 
 Does anyone else have an interest in blessing Zope 2.6.x with Python 2.2/2.3 ?

yes, but not much time to help out :-(

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's BROMO-LOVESICK !
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope] Re: [Zope-dev] Using 2.3.2 for Zope 2.7

2003-10-03 Thread Paul Winkler
On Fri, Oct 03, 2003 at 10:33:01AM -0400, Chris McDonough wrote:
 Well, to be clear, there hasn't been any formal security audit of the
 combination of Python 2.2 with Zope 2.7.  So we'd lose nothing by moving
 directly to 2.3.  Jim is keen to get an audit going quickly before a 2.7
 final release, and the audit would be performed against Python 2.3.2.

then by all means, 2.3.2.  These audits seem to be hard to get going
on a regular basis (we've been on python 2.1.3 for how long now?)
so I see no point in blessing a version of python that's already not
latest-and-greatest.

The only counterargument i can think of is that 2.3 may not be
bundled with many linux distros yet. I've always compiled my own
python for use with zope, so I don't know how big a deal that is.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE BRIGHT ZACH!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Which ZODB to use for both Zope 2.5.1 and 2.6.1 onPython 2.1.3

2003-10-08 Thread Paul Winkler
On Wed, Oct 08, 2003 at 10:27:57AM -0300, Leonardo Rochael Almeida wrote:
 On Wed, 2003-10-08 at 06:46, Dario Lopez-K?sten wrote:
  Also I forgot to mention: this is for a kluster we are setting up, so I need
  to know what ZEO is recommended for us with Zope 2.5.1 and 2.6.1 with Python
  2.1.3.
 
 I'd say ZODB 3.1.4 from http://zope.org/Products/ZODB3.1/
 
 You have to install the whole of ZODB into your Zope, though. Not just
 ZEO. But I think that is easier than it sounds. The installation
 instructions in the package mention a switch to install the full ZODB
 into Zope for you.

FWIW I did not succeed in getting ZODB 3.1.2 to work with Zope 2.5.1,
but I didn't put much time into trying.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's PSEUDO-BONER SEEKER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] relations in objects

2003-10-09 Thread Paul Winkler
On Thu, Oct 09, 2003 at 05:07:28PM -0700, Jason Corbett wrote:
 to reference in some intelligent way between objects
 in zope, and I need a way to query for a list of them.

google for mxmRelations.  It does many-to-many
relationships so yuo might have to modify it a bit
if you really need to constrain that.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE MAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] relations in objects

2003-10-10 Thread Paul Winkler
On Thu, Oct 09, 2003 at 08:46:24PM -0700, Jason Corbett wrote:
 Thanks for your reply.  I've actually been thinking in
 an object oriented form for a while.  I've looked at
 implimenting this project in Java using either
 prevailance or a object persistence model that mapped
 to a RDBMS.  I like the idea of zope, so maybe I
 should clarify my question:
 
 How does an object in zope know where it sits in the
 hirearchy,

The only unique identifier that zope provides is
the containment path. An object can tell you its containment
path by doing foo.absolute_url(1) or foo.getPhysicalPath()
depending on what form you  want the output in.

 and how does it reach other objects. 

By path. Zope provides a number of ways to express paths in
python:

foo[some][path]# does NOT use acquisition, only containment
foo.some.path  # uses acquisition
getattr(foo.some, path) # uses acquisition

foo.unrestrictedTraverse(/some/path/from/zope/root)
foo.unrestrictedTraverse(some/path/relative/to/foo)
(see also restrictedTraverse)

Note that storing a direct reference may be dangerous e.g. 
you might not have the object you are expecting - in fact it's
very likely that you get an acquisition wrapper which may change
at any time.  On the other hand, storing paths is problematic if 
you want to be able to move or rename an object and still keep 
references to it elsewhere.  Hence, look at mxmRelations which 
helps with this.

-- 

Paul Winkler
http://www.slinkp.com

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] possible compromise

2003-10-13 Thread Paul Winkler
On Mon, Oct 13, 2003 at 05:36:51PM -0700, Chris Pelton wrote:
 Hello,
 
 I'm trying to do some forensics on a redhat 6.2 box that was somehow 
 turned into a mail relay and may have been compromised. The mail logs 
 show the mail coming from an apache virtual host address, and this 
 machine was running zope, and the list of hotfix files I see is:
 
 5220 May 25  2001 Hotfix_2000-10-02.tar.gz
 2800 May 25  2001 Hotfix_2000-10-11.tgz
 3002 May 25  2001 Hotfix_2000-12-08.tgz
 2839 May 25  2001 Hotfix_2000-12-15a.tgz
 2386 May 25  2001 Hotfix_2000-12-18.tgz
 1899 May 25  2001 Hotfix_2001-02-23.tgz
 3292 May 25  2001 Hotfix_2001-03-08.tgz
 2492 May 25  2001 Hotfix_2001-05-01.tgz

if you're worried that one of those is a trojan, you could re-download
the hotfixes here and use diff or cmp:
http://zope.org/Products/Zope/swpackage_view

 So, would anybody have any ideas how to determine if this might have 
 been compromised? Or is there a known mail relay exploit through zope 
 somehow?

never heard of one, but if you have a MailHost with wide open permissions
somebody could pretty easily write a client script to abuse it.

 Not sure what version of zope this is

That would be listed in the output on startup, and you can also check by
visiting http://zope_server:zope_port/Control_Panel/manage_main

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NANO PHYSICIAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] possible compromise

2003-10-14 Thread Paul Winkler
On Tue, Oct 14, 2003 at 04:18:17PM -0400, Tres Seaver wrote:
 On Tue, 2003-10-14 at 16:08, Chris Pelton wrote:
  Yes, that's what I'm thinking happened here, but I need to verify that 
  was the case.  Are there any logs in zope that could help track this 
  down, or a known configuration that would allow it to happen? Also, for 
  future reference, can we disable this? Any ideas how someone might be 
  able to tell Zope is running?
 
 I believe that the scenario Robert is describing does not actually
 involve Zope at all;  rather, (in this scenario) Apache is willing to
 forward arbitrary traffic, via the 'CONNECT' verb.  Check your Apache
 access logs for the HTTP verb, 'CONNECT'.  Squid's default configs have
 specific settings to allow CONNECT only for HTTPS;  I'm guessing that
 your Apache config might need to be tweaked likewise.

Yup, I don't think zope even *can* do something like that.
I was guessing that the exploit was at the application level - 
somebody found a MailHost with wide-open permissions
and abused it with a client script. 

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE INTOXICATED GIRL!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Post-Traversal Hook (+Post-Publication Hook)

2003-10-17 Thread Paul Winkler
On Fri, Oct 17, 2003 at 01:46:08PM +0200, Christian Theune wrote:
 
 Am Fr, 2003-10-17 um 13.38 schrieb robert:
  what does publication mean in this context?
 
 I'm referring to the point in time after the method that was addressed
 by the request (e.g. index_html or __call__) was callen but hasn't been
 given back yet. So after the result of the request is known.

hmm... the only issue that occurs to me is that the method could take a long
time to complete, whereas pre-publication should generally be very quick.
Don't know if that matters except when debugging in a hurry.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE NOISOME BATMAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Post-Traversal Hook (+Post-Publication Hook)

2003-10-17 Thread Paul Winkler
On Fri, Oct 17, 2003 at 12:15:07PM -0400, Paul Winkler wrote:
 On Fri, Oct 17, 2003 at 01:46:08PM +0200, Christian Theune wrote:
  
  Am Fr, 2003-10-17 um 13.38 schrieb robert:
   what does publication mean in this context?
  
  I'm referring to the point in time after the method that was addressed
  by the request (e.g. index_html or __call__) was callen but hasn't been
  given back yet. So after the result of the request is known.
 
 hmm... the only issue that occurs to me is that the method could take a long
 time to complete, whereas pre-publication should generally be very quick.
 Don't know if that matters except when debugging in a hurry.

duh, never mind, I didn't really read the end of your first message,
in which you clearly propose two hooks, one before and one after publication.
Carry on :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's FANTASTIC BURRITO MAFIOSO!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] New-style ExtensionClass

2003-10-20 Thread Paul Winkler
On Mon, Oct 20, 2003 at 11:55:39AM -0400, Jim Fulton wrote:
 
 I've started work on a new-style ExtensionClass. This is a port
 of ExtensionClass to new-style classes.  This will provide a number
 of advantages:
 
 - Use of new-style class features (e.g. descriptors) in Zope objects.

woohoo!
this all sounds great.

One question about new-style ExtensionClass...
I wonder if it will address a minor gripe I have with the current 
ExtensionClass.  I spent a few minutes yesterday debugging some 
code like this:

class FooProduct(SimpleItem):

def broken(self, obj):
if isintance(obj, FooProduct):  # never true!
raise TypeError 

def working(self, obj):
if obj.meta_type == FooProduct.meta_type:
raise TypeError


As it turns out, isinstance(FooProduct(), FooProduct) returns false!
AFAICT it's ExtensionClass that is responsible for this surprising 
behavior.  The meta_type approach is a decent workaround, but 
it means I can't automatically detect all subclasses of FooProduct, 
which is a nice feature of isinstance.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MARTIAN TAB GEOLOGIST!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: [Zope-Coders] Reminder: bug day tomorrow Oct 21

2003-10-20 Thread Paul Winkler
On Mon, Oct 20, 2003 at 10:59:38AM -0400, Brian Lloyd wrote:
 Hi all - 
 
 A quick reminder that we'll be having a bug day tomorrow 
 10/21 to try to knock out some remaining issues in the drive 
 to get a Zope 2.7 final out.
 
 Hope to see you on #zope-bugday !

isn't it usually #zope-dev?  
That's what I see on http://dev.zope.org/CVS/BugDays

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's OCTO-MAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] java + zope

2003-10-23 Thread Paul Winkler
On Thu, Oct 23, 2003 at 03:13:56PM +0200, Andreas Jung wrote:
 --On Donnerstag, 23. Oktober 2003 16:06 Uhr +0400 \Bibikov Kirill\  
 [EMAIL PROTECTED] wrote:
 
 How can I make java + zope integration for web application development?
 Have it something for this? Does it must to know Python, is it necessary?
 
 
 Zope has never been designed to work with Java except through calling Java
 through external processes. Check the mailing list archive since this is a 
 FAQ.

You can also go the other way - make calls to Zope from java via http.
http://sourceforge.net/projects/pstream/
... although it looks like skyleach is several months behind on his 
cvs commits.  He's a coworker of mine, we've been using this in 
production for quite a while. Personally I think it's a bit nuts (I'd rather
do all the apps in python if not zope), but i'm just one zope/python guy 
in a hardcore java shop :-]
and I'm happy that it got us to use zope for content management
instead of a $ java CMS. 

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's AMBIENT SUSPICIOUS PROFESSOR!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] object copy

2003-11-07 Thread Paul Winkler
On Fri, Nov 07, 2003 at 12:20:13PM +0100, Dmitrij Repp wrote:
 Hi,
 how can I to copy of objects beetwen Folders with python?

http://www.zopelabs.com/cookbook/1037768468

such questions are probably better suited for the main zope list,
[EMAIL PROTECTED] This list is for development of zope itself,
not developing applications with zope.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's GARBAGE MAN EXO SMOOTHIE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Zope 2.7 beta 3

2003-11-10 Thread Paul Winkler
On Mon, Nov 10, 2003 at 06:25:20PM -0500, Chris McDonough wrote:
 runzope never detaches from the terminal... use zopectl start
 instead.  Unlike previous versions of Zope, 2.7 doesn't handle its own
 daemonizing.  Instead it relies on an external program to do its
 daemonizing (Guido's zdaemon, which is invoked by zopectl).

I have to say, I am really REALLY happy about this :-)

thank you oh great lords of zope!

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's QUASI-NUTLESS MANTICORE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Zope 2.7.0 b3 regressions

2003-12-08 Thread Paul Winkler
On Mon, Dec 08, 2003 at 12:35:38PM +0100, Stefan H. Holek wrote:
 Note that this is one of my main points: It will be of little use to  
 document usage of BASEPATH1+absolute_url(1) when '/'+absolute_url(1)  
 appears to work (until it is far too late).

As a frequent (ab)user of '/'+absolute_url(1), which did indeed
bite me when i deployed to an inside out apache setup,
I thought I'd try this out... I think you 
meant BASEPATH1+'/'+absolute_url(1)?

I put this in a page template called test_abs_url:

  pTypical relative path using absolute_url(1): 
  span tal:replace=python:'/' + here.absolute_url(1) / 
  /p
  pBASEPATH1 is: span tal:replace=request/BASEPATH1 / /p
  pBetter relative path using BASEPATH1 and absolute_url(1): 
  span tal:replace=python:request['BASEPATH1']+here.absolute_url(1) / 
  /p


If I visit this at http://localhost:8080/ctimi/about/test_abs_url, I get:


 Typical relative path using absolute_url(1): /ctimi/about

 BASEPATH1 is:

 Better relative path using BASEPATH1 and absolute_url(1): ctimi/about 

  ^^
note, no leading slash

If I visit 
http://localhost:18080/VirtualHostBase/http/www.foobar.com:80/VirtualHostRoot/_vh_foo/ctimi/about/abs_url_test
I get this:


 Typical relative path using absolute_url(1): /ctimi/about

 BASEPATH1 is: /foo

 Better relative path using BASEPATH1 and absolute_url(1): /fooctimi/about 


... definitely not right.
But your point is made - '/'+absolute_url(1) is clearly inadequate too.

If I change the template to use request['BASEPATH1']+'/'+here.absolute_url(1),
then I get this:


 Typical relative path using absolute_url(1): /ctimi/about

 BASEPATH1 is: /foo

 Better relative path using BASEPATH1 and absolute_url(1): /foo/ctimi/about 


... which looks correct to me.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CHEESY ENGINEER!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Zope 2.7.0 b3 regressions

2003-12-08 Thread Paul Winkler
On Mon, Dec 08, 2003 at 05:58:12PM +0100, Lennart Regebro wrote:
 Paul Winkler wrote:
 As a frequent (ab)user of '/'+absolute_url(1), which did indeed
 bite me when i deployed to an inside out apache setup,
 I thought I'd try this out... I think you 
 meant BASEPATH1+'/'+absolute_url(1)?
 
 I would like to know:
 1. Exactly what is an inside out apache setup.

See the About tab on VHM. Inside out is mentioned
numerous times in this thread.

 2. What is the result you want?

The result that I got by doing BASEPATH1+'/'+absolute_url(1)
as described in my previous message. I thought that was clear.

BASEPATH1 does not have a trailing slash, and
absolute_url(1) does not have a leading slash, so if you
visit _vh_foo/bar you will get foobar instead of foo/bar.
Therefore, BASEPATH1 + absolute_url(1) does not work.
You have to insert the slash.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's LATE HYDROXY WATERBOY!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Zope 2.7.0 b3 regressions

2003-12-08 Thread Paul Winkler
On Mon, Dec 08, 2003 at 07:14:28PM +0100, Stefan H. Holek wrote:
 After reading this paragraph for the third time I realized you have a 
 very good point here.
 
 But
 
 quote by=Evan Simpson
 Relative in this context refers to the concept of a relative path 
 as used in rfc1808, not to a relationship with a Zope object.  It is 
 meant for use in situations such as redirection to a secure page from 
 an insecure one (eg. 'https://example.com' + target.absolute_url(1)) 
 where you would otherwise have to generate the complete URL and then 
 break it apart.
 /quote
 
 So, what do we want relative to mean for absolute_url?

Speaking for myself, what I really want is something that always 
works for the client, since that's who generally cares about URLs.
I like the behavior of Evan's fix. For looking up objects in zope,
we should use other methods such as getPhysicalPath().
Lennart's path2url() would be handy.

But I don't think it's worth the backward compatibility pain
to change absolute_url(1) now.
We've been waiting ages for a stable Zope 2.7, IMHO it's too late 
for something this problematic to change.

So my proposal is this:

1) Implement distinct methods for client-useable virtual paths
vs. server-useable containment paths, as Lennart proposes.

2) absolute_url(1) in Zope 2.7 should continue to work as 
in = 2.6. 

3) As soon as we decide conclusively what is going to happen
with absolute_url(1) in zope 2.8, we can have it log a deprecation 
warning.  (Hmm, that could really annoy admins. A deprecation
warning on every call to getIcon(), ugh. Other ideas?)

4) In zope 2.8, we have the new behavior, whatever we decide that is.

We also have to be sure to update the Help docs
and the long-suffering API Reference.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's LIUTENANT ON WHEELS!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Zope 2.7.0 b3 regressions

2003-12-08 Thread Paul Winkler
On Mon, Dec 08, 2003 at 08:24:04PM +0100, Dieter Maurer wrote:
 Maybe, my contribution has not been read. Thus, I try again:
 
/ + absolute_url(1) should implement the notion
of absolute-path URL reference (see RFC2396 section 5).
 
This means, that the receiving browser should be able
to retrieve the object correctly given this URL reference.

Yup.
But while we're on the subject...
Why doesn't absolute_url(1) include a leading slash?
I don't think I've ever seen a use of absolute_url(1)
that didn't have to add the slash. What was the rationale
originally?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ZOOMING SOLITARY PICNINC CHLAMYDIA  OOZE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]

2003-12-09 Thread Paul Winkler
On Tue, Dec 09, 2003 at 10:24:47AM -0600, Evan Simpson wrote:
 def absolute_url_path(self):
'''Return the entire path of the absolute URL for this object.
   This includes the leading slash, and can be used as an
   absolute-path reference as defined in RFC 2396.
'''

OK. But maybe the docstrings could be more clear about
BASEPATH1?  IIUC, absolute_url(1) will leave out BASEPATH1, 
continuing the behavior from zope  2.7, but absolute_url_path() will
include BASEPATH1?

I propose this, in OFSP/help/ObjectManagerItem.py:

def absolute_url_path(self):
'''
Return the entire path portion of the absolute URL for this object.

This includes the leading slash and BASEPATH1, and can be used 
as an absolute-path reference as defined in RFC 2396.
Thus, this method is always safe to use with VirtualHostMonster.
'''

def absolute_url(relative=None):

Return the absolute url to the object.

If the relative argument is provided with a true value, then
the URL returned is relative to the site object. Does not include 
a leading slash or BASEPATH1, thus is not always safe to
use with VirtualHostMonster. Code that uses '/'+absolute_url(1)
should be changed to use absolute_url_path instead.

Permission -- Always available


I removed the logical rather than physical note from absolute_url
because I don't think it was actually true before Evan's change,
which IIUC is being reverted. Maybe I misunderstood.

 Lennart proposed additional methods, but I'm going to work on that in 
 the post-2.7 branches, since I really want to clean up this mess 
 properly, and beta 3 isn't the time.

Great.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's HYPO-SUPERCALIFRAGILISTICEXPIALADOCIOUS THIGH MAN!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] RE: api docs [Was: Re: Post-mortem ...]

2003-12-11 Thread Paul Winkler
On Wed, Dec 10, 2003 at 10:20:22AM -0500, Brian Lloyd wrote:
 Ghaaa... :( API docs come from OFSP/help, so you'll probably have to 
 copy it for now. As you rightly pointed out, this is problematic for 
 keeping things in sync, but we should hold our nose for now and do 
 it, since it's too late in the 2.7 cycle to contemplate that big a 
 restructuring.
 
 Making this sane would be a good potential project for an enterprising 
 zopista for 2.8... 

What would be sane in your view?  
Using interfaces for help, as CMF does?

I was curious how CMF sets this up, and found the following
in CMFCore/__init__.py:

try:
context.registerHelpTitle( 'CMF Core Help' )
context.registerHelp(directory='interfaces')
except: # AARGH!!
pass

I love comments like that :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE EXPECTANT MOLE RAT!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] ZServer HTTP 1.1 support

2003-12-11 Thread Paul Winkler
I noticed this in ZServer/README.txt (zope 2.6.2):

HTTP 1.1 support is ZServer is incomplete, though it should work for
most HTTP 1.1 clients.

Anybody know what specifically is incomplete?

In particular, some people on my team asked me if zserver
supports persistent connections, and I didn't know how
to answer. I'm looking now at HTTPServer.py and the docstrings
suggest that it does ... yes? no?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's RADIO FOOLISH POLYETHYLENE TEREPHTHALATE SQUID!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] ZServer HTTP 1.1 support

2003-12-11 Thread Paul Winkler
On Thu, Dec 11, 2003 at 10:44:56PM +0100, Clemens Robbenhaar wrote:
  You can try out yourself: connect to the Zope server via telnet
 and type in:
 
 GET / HTTP/1.1
 Host: localhost
 
 
 
 The server should serve the page, and if it supports persistent 
 connections, if should not close the connection, so You can type in the
 request again (if You type fast enough to finish before the timeout ;-)

Apparently, that would be a very slow typist ;-)
thanks, it works at least this much.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's DOLL OF LONDON!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] ZServer HTTP 1.1 support

2003-12-11 Thread Paul Winkler
Excellent, that's a much more thorough answer than I hoped for.
Thanks!


On Thu, Dec 11, 2003 at 02:16:46PM -0800, Jamie Heilman wrote:
(a whole lot)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE RIGHTEOUS DOCTOR!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Converting from old-style BTreess

2003-12-15 Thread Paul Winkler
On Mon, Dec 15, 2003 at 05:21:55AM -0500, Jim Fulton wrote:
 Chris McDonough wrote:
 Woot! ;-)  Descriptors, yum...
 
 But you can use descriptors in extension classes now too.

I wondered what the heck you guys were on about...
google turned up this:
http://users.rcn.com/python/download/Descriptor.htm

very very cool stuff.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ZORRO SLUDGE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] bizarre slicing behaviour in Zope

2003-12-17 Thread Paul Winkler
On Wed, Dec 17, 2003 at 03:30:50PM -0500, Gerry Kirk wrote:
 try this in a script in zope 2.7b3 (maybe others, too) if you want to go 
 crazy:
 
 dd = ('dd', 'diocese', 'Parish.2003-12-16.8636751973', 'bob', 
 'Workspace.2003-12-17.8140751750','gerry.2003-12-17.8140751750')
 
 return dd[4:]
 
 you should get the last two items from the tuple, but I get the last 
 item returned as a string

I tried 2.6 as well.  Check the source of the returned page. 
I think you will find this:

html
head
titleWorkspace.2003-12-17.8140751750/title
/head
body
gerry.2003-12-17.8140751750
/body
/html

It seems to happen with any tuple... I tried this script:

return ('foo', 'bar')

... and got this:

html
head
titlefoo/title
/head
body
bar
/body
/html

Returning a list instead of a tuple is OK - it shows a string
representation of the list.

I would guess that you are right, this is odd publisher behavior.
File a collector issue.

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: Converting from old-style BTreess

2003-12-19 Thread Paul Winkler
On Mon, Dec 15, 2003 at 02:47:01AM -0500, Jim Fulton wrote:
 shrug  Who knows. I'd rather be safe.  It's not that hard.
 In any case, we would have needed the fix to handle old pickles
 correctly.

Asking a possibly redundant question...  not being much of a ZODB 
hacker, I didn't follow this thread in detail...
Q: Will Zope = 2.8 be able to import .zexp's exported from
zope = 2.6.2?  From Jim's comment above I would guess yes,
but I need to be sure.

Some of us out here in the wild use import / export machinery
pretty heavily (see e.g. ZSyncer), and we typically like to
burn in a new zope version on a dev system for some time before
upgrading the production systems... but during that time we
need to keep syncing stuff from dev to production.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's FOOD-COVERED STRAIGHT FROM UNCLE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] Re: CVS: Releases/Zope/lib/python/ZEO - simul.py:1.12.8.2.18.18

2004-01-16 Thread Paul Winkler
On Fri, Jan 16, 2004 at 04:53:02PM -0500, Jeremy Hylton wrote:
 One downside of that merge, which we didn't realized until after it was
 done, is that you now get a ZEO directory in a Zope checkout on the 2.6
 branch. 

downside??? I thought that was a good thing!

 I think there was email about the discovery at the time, and I
 noticed that Brian did not include ZEO in the 2.6.3 releases; so I
 assume he's got some mechanism to suppress it from the actual release.

Consider this a request to disable that mechanism ;-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SUPER FRED!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] RFC: backward compatibility of PythonScript bindings for 2.6.4 / 2.7.0

2004-01-21 Thread Paul Winkler
On Wed, Jan 21, 2004 at 10:42:11AM -0500, Brian Lloyd wrote:
 These two facts did not cause a problem before, because the security  
 check for the 'container' binding was not being performed at bind-time. 

One question - what *is* bind time?
Is the container bound when the script is called?

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE PIDDLE!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


  1   2   3   4   >