[Zope] Upload just file headers?

2000-10-10 Thread Paul Winkler

I'd like to make a form that looks like the typical file
upload form, but will upload ONLY the header of the chosen
file.
Anyone know how / if this can be done?

-- 
.    paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




[Zope] Re: Upload just file headers?

2000-10-10 Thread Paul Winkler

Still haven't found an answer, after 4 hours searching the
egroups archive.

Just to clarify:
I need to read the headers of the files BEFORE I upload the
entire file, because the files may be very large and I need
to be able to give a warning if the file does not meet
certain criteria. Example: a jpeg file of 500x400 pixels,
approx. 200 kb when the application, to be used in an
application that needs much higher resolution in order to
look good. I want to avoid wasting 50 seconds or so
uploading this file just to find out that it's no good. 

If I could upload the first bit of the file (1k should be
plenty), I could open it with PIL and check the size
attribute. (I've verified this by doing head --bytes 500
foo.jpeg > test.jpeg and then opening test.jpeg in python -
it works even though the file has been truncated.)


I wrote:
> 
> I'd like to make a form that looks like the typical file
> upload form, but will upload ONLY the header of the chosen
> file.
> Anyone know how / if this can be done?


-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Paul Winkler

Another way to look at it:
I want to start uploading the file, but stop the upload
almost immediately - after I've got enough to read the file
header, but long before the upload would normally finish.

Chris McDonough wrote:
> 
> Paul,
> 
> I'm sorry if I'm dropping context here, but I'm not sure what you mean when
> you say "headers of files".
> 
> Do you just want to check the size of files before you put them in the ZODB?

That would be useful, but I need more information than that.
I need to read some of the file's description of itself
that's commonly kept in a header at the beginning of a file.

For example, take a .gif or .jpeg file and throw away all
but the first (let's say) 1 kb of the file.
If you try to open this truncated file with an image editor
(gimp, photoshop, whatever) you'll have problems. But useful
information is still stored in that first part of the file,
as we can see using python and PIL.
Example, on linux:

head --bytes 1000 foo.gif > foo_truncated.gif
python
...
>>> import Image
>>> test = Image.open('foo_truncated.gif', 'r')
>>> test.size
(210, 210)

So in this case, we can find out that foo.gif is 210 x 210
pixels even if we only have access to the first 1 kb of the
12 kb file.

If the file in question is 1 MB or so, this trick becomes
really useful.
Suppose your web application needs an image about 1000 x
1000 pixels. You could warn the user if their image is too
small to look good, or so big it's a waste of their time.

So basically what I want to do is start uploading the file,
but stop quickly.

Now then, does anyone know how to do it?

Thanks again,

Paul

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Paul Winkler

Thanks for the reply!

Seb Bacon wrote:
> 
> Hmm, well you certainly can't do it at the browser side.

Yes, I want to do it on the server.
 
> A well-formed HTTP header should contain a content-length attribute which
> you can examine.  However, deciding whether to accept the file or not would
> I imagine not be possible inside zope since the whole POST operation is
> handled by ZServer, so you probably have to write a cgi script to do it.
> For example, if you wanted to stick with python, you could use the cgi
> module.  You'd examine the header, and if you were happy, you could pass on
> the data in a new POST to zope.  If you were unhappy, you could return a
> value from the cgi.

Hmm... so I couldn't put this in an external method?
I guess CGI would be okay.

I should clarify: It's not actually the HTTP header I want
to examine, it's the first few bytes of the data itself. I
need to upload enough of the data to read some useful info,
then stop ASAP.
 
> This is all off the top of my head, and I'm sure there must be a nicer way
> of doing it than that.  It's not nice having it all outside zope.  but it
> should be a start, at least.
> 
> seb
> 

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




[Zope] Any limit on number of users?

2000-10-11 Thread Paul Winkler

Hi,

Has anyone run up against a limitation on the number of
users that can be in
one acl_users folder? Either a hard limit or a practical
limit? 

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Paul Winkler

Much thanks to Knight and to Peter Bengtsson (who replied
off-list), I know have at least two possible avenues to
explore.

If I ever get this to work, I'll post it!

-- 
.    paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Re: Upload just file headers?

2000-10-12 Thread Paul Winkler

Martijn Pieters wrote:
> This doesn't hold true for JPEG's.
(snip)

Aha, thanks.
I'll have to think of a way to deal with this...

--PW 

.........paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




[Zope] Hosting?

2000-10-26 Thread Paul Winkler

Hi,

I'm wondering if anyone can recommend a commercial Zope
hosting service for me.
I've looked at the resources page on zope.org, and I have a
couple feelers out, but I'd like to ask the community for
recommendations as well.

Requirements:

I need a system that can handle a potentially very heavy
load, though at first it will be quite small - we're a
startup and have no customers yet.

Location: We're in the northeast USA and most of our users
will probably be in the US as well, so I'd prefer a service
in North America.

Zope: 2.2 at least, and access to install new products and
external methods.
I'm currently on codeit.com, but they have zope 2.1 and I
need zope >= 2.2 so I can use my custom product derived from
PTK 0.9.

Storage: We're doing things with digital images - *big* ones
- so we need to start at about 100 MB and will need to grow;
we'll be storing a *lot* of data for our users.  Eventually
(probably not until later in 2001) we'll need MUCH more -
possibly up to 1 GB eventually. (Beyond that point we will
probably just rent a server at rackspace.com or somewhere
but first we need to be able to develop a big enough
customer base to pay for it.)

Data transfer: Several times greater than storage. Users
will upload large files which we will then download to our
local network, so that's at least 2x our storage needs, plus
there's the transfer involved in just using the site.

Pricing: since our storage requirements will be continually
growing, I'd like a payment plan that enables us to pay for
the storage we need and add more as needed.

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Search and replace

2000-11-19 Thread Paul Winkler

Lee Hunter wrote:
> Shouldn't there be a S & R tab on every folder object that provides a choice
> of replacing html, dtml or text and that spits out a report on what was
> changed?

Oho, I like it. Yes, please!!!

> Or even better, that first gives you a report of *proposed* changes
> and then allows you to check off the ones you want to ok.

Yes, definitely you should have a chance to verify.

--Paul  (no relation to Martin AFAIK!)


-- 
.....paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




[Zope] PTK won't let me add objects

2000-11-20 Thread Paul Winkler

Hi,

I'm working on a site based on the PTK DemoPortal. PTK is a great
product, so I was happy to see a new release announced recently and
took the opportunity (yesterday) to update my PTK installation from
CVS. Well, now the Zope management interface won't let me add anything
inside the Portal except Document, Link, News Item, Portal File,
Portal Folder, and Portal Image. I'm NOT talking about the Portal
interface - just the plain old Zope "Available Objects" button.

Was this done on purpose? If so, why on earth would you want to
prevent anyone from adding so much as a humble DTML method?? We're not
talking about the end-user interface here.

For now I'm going to revert to an old version of PTK, bugfixes be
damned. I can't get any work done in this version.


-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com


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




[Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

I want the user to be sent to a particular URL after calling the
product's manage_add method. How can I do that?
The URL I want is REQUEST['URL3'].

I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
RESPONSE doesn't seem to exist here.


-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

seb bacon wrote:
> 
> * Paul Winkler <[EMAIL PROTECTED]> [001127 19:54]:
> > I want the user to be sent to a particular URL after calling the
> > product's manage_add method. How can I do that?
> > The URL I want is REQUEST['URL3'].
> >
> > I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
> > RESPONSE doesn't seem to exist here.
> 
> sounds alright to me.  are you calling it in quotes, e.g.  "RESPONSE.redirect(REQUEST['URL3'])"> ?
> 
> you shouldn't have to use the REQUEST to look up the variable, either:
> 

Thanks for the reply.
OK, I didn't phrase the question correctly.

I think it boils down to this:
If I have a string that represents a URL, can I define a method of my
product (in python, not in DTML) that redirects the browser to that
URL?

More details:


My product code is based on Boring (like most newbies I guess).
But manage_addBoring() does not do quite what I want. It returns
self.manage_main(self, REQUEST), so they end up at a long and ugly URL
that isn't where I want them to be anyway.

Example:
 the user is at:

http://localhost.localdomain:8080/Members/bobby

Bobby then clicks on a button I've provided that says "Add Test
Product". That sends him to the add form I've created. When Bobby
submits the request from this form, the product is added and he's sent
to

http://localhost.localdomain:8080/Members/bobby/manage_addProduct/MyProduct/manage_main
 

...because manage_addMyProduct returns self.manage_main
So I understand what's happening, but it's not what I want.
I don't want to send him there, I want to send him back to 

http://localhost.localdomain:8080/Members/bobby

So how can I do that from within the manage_addMyProduct method
definition?
The method gets a REQUEST argument, and I know that REQUEST['URL3'] is
what I want because if I return that string, it prints the URL I want.

I could do it by returning an HTML page with a redirect in the 
but that seems like a horribly ugly solution.


Looking through various Zope docs, I thought RESPONSE.redirect might
work, but  RESPONSE is not mentioned anywhere in Boring.py. Boring
only uses REQUEST.


-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

Michel Pelletier wrote:
> 
> Paul Winkler wrote:
(snip)
> > Looking through various Zope docs, I thought RESPONSE.redirect might
> > work, but  RESPONSE is not mentioned anywhere in Boring.py. Boring
> > only uses REQUEST.
> 
> So pass it RESPONSE:
> 
> def manage_addMyProduct(self, blah, blah, REQUEST=None, RESPONSE=None):
>   ...
> 
> The publisher will automaticaly pass you RESPONSE if you ask for it as a
> method argument.  Now use RESPONSE.redirect.

Aha, thanks. I didn't know that about the publisher.

Now I'm afraid I'm too stupid to see how to use RESPONSE.redirect
after reading the description in the Zope Book API appendix.

My method now looks like this:

def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
"""Add a MyProduct instance to the folder."""
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
return RESPONSE.redirect(whereto, 0)


That just prints the URL as a string.
OK, so maybe I'm not supposed to use the return value?
So I try it like this:


def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
"""Add a MyProduct instance to the folder."""
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
RESPONSE.redirect(whereto, 0)


Now when I submit the form, I can wait for a result forever and not
get anything.

How am I *really* supposed to do it?




-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com



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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

Phil Harris wrote:
> 
> You need to be careful when redirecting from an external Python wotsit.
> 
> RESPONSE.redirect raises an exception which can make the transaction get
> rolled back.
> 
> This seems not to happen when called from dtml but I've seen it happen from
> an external Python wotsit.
> 
> Note:
> 
> My use of wotsit above in no way has a bearing on the new name for the
> Python Methods/ZMethods/Script or whatever the hell they are called now. ;)

Thanks for the warning.
Does this only happen in certain circumstances?

I'm not using an External Method or a Python Script or whatever those
things are called now. I'm doing it in a Product. Does that matter?


.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com


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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

Dieter Maurer wrote:
> 
> If you need it in the constructor, then you must
> either pass in an object that is tied by acquisition
> or REQUEST or RESPONSE itself,
> or you must move the call out into the method
> "manage_afterAdd" (where the object already is tied in).

Well, I don't have that method. Went to learn about what people use it
for - searched for manage_afterAdd on zope.org and got nothing at
all???

Anyway, I'm now redirecting in manage_Add and it seems to work fine.
 
-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

OK, this seems to work.

def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
RESPONSE.redirect(whereto, lock=0) 




-- 
.....paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] HTTPSConnection Python 2.3.4

2005-03-31 Thread Paul Winkler
On Thu, Mar 31, 2005 at 01:12:41PM +0200, Joshua Jacobson wrote:
> On the same machine, my script works in python 2.3.4 outside of zope,
> but it doesn't work in python 2.3.4 within zope as an external script.
> There I get "sslerror: The read operation has timed out."

I have a somewhat similar issue; an in-house Zope product is retrieving some
information from a remote URL. If I hit the same URL from the command
line on the zope server (using wget), it works fine. When Zope hits it,
it gets a Bad Gateway error from the remote (Apache + Jboss) server.
Will post back here with anything I find out, maybe it will help you.

-PW
 
-- 

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


Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict

2005-03-31 Thread Paul Winkler
On Thu, Mar 31, 2005 at 11:38:59AM -0600, Andy Yates wrote:
> Am I going to have to write a python script to call the style sheet page
> template and change the content type or is there a better way to handle
> this?

Page Templates are awkward to use for non-XML output. I never tried
to use them for stylesheets.
fwiw, I have good results using DTML Methods for my dynamic stylesheets.
It's about the only thing I use DTML for anymore.
Mine look roughly like this:



body {
background-color: &dtml-mainBackgroundColor;;
color: &dtml-mainTextColor;;
}

/* more style rules follow */
...



-- 

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


Re: [Zope] Does anyone care whether we deprecate ZClasses?

2005-04-01 Thread Paul Winkler
+1 for deprecation.  However, I haven't used them for years.
I suspect you will hear otherwise from some people with 
currently deployed solutions based on ZClasses...
(cue Dieter)

-- 

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


Re: [Zope] HTTPSConnection Python 2.3.4

2005-04-01 Thread Paul Winkler
On Fri, Apr 01, 2005 at 08:29:39AM +0100, Chris Withers wrote:
> Paul Winkler wrote:
> >I have a somewhat similar issue; an in-house Zope product is retrieving 
> >some
> >information from a remote URL. If I hit the same URL from the command
> >line on the zope server (using wget), it works fine. When Zope hits it,
> >it gets a Bad Gateway error from the remote (Apache + Jboss) server.
> >Will post back here with anything I find out, maybe it will help you.
> 
> For both you and Jacob I'd recommend getting a packet sniffer up and 
> running. It looks like the requests your python code is emitting are not 
> the same as the ones that, for example, wget is emitting.

It'd be a heck of a lot easier if the packets were unencrypted.
I set up tcpwatch (great tool!) but predictably, for an SSL connection,
the output is gibberish. 
Any other ideas?
 
-- 

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


Re: [Zope] script or external method ?

2005-04-03 Thread Paul Winkler
On Mon, Apr 04, 2005 at 12:49:30AM +0200, [EMAIL PROTECTED] wrote:
> The code i've writed imports date object from datetime
> package: this makes it
> doesn't work like a script (python), so i adapt code
> as an external method;

Maybe you could use Zope's own DateTime, which can be
used in Scripts?

> Well, 2 are the questions:
> First, what i've to do to get service variable like
> like container, context, request, etc.. ?
> Which are differences between script and external
> method coding? i remember that the zope book
> indicates only imports.

It's maybe not obvious, but implicit in the book is that the bindings
described for Scripts (container, context, etc.) apply only to Scripts,
and not for External Methods.

With External Methods, if the first argument to the function is
named "self", you can treat "self" as being equivalent to a python 
script's "context".

The request can be acquired as self.REQUEST.

The container of the external method... don't know. I never yet
had a case for an external method where I cared about the difference 
between context and container.

-- 

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


Re: [Zope] Re: login page problem

2005-04-05 Thread Paul Winkler
On Tue, Apr 05, 2005 at 09:32:04PM +0200, Dieter Maurer wrote:
> exUserFolder has built in caching (positive and negative caches),

I guess that by "negative cache" you mean something like
a cache of failed user lookups?
Nice.

-- 

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


Re: [Zope] Re: DateTime(), locale, summertime etc.

2005-04-07 Thread Paul Winkler
On Thu, Apr 07, 2005 at 02:44:38PM +0200, Max M wrote:
> Max M wrote:
> 
> >When I convert to DateTime objects, they are saved as "9:00 Universal". 
> >So that is correct too.
> 
> Ok. Turned out that I have misunderstood zopes DateTime().
> 
> It saves in UTC, but it still needs a timezone.
> 
> So converting datetime objects to the local timezone and then converting 
> to DateTime objects also as local timezone did the trick.
> 
> hmmm

Maybe this is relevant:
http://www.zope.org/Collectors/CMF/325

... crap, I never merged the fix. 
I should really make it a habit to read the CMF issues nag mail :-0

-- 

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


Re: [Zope] "The Zope Book"

2005-04-08 Thread Paul Winkler
On Fri, Apr 08, 2005 at 10:59:46AM +0200, Lennart Regebro wrote:
> On Apr 8, 2005 8:48 AM, Chris Withers <[EMAIL PROTECTED]> wrote:
> > Dieter Maurer wrote:
> > > When will they feature in *the* "Zope Book"?
> > 
> > Which "The Zope Book" are you referring to?
> > 
> > The 2.6 one on Zope.org?
> > The 2.7 one on Plope.com?
> > The 3.whatever one somewhere-I-don't-know?
> 
> I would expect it to be "featured", that is mentioned as a recommended
> practice, in a Zope2.9 book, should one appear. I also thonk that with
> 2.8 a 2.8 book should be released, which main feature could be to move
> the ZClass part to an appendix.

I would love that. But in the present day, we haven't even finished the
2.7 book.  I suppose we could just change the book's release number from
2.7 to 2.8 and hope that's adequate ;-)

But that leaves unanswered questions - should we document the Five stuff
at all, and if so, how?

The primary problem with the Zope Book is still the relative scarcity of
resources (i.e. editors with time to work on it).

The secondary problem with the Zope Book is that it's showing its age:
the choice and organization of topics is IMHO less than ideal, but that
can't be sufficiently addressed on a chapter-by-chapter basis, one needs
to have a good overview of the whole project.  This vastly increases the
scope of the task.

Sadly I can't see the status quo changing unless somebody wants to
invest sufficient money in the project so that some of the independent
contractors involved could schedule work on the book as an actual paying
job.  Hopefully one of two things will happen:

* I will be proven wrong, or
* such money will materialize somehow :-)

-- 

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


Re: [Zope] "The Zope Book"

2005-04-08 Thread Paul Winkler
On Fri, Apr 08, 2005 at 05:41:30PM +0200, Lennart Regebro wrote:
> On Apr 8, 2005 5:22 PM, Paul Winkler <[EMAIL PROTECTED]> wrote:
> > But that leaves unanswered questions - should we document the Five stuff
> > at all, and if so, how?
> 
> Well, the Five stuff is a subset of the Zope3 stuff, with way too much
> Zope2 stuff still necessary. The idea is that this should change quite
> rapidly and get more and more Zope3-ish and become less and less of a
> subset.
> 
> So it may be that documenting it is a bit of a waste of time. I think
> the most realistic part is to rename the 2.7 book to 2.8, move
> ZClasses and DTML last, note that 2.8 includes some Zope3 support but
> don't document it.

OK, but there should at least be a pointer to something to read
for people wanting to get started with 2.8.0/Five. 
I haven't yet looked at any of the Five stuff.
Is there at least a README? :)
 
> Then we'll concentrate on getting 2.9s Zope3 support to be more
> Zope3-ish, and documenting the differences into a Zope2.9 book. ;)

Yes, I'm sure we will ;-)
 
> I don't have an overview of what needs to be done on the Zope book in
> general though.

Well, the chapter-by-chapter editing is still not done.
See http://plope.com/Books/zb_signup for an overview of the known
tasks to be done.

-- 

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


Re: [Zope] "The Zope Book"

2005-04-08 Thread Paul Winkler
On Fri, Apr 08, 2005 at 06:06:57PM +0200, Lennart Regebro wrote:
> On Apr 8, 2005 5:59 PM, Paul Winkler <[EMAIL PROTECTED]> wrote:
> > Well, the chapter-by-chapter editing is still not done.
> > See http://plope.com/Books/zb_signup for an overview of the known
> > tasks to be done.
> 
> OK, but that's better than expected, I'd say. :) It sais "Finished" on
> a whole bunch of chapters.

Yep! But only about half. 
Current stats for anyone who cares:

Finished15
In Progress 12
Not Started 1
Unclaimed   4



-- 

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


Re: [Zope] Re: DateTime(), locale, summertime etc.

2005-04-09 Thread Paul Winkler
On Thu, Apr 07, 2005 at 11:22:39AM -0400, Paul Winkler wrote:
> Maybe this is relevant:
> http://www.zope.org/Collectors/CMF/325
> 
> ... crap, I never merged the fix. 

OK, now this is merged to the trunk and CMF-1_5-branch.

-- 

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


Re: [Zope] Composite Objects?

2005-04-11 Thread Paul Winkler
On Mon, Apr 11, 2005 at 04:43:38PM -0400, Jeffrey E. Forcier wrote:
> I'm attempting to use mostly-vanilla Zope to implement an intranet
> here at my office, but am finding it difficult to use a 'feature' that
> I imagine should be possible. I've created a template for what ideally
> would be a single object/class type, containing multiple different
> kinds of Zope objects, and want to be able to clone new copies of that
> template as one can do with the existing Zope objects (e.g. as one
> would add a new File or Folder).

(snip)

I gather you want to be able to modify the scripts and such
for each copy, which argues against the usual solution of building
a Product.  

You might check out AbracadabraObject, which seems tailor-made
for your use case.

-PW

-- 

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


Re: [Zope] Composite Objects?

2005-04-11 Thread Paul Winkler
On Mon, Apr 11, 2005 at 04:56:04PM -0400, Jeffrey E. Forcier wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Paul Winkler wrote:
> 
> > (snip)
> >
> > I gather you want to be able to modify the scripts and such for
> > each copy, which argues against the usual solution of building a
> > Product.
> 
> Actually, no--the only thing that would change per-instance would be
> the Formulator form and, of course, the underlying data. The logic, as
> scripted in the Python Scripts, would be the same for all instances.

In that case, I'd write a filesystem Product for the logic.
Replace the scripts with methods of the Product class.
Make it folderish so it can contain Forumator forms and anything
else you want: inherit from Folder and use its UI to manage
contents.

You could then use AbracadabraObject to clone instances of
this thing; or you could do it all in code and have a manage_afterAdd 
method that adds a preconfigured Formulator form.
Source and/or docs of Formulator should give you a clue how
to instantiate one with the right config.

-- 

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


Re: [Zope] Newbie questions:

2005-04-11 Thread Paul Winkler
On Mon, Apr 11, 2005 at 06:43:46PM -0400, Jeffrey E. Forcier wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Enrique Ariz?n wrote:
> 
> > Hi again, I'm starting to make up with Zope, but still basic doubts
> > remains:
> >
> > Q1: When using normal python I'got used to the dir(Object) to learn
> > new APIs/Libraries. But when trainning with my first Zope Scripts I
> > can't. The "dir not defined" error appears. ???
> 
> Being a relative newbie myself, I'm not positive this is correct, but
> I can tell you that Python Scripts are limited in Zope--you can't
> access the entire set of normal Python libraries and functions. A
> large part, yes, but not all of them. I'd be surprised if 'dir' was
> not in the allowed functions, but that would be one reason why it's
> claiming it's not defined.

Mostly correct, except I'd say a "small part" rather than "large part".

See
http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
(which will make more sense if you read
http://www.plope.com/Books/2_7Edition/BasicScripting.stx first)

-- 

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


Re: [Zope] Composite Objects?

2005-04-11 Thread Paul Winkler
On Mon, Apr 11, 2005 at 08:36:22PM -0400, Jeffrey E. Forcier wrote:
> Paul Winkler wrote:
> 
> >In that case, I'd write a filesystem Product for the logic.
> >Replace the scripts with methods of the Product class.
> >Make it folderish so it can contain Forumator forms and anything
> >else you want: inherit from Folder and use its UI to manage
> >contents.
> >
> >You could then use AbracadabraObject to clone instances of
> >this thing; or you could do it all in code and have a manage_afterAdd 
> >method that adds a preconfigured Formulator form.
> >Source and/or docs of Formulator should give you a clue how
> >to instantiate one with the right config.
> > 
> >
> That's kind of what I was thinking. AbracadabraObject appears to have a 
> method call that allows you to use its magic in code, which I think is 
> exactly what I want, although as before I'm very surprised that this 
> sort of functionality doesn't exist in Zope proper.

Well, it's not really all that hard.
Googling ZopeLabs turns up a bunch of potentially relevant recipes.
...although, i cheated and searched for the method names because
I already know what they are :-)

http://www.zopelabs.com/cookbook/1008971158
http://www.zopelabs.com/cookbook/1059840939
http://www.zopelabs.com/cookbook/1045607641 (for CMF, but works
for any PropertyManager)
http://www.zopelabs.com/cookbook/1022683717


> I guess my desires aren't actually all *that* in-line with the main body 
> of Zope users, as I do *not* want the users of this application to ever 
> see a ZMI screen. 

That's not so unusual.. see for example CMF and all its offspring,
e.g.CPS, Plone

> Another possibly far-fetched feature I'd like, which again I believe was 
> part of ZClasses, would be to be able to tweak the instances' Formulator 
> forms after the fact...e.g. add another data field a year down the road. 

to all of 'em? Traditionally we do this sort of thing via an
iterator script. Something like:

all = context.ZopeFind(context, obj_metatypes=['Formulator Form'],
   search_sub = sub)
for form in all:
form.callSomeMethod() # i'm too lazy to look up the formulator API

> Of course this then means that I both do and don't want these cloned 
> forms to match up with the central one, and I'm not at all sure that I 
> can accomplish this without writing lots of my own code to handle it.

yep, there's no free lunch with that kind of problem.

-- 

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


Re: [Zope] developer docs

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:37:58PM +0200, Milos Prudek wrote:
> I do not feel I can contribute to ZDG at this time. Is there any other 
> resource you can recommend, please?

ZDG is really it.  It could use some cleanup to fold in the
comments and errata that are posted to the online version.
For now, just read the ZDG and heed the comments.

I personally do not use mxmEasyProduct. I did at one point, but I found
that while it's a timesaver for trivial things, I ended up having to
understand plain old Product development anyway, anytime I wanted to do
something different, plus I had to figure out how mxmMinimal worked.
That's typical of frameworks that hide details from you...
great until you want the details back ;-)

Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
used the "old-style" security declarations.  Instead
of an __ac_permissions__ attribute, you should use
ClassSecurityInfo as shown in, well, just about any Product
you have lying around.)

I know, this all screams for an organized, updated effort :-(

-- 

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


Re: [Zope] Q: Embedding documentation in Page Templates?

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:49:26PM -0500, J Cameron Cooper wrote:
> Stephen Nesbitt wrote:
> >All:
> >
> >Does anyone know of a way of embedding documentation directly into a page 
> >template without using ? In other words is there some construct 
> >which tells the rendering engine to simply ignore some content.?
> 
> I usually use
> 
>  
>   comment in here
>  
> 
> There are other constructs, but I think this is most reasonable.
> 
> The tag can be anything, of course::
> 
>  
>   comment in here
>  
> 
> Come to think of it, that's a few less keystrokes. This is even shorter::
> 
>  
>   comment in here
>  

Of those, I like your first: it explicitly says "comment".
Even somebody unfamiliar with ZPT can probably figure out
what that means.
 
-- 

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


Re: [Zope] [ANN] Zope 2.7.6 b1 released

2005-04-13 Thread Paul Winkler
On Wed, Apr 13, 2005 at 04:20:17PM +0200, Andreas Jung wrote:
> 
> 
> 
> Dear Zope Community,
> 
> on behalf of Zope Corporation and all Zope 2 developers and contributors
> I am pleased to announce the release of Zope 2.7.6 beta 1
> 
> Zope 2.7.6 beta 1 can be downloaded from
> 
>   http://www.zope.org/Products/Zope/2.7.6b1

Great news!  But:
 
> The release notes can be found at
> 
>   http://www.zope.org/Products/Zope/2.7.6.b1/CHANGES.txt

 that should be:
http://www.zope.org/Products/Zope/2.7.6b1/CHANGES.txt

-- 

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


Re: [Zope] Some problem about Data.fs

2005-04-13 Thread Paul Winkler
On Wed, Apr 13, 2005 at 05:27:39PM +0200, Andreas Jung wrote:
> There should be exactly *one* Data.fs file + Data.fs.index + maybe a 
> Data.fs.pack
> file from the last ZODB  packing operation.

Also Data.fs.tmp.

-- 

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


Re: [Zope] backing up zope files

2005-04-14 Thread Paul Winkler
On Thu, Apr 14, 2005 at 05:30:10PM -0400, Abhilasha Chaudhary wrote:
> Hi,
> 
> I am trying to find out how I can back up all the zope files related to 
> a particular
> project on the file system. I want to able to store the zope code in 
> CVS. I use ftp
> to store the files from zope on the file system. But when I put back the 
> files in the
> Zope area using ftp, the properties of the files all get converted to 
> DTML and the
> application cannot be used. I know there is a utility called 
> "PUT_factory" that
> allows you to specify the zope object you want, but I think this utility 
> is not very
> useful when you want to convert to certain types of objects(e.g 
> ZSQLmethod).
> I want to find out if there is a more graceful way of preserving zope 
> object properties
> while backing up zope files to the file system?

The FSDump product might help you.

Or, just keep your code on the filesystem in the first place.
Google for using Filesystem Directory Views outside of CMF.
 
-- 

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


Re: [Zope] non-undoable storage

2005-04-18 Thread Paul Winkler
On Mon, Apr 18, 2005 at 02:38:01PM +0200, Milos Prudek wrote:
> I have a couple hundred Articles (class instances) in my ZODB. Most 
> instances are 200 kB, some are much larger. One of the Article 
> properties is Number of times the article was read. Any increment causes 
> ZODB to grow by the size of the given instance, due to the fact that 
> ZODB will append a new version of the whole 200 kB or 2MB instance just 
> because a single byte was changed.
> 
> Consequently ZODB grows several hundred MB in a single day even if no 
> new article is added.
> 
> This calls for some form of non-undoable storage.
> 
> One possibility is to move the "NumberOfReaders" attribute from ZODB to 
> my SQL server. Not a problem, but I'm not sure what is the best way to 
> maintain connection between ZODB instance (it can appear at different 
> places in ZODB directory structure and it can be moved from place to 
> place with Cut and Paste in ZMI) and SQL table. Connection means SQL key 
> column. Instance ids cannot be used as a SQL key, because they are 
> nonunique - each folder has a sequence of instances numbered 1...x. So 
> there are over ten instances named "1". Instance addresses = URLs could 
> be used but I would have to write my own methods / interfaces for moving 
> Articles in the directory structure to maintain the connection between 
> ZODB and SQL table.
> 
> Is there an obvious elegant solution that I am missing?

You might consider replacing the NumberOfReaders attribute with a
first-class persistent object.  e.g. you could use a PersistentList or
IIBTree or some such.  This would prevent Zope from saving the entire
Article object when that one attribute changes. You'd still get some
bloat from all the historical revisions of the attribute, but it would
be MUCH less.  

e.g. something like:

from ZODB import PersistentList

class Article(...):

def __init__(self):
...
self._numberOfReaders = PersistentList([0])

def getNumberOfReaders(self):
return self._numberOfReaders[0]

def incrementNumberOfReaders(self):
# do NOT set self._p_changed = 1
self._numberOfReaders[0] = += 1 


You could then have NumberOfProperties become a ComputedAttribute
to allow client code to keep accessing it as an attribute.
(this is a read-only "property" in recent versions of Python,
not to be confused with Zope's "properties"; but Zope doesn't
support pythonic properties yet.)

e.g.:

NumberOfReaders= ComputedAttribute(getNumberOfReaders)


But AFAIK, ComputedAttributes don't support write methods.
So client code can't write "someArticle.NumberOfReaders += 1".
But then, you wouldn't be able to do that with a SQL-based
solution either.
 
-- 

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


Re: [Zope] non-undoable storage

2005-04-18 Thread Paul Winkler
On Mon, Apr 18, 2005 at 06:29:49PM +0200, Milos Prudek wrote:
> >from ZODB import PersistentList
> 
> Interesting. I'll look at this idea. I never heard of this class.
> 
> >You could then have NumberOfProperties become a ComputedAttribute
> 
> >But AFAIK, ComputedAttributes don't support write methods.
> 
> Um, are you saying that the solution would actually not work for my use 
> case?

If your use case is that a writable attribute is part of
your class' API, then yes I am saying that.

If your count is always updated by methods of the class anyway,
then you're fine.
 
> >So client code can't write "someArticle.NumberOfReaders += 1".
> >But then, you wouldn't be able to do that with a SQL-based
> >solution either.
> 
> Why not? It's easy to write ZSQL method to update data. Probably we do 
> not understand each other.

Probably not. If you had an SQL solution, and some client code
said someArticle.NumberOfReaders += 1, how would you get that
assignment to fire off your SQL code?

-- 

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


Re: [Zope] Firefox manage_changePermissions issue?

2005-04-19 Thread Paul Winkler
On Mon, Apr 18, 2005 at 10:53:00PM +0100, Tony Addyman wrote:
> I have experienced the following problem on two separate Zope/Plone sites.
> It is reasonably repeatable, but sometimes works without problem. I have a
> ZODB saved for testing purposes. I have tried fsrecovery.py on the
> database. It is not corrupted. Firefox fails on this database every time.

(snip)

I have not been able to provoke anything similar with Firefox 1.03
and CMFDefault 1.4.2 which is what I had handy when I read your message.

You might try Shane's tcpwatch.py to further analyze the problem:
Start it like e.g. (if zope is running on http://fooserver:8080):

tcpwatch.py -h -L :fooserver:8080

then point your browser at http://localhost: and
tcpwatch will log *everything* that goes between server and browser -
all request data, all response headers and data.

-- 

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


Re: [Zope] Organisational vs. Functional hierarchies

2005-04-19 Thread Paul Winkler
On Tue, Apr 19, 2005 at 04:31:15PM +0100, David Given wrote:
> Is this in fact possible, or do I need to start tinkering with custom
> products?

That's what I would do.

-- 

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


Re: [Zope] Organisational vs. Functional hierarchies

2005-04-19 Thread Paul Winkler
On Tue, Apr 19, 2005 at 06:17:30PM +0100, David Given wrote:
> On Tue, 2005-04-19 at 18:43 +0200, bruno modulix wrote:
> [...]
> > > All of B's siblings are the same sort of object.
> > 
> > Why do you have this strange idea ?
> 
> From, uh, the documentation... because all of B's siblings will inherit
> the same methods from A.

Sure, but that doesn't constrain the types you can add to a folder.

If you want to constrain availability of a method to instances of
a particular class, then it should be written as a method of that
class.  Acquisition is meta_type-agnostic.
 
> [...]
> > Then calls like:
> > Rose/Text/MyFavouriteRoseStories/text_methods/do_this
> 
> Ah, so *that's* how acquisition by context works! (I couldn't find any
> documentation on this. All the documentation about acquisition by
> context just says 'this is really complicated and I'm not going to
> describe it here'.)

It's in the Advanced Scripting chapter of the online Zope Book,
and there are some warnings about ways it can make your system
harder to maintain.
 
> Incidentally, is it possible to override the default behaviour of an
> object? Is there any way of allowing Rose/MyFavouriteRoseStories do
> something *other* than just executing the named page template, other
> than making MyFavouriteRoseStories a folder and overriding index_html?
> 
> [...]
> > Anyway, you *should* write your own Products - and for this kind of 
> > things, it's pretty easy.
> 
> Meh. Can you point me at any good tutorial documentations?

http://zopewiki.org/DiskBasedProduct

- 

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


Re: [Zope] Zope2.7.4 with Python2.4?

2005-04-19 Thread Paul Winkler
On Tue, Apr 19, 2005 at 05:45:08PM -0500, Luis N wrote:
>  Forgive my newbieness, but might this be because I did something silly 
> like:
>  > python mkzopeinstance.py
>  rather than,
>  > /usr/local/bin/python2.3 mkzopeinstance.py
>  when the instance was first created?

Yep, that'd be my guess.

-- 

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


Re: [Zope] Re: Zope2.7.4 with Python2.4?

2005-04-19 Thread Paul Winkler
On Tue, Apr 19, 2005 at 06:45:04PM -0500, Luis N wrote:
> Hi, 
>   >Zope appears to be defaulting, and running with Python2.4
> > 
> >Forgive my newbieness, but might this be because I did something silly 
> like:
> >
> >> python mkzopeinstance.py
> > 
> >rather than,
> > 
> >> /usr/local/bin/python2.3 mkzopeinstance.py
> > 
> >when the instance was first created?
>  nm, I fixed 'runzope', and 'zopectl' to reflect the appropriate python.

Note that python2.4 is not officially blessed by the core
zope developers for zope 2.7.  Everybody still runs python 2.3
except maybe a few who live on the bleeding edge.
Just so you're properly warned :-)


-- 

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


Re: [Zope] Organisational vs. Functional hierarchies

2005-04-20 Thread Paul Winkler
On Wed, Apr 20, 2005 at 04:38:06PM +0200, Milos Prudek wrote:
> >Ta. I'll check it out, although I suspect a ZClass may be more what I
> >want... need to do some more reading up.
> >
> 
> Don't use ZClasses. They have been deprecated for more than a year and 
> they are poorly supported.

Poorly supported, yes; officially deprecated, no.
See the recent thread on this list, "Does anyone care whether we
deprecate ZClasses?"   In which Jim Fulton said, among other things:

"...I'm not advocating that [removing ZClasses from zope 2.10].
I was asking if anyone cared. I strongly suspected that there 
would be people who did care. ...  Many active Zope developers are 
(understandbly) dismissive of ZClasses, but I think we can't ignore 
the many people who depend on them."

My interpretation: they aren't going away, but think twice before
you get heavily invested in them now.

-- 

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


Re: [Zope] Organisational vs. Functional hierarchies

2005-04-20 Thread Paul Winkler
On Wed, Apr 20, 2005 at 05:51:17PM +0100, David Given wrote:
> Any gotchas I should know about?

I dunno, I never use 'em :-)
 
> What other approaches are there to doing this kind of thing, other than 
> writing a fully-fledged Product?

For creating new TTW types?  I don't know of any, but that's
not a use-case I need so I haven't gone looking.

-- 

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


Re: [Zope] Adding a folder

2005-04-21 Thread Paul Winkler
On Thu, Apr 21, 2005 at 09:58:52AM -0500, Justin Fletcher wrote:
> I am rather new to Zope, and am having a little trouble hunting through 
> the documentation to find what I need. ?Currently I am looking to write 
> a script that when called will create a folder with a specified name. ?
> Eventually, of course, I will want to programatically add content to 
> these folders, but for now just seeing the documentation on how to add 
> the folders will be enough.

There are examples of this (and tons of other cool stuff)
on www.zopelabs.com

It's also in the online Zope Book 2.7:
http://www.plope.com/Books/2_7Edition/BasicScripting.stx#2-45

-- 

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


Re: [Zope] backing up zope files

2005-04-21 Thread Paul Winkler
On Thu, Apr 21, 2005 at 05:48:40PM -0400, Abhilasha Chaudhary wrote:
> Abhilasha Chaudhary wrote:
> 
> >Thanks for the info. I downloaded the FSDump product and dumped my 
> >files to the file system.
> >But when I ftp the files back to the zope interface, they lose their 
> >properties. Is there a
> >way(other than PUT_factory) to ftp the dump so that the object 
> >properties are not lost?

I see.  I should have explained better:
No, you can't ftp the results of FSDump and keep the properties.
It's intended for use with FilesystemDirectoryView.

There is no way to do what you're describing with FTP.

We do most of our development on the filesystem and use
FilesystemDirectoryViews to get zope to use the data.
We used FSDump as a one-time convenience for copying scripts that
were initially developed in Zope back to the filesystem with
properties intact.

-- 

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


Re: [Zope] "The Zope Book"

2005-04-25 Thread Paul Winkler
On Fri, Apr 08, 2005 at 06:58:31PM +0200, Dieter Maurer wrote:
> Lennart Regebro wrote at 2005-4-8 10:59 +0200:
> > ...
> >On Apr 8, 2005 8:48 AM, Chris Withers <[EMAIL PROTECTED]> wrote:
> > ...
> >> Which "The Zope Book" are you referring to?
> >> 
> >> The 2.6 one on Zope.org?
> >> The 2.7 one on Plope.com?
> >> The 3.whatever one somewhere-I-don't-know?
> >
> >I would expect it to be "featured", that is mentioned as a recommended
> >practice, in a Zope2.9 book, should one appear. I also thonk that with
> >2.8 a 2.8 book should be released, which main feature could be to move
> >the ZClass part to an appendix.
> 
> Indead, something along this line...

Considering that we still have not finished the "2.7" edition
of the book, I find it very unlikely that we will manage
to get something out in sync with the first zope 2.8 release.

Anyone who wishes to help us edit the book is encouraged to visit 
http://plope.com/Books/zb_signup

-- 

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


Re: [Zope] high loads, more threads, spinning wheels

2005-05-01 Thread Paul Winkler
On Sun, May 01, 2005 at 01:34:08PM +0200, Stefan H. Holek wrote:
> And there is nothing wrong with ZEO, really, there's only advantages.

One potentially large quibble:
If you have big (multi-megabyte) blobs in your ZODB, and this data
is not cached in the client's ZEO cache, performance is an order
of magnitude worse when running ZEO.  Once the data is in the client cache,
performance is about the same as a standalone zope running 
filestorage.

One workaround is to set the client cache size very large.

-- 

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


Re: [Zope] Re: ZEO and session variables.

2005-05-03 Thread Paul Winkler
On Tue, May 03, 2005 at 05:14:56PM -0400, Tres Seaver wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Dennis Allison wrote:
> > I am just setting up a multi-headed distributed system with several Zope
> > heads all communications with a ZEO backend.  The zopes can be on the same
> > machine or on different machines connected through a high speed backbone.  
> > In our system, all zopes are frontended with pound.
> > 
> > zope1
> >   |
> >   zope2- ZEO-zope3
> >   |
> > zope4
> > 
> > We make heavy use of session variables.  Normally, with a single Zope
> > session variables are stored in a temporary folder, but, as such, they are
> > are not shared between the zope heads.   In the multiheaded system, the
> > session variables need to be shared and therefore must be managed by 
> > ZEO.   What is the recommended best practice for this?  
> 
> Richard Jones recently released a SQL-based sessioning implementation:
> 
>   http://www.zope.org/Members/richard/ZSQLSessionDataManager

Or you could look through today's messages to this list, where
I recall Chris McDonough mentioned using pound to force sessions
to stick to a ZEO client. That's appealingly simple; the obvious
drawback is that the session would be lost if the ZEO client restarts.
Presumably details can be found in the pound docs.

-- 

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


Re: [Zope] i am completely new to zope

2005-05-05 Thread Paul Winkler
On Thu, May 05, 2005 at 09:27:41AM -0700, Lukman Salifu Nayendi wrote:
> i am a new user of zope, i really want to learn alot about it and know more 
> please help.

http://zopewiki.org/ZopeWiki
http://www.plope.com/Books/2_7Edition

-- 

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


Re: [Zope] Re: i am completely new to zope

2005-05-05 Thread Paul Winkler
On Thu, May 05, 2005 at 01:33:45PM -0700, Simon Michael wrote:
> It would be interesting to really mine the list archives for the wealth 
> of answers in there, and present them in an organized fashion. At least 
> the last year's archive, say.
> 
> But, I think it would take an army of slaves^H^H^H^H^H^Hvolunteers akin 
> to the builders of the pyramids, java developers, etc. Am I wrong ?

I dunno... if you don't mind it happening in a disorganized,
haphazard fashion, zopewiki.org is the perfect place for this IMO.
The bar for contributing there is really low.  If you want a more
organized effort, good luck ;-)

-- 

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


Re: [Zope] Underscoring Inaugural Address

2005-05-11 Thread Paul Winkler
On Wed, May 11, 2005 at 03:00:02PM -0400, Dan Pozmanter wrote:
> Hello there Zopatistas,
>  
>In my inaugural post, I should like to enquire about getting to a url
> like so:
> http://myzopeserver.something.clever/a/path/to/a/file/named/__init__.py
>  
> Getting to the object "__init__.py" is difficult (it acts like it
> doesn't exist.)

Objects whose names begin with underscores are not "publishable."
The code is in lib/python/ZPublisher/BaseRequest.py
and there is no easy way to override this behavior.

-- 

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


Re: [Zope] Underscoring Inaugural Address

2005-05-11 Thread Paul Winkler
On Wed, May 11, 2005 at 03:50:00PM -0400, Dan Pozmanter wrote:
> Ugh.  I suppose I could ignore the '_' bit (and override
> BaseRequest.traverse), but the problems are: 
> 1.  Keeping this thing synced with Zope.
> 2.  Accessing the object being traversed to to ensure it is of the
> correct type.
> 
> There is no other way to do this?

Do you have to use URL traversal to reach the final object?
There's no such restriction on query parameters.

http://foo.com/get_file?name=__init__.py

-- 

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


Re: [Zope] How to make a ZPT-based form that calls itself?

2005-05-11 Thread Paul Winkler
On Wed, May 11, 2005 at 04:51:33PM -0500, J Cameron Cooper wrote:
> Look at your Python. It understands a dot as an attribute access. That's 
> why Zope historically avoids dotted object names. Witness 'index_html'.
> 
> You may use dictionary lookup:
> 
>  context['deltest.htm']()
> 
> or getattr.

But note that they're not semantically equivalent.
getattr(foo, 'bar')  might use acquisition to find 'bar'.
foo['bar'] does not use acquisition, it only looks directly in foo.

I don't like this difference, but, whatever.

-- 

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


Re: [Zope] Underscoring Inaugural Address

2005-05-12 Thread Paul Winkler
On Thu, May 12, 2005 at 10:52:03AM -0400, Dan Pozmanter wrote:
> Is sort of do, since the final object is a wrapper around a unique path.
> 
> What about messing aroound with the url?
> 
> Is there a way to have it show:
> 
> http://foo.com/__init__.py
> 
> But really point to
> 
> http://foo.com/supercoolfileat__init__.py
> ?

I don't know of an easy way to do that in zope alone, since the
names beginning with underscore are blocked at a pretty low level
(in ZPublisher).

But, if you have e.g. apache in front, that could be easily done
with a rewrite rule.

-- 

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


Re: [Zope] Corrupt Data.fs / ZODB

2005-05-16 Thread Paul Winkler
On Mon, May 16, 2005 at 05:18:08PM +0200, Michael Kaplan wrote:
> I tried to follow the advice in http://www.zopelabs.com/cookbook/1095965033
> (I use Zope-2.7.4) but end up with the 5th item there which says
> 
> !!
> !! 5. Get at the Zope path for the container of the object that's throwing 
> the POSKeyError:
> !!
> !! >>> obj=root.unrestrictedTraverse('/path/to/container')
> 
> When I try this I get
> 
>   >>> obj=root.unrestrictedTraverse('/folder')
> Traceback (most recent call last):
> File "", line 1, in ?
> NameError: name 'root' is not defined
>
> what's wrong here? I don't know what the author of this text means
> with '/path/to/container' and what I have to put there for 'root'.

'root' is probably a misprint. If you're using the bin/zopectl
script that comes with zope 2.7.x, you should substitute 'app'
instead of 'root'.

'/path/to/container' is a generic example.
Substitute the path to any container you're interested in. The author 
of the recipe cannot predict what paths are of interest to you.
Only you can know that.

> Therefore I used fsrefs.py and got information like
> 
> oid 0x030571 Products.CMFCore.ActionInformation.ActionInformation
> last updated: 2005-03-14 08:20:34.643177, tid=0x35BE85493CF9666L
> refers to invalid object:
>   oid 0x0304fa object creation was undone:
>   'Products.CMFCore.Expression.Expression'
> 
> For this oid I get
> 
>   > python
> Python 2.4 (#1, Jan 14 2005, 00:24:33)
> [GCC 2.95.3 20010315 (release)] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
>   >>> from Zope.Startup.run import configure;configure('/etc/zope.conf')
>   >>> from Zope import app
>   >>> app = app()

Note, there is a shortcut to the above: you can just run the command 
./bin/zopectl debug

>   >>> from ZODB.utils import p64
>   >>> from ZODB import POSException
>   >>> obj = app._p_jar[p64(0x030571)]
>   >>> print obj.getId()
> view
>   >>> print obj.bobobase_modification_time()
> 2005/03/14 09:20:34.643 GMT+1
>   >>> print obj.meta_type
> simple item

that's kind of unusual. Most Products have a more descriptive
meta_type.
Sounds like somebody wrote a subclass of OFS.Item.SimpleItem
and did not bother to provide a proper meta_type in their code.
Some grepping of source code in your Products directory might
tell you what this thing really is.

>   >>> print obj.__ac_local_roles__
> None
> 
> Could anybody tell me, how I can delete this object from Data.fs?
> Will obj.manage_delObjects(id) do the job for me? What parameters
> do I have to give to the programm?

No, that would delete a sub-object of obj.  If you want to delete obj
itself, you have to find its parent folder first.
You have found out an id ('view'), a mod time ('2005/03/14 09:20:34.643 GMT+1'),
and a (weird) meta_type ('simple item').  That should give you some
good clues for finding where this object lives, and thus find its parent
folder.  Once you know that, you can follow the zopelabs recipe.

Unfortunately, there is no way to just ask a raw object for
its physical path. You can call obj.getPhysicalPath() 
but it not tell you anything useful on a raw object
(one directly loaded from _p_jar)  because it is lacking
its acquisition context.


-- 

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


Re: [Zope] Seeking advice on Zope implementation

2005-05-17 Thread Paul Winkler
On Tue, May 17, 2005 at 07:33:30PM +0530, pythonic wrote:
> Questions:
> 1. Startup custmization: How can one configure zope to load instance
> of this as product
> (my application) on the startup but not the ZMI and other zope stuff.

You can't really prevent zope from starting up the ZMI.

> 2. We want to generate xml using ZPTs and then apply xsl. Is the server side
> transformation supported?

I don't know, but there's plenty of suggestive hits on google.
http://www.google.com/search?hl=en&q=zope+xslt&btnG=Google+Search

> 3. Is there any good doc available that describes how to do things you do in
> ZMI programmatically?

This should be useful:
http://www.plope.com/Books/2_7Edition/AppendixB.stx

Also, you can look at the dtml source of the ZMI in lib/python/App/dtml
- this can be helpful even just for a cursory glance to see the names of
methods that forms submit to.

Also check out http://www.zopelabs.com which has many relevant
recipes.

FWIW, everything I said applies to zope 2 only.  I can't really give
helpful advice about Z3, I haven't spent much time with it yet.

-- 

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


Re: [Zope] How to make a ZPT-based form that calls itself? (Part II)

2005-05-18 Thread Paul Winkler
On Wed, May 18, 2005 at 07:32:29PM -0400, Ken Winter wrote:
> The difference between this and the deletion example is that this form
> (personform.htm) need to be called with an argument, giving the person_id
> that identifies the record it is supposed to display.  I have tried a number
> of ways to sneak this argument in, but my limited experience with
> Zope/Python syntax has left me unable to guess the right trick.

You can append it to the url as a query parameter.
e.g.:

response.redirect('some_page?some_parameter=%s' % some_value)
 
-- 

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


Re: [Zope] Modifying __bases__

2005-05-20 Thread Paul Winkler
On Fri, May 20, 2005 at 01:48:46PM -0400, Dan Pozmanter wrote:
> What I aim to do is have the User Object inherit from a custom class
> (AlienUser).

You can do that in two ways off the top of my head:

1) the good way: write a custom UserFolder.
You could probably get away with just inheriting from UserFolder and 
overriding _doAddUser(). 

2) the hacky way: monkeypatch User.py to replace SimpleUser
with your class.

either way the stuff you are interested in is in AccessControl/User.py.


-- 

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


Re: [Zope] response.redirect not working

2005-05-20 Thread Paul Winkler
On Fri, May 20, 2005 at 11:45:58PM +0300, Art??ras wrote:
> The problem is on line #2. According to what's written, zope should
> drop everything and do immediate redirect to page index_html (ok, it's
> not where the first error appeared, I just managed to generate this
> error as the most clearest and best visible one), but instead zope
> calmly executes database actions and does other stuff till the end of
> the document.

I don't think RESPONSE.redirect() can reasonably be expected to stop all 
further processing of your script or template. 
It simply adds a header to the response, which has no effect until
the client receives it.

-- 

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


Re: [Zope] Modifying __bases__

2005-05-20 Thread Paul Winkler
On Fri, May 20, 2005 at 05:10:30PM -0400, Dan Pozmanter wrote:
> What is morally wrong with modifying live objects in a dynamic language
> to achieve desired functionality?
> The idea is "I want to modify the zope core in a way that survives
> version to version, yet does not
> impose a specific use case on all zope users".

I don't want to overgeneralize, but the "moral" issue I have with
monkey-patching is illustrated by an anecdote.

Once I was attempting to debug a problem with a core Zope product.
It was behaving in a baffling fashion that contradicted what the
source code was telling me. It was only during a tedious pdb session
that I discovered that a third-party product had monkey-patched
the method in question. (This turned out not to be the cause of the
problem we were having - but the mystery wasted an hour of my time 
when I was facing a deadline.)

The lesson is: python code may be eminently readable, and on this list
we are fond of telling users to "use the source" - but a monkeypatch in
some obscure corner of an add-on package can turn the source code into a
big fat lie.

That's evil :-)

Of course, sometimes it is a necessary (or at least expedient)
evil... sometimes you need a hook where there just isn't one
and you have no choice but to bash your way in there like a
500-pound gorilla.  So, I monkeypatch, and I feel guilty :-)

-PW

-- 

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


Re: [Zope] ZSyncer and ZEO

2005-05-25 Thread Paul Winkler
On Tue, May 24, 2005 at 11:29:02PM -0700, Dennis Allison wrote:
> 
> Does ZSyncer have any problem with Zope/ZEO systems?  I have some 
> anecdotal evidence of problems as we migrate to a multiheaded Zope/ZEO
> systems architecture.

I'd be curious to hear those anecdotes. Where I work, we use zsyncer daily 
and we *always* use ZEO.

The only potential issue I could see is that ZEO adds some network
overhead to ZODB writes, increasing the chances of a conflict error
(or, in recent versions of zsyncer, a timeout).
 
> Is there any difficult using ZSyncer between a Zope and a Zope/ZEO 
> combination.  

> Are there problems syncing between Zope 2.6.X and 
> Zope 2.7.X systems?

We synced from 2.7.X to 2.6.X for quite a while with no observed 
problems.  (Our development systems are often more current than our
production systems.)  Never tried the other way around AFAIK.

> All the systems run ZSyncer 0.5.1.

... which, just so you know, is now different enough from the current 
codebase that if you had any problems with it, I'd be unable to give
you any advice except to upgrade :-)

-- 

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


Re: [Zope] ZSyncer and ZEO

2005-05-25 Thread Paul Winkler
On Wed, May 25, 2005 at 10:14:23AM -0400, Paul Winkler wrote:
> We synced from 2.7.X to 2.6.X for quite a while with no observed 
> problems.  

... which, to be clear, you should take as anecdotal evidence only.
I can't guarantee that you will have no problems syncing between
mismatched zope versions.

-- 

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


[Zope] Re: ZSyncer and ZEO

2005-05-25 Thread Paul Winkler
On Wed, May 25, 2005 at 09:15:32AM -0700, Dennis Allison wrote:
> 
> Furher investigation has shown that the failing ZSyncer target had a 
> problem with its authentication code and that was likely the cause of 
> the failure.  We are continuing to test, but it appears everything is 
> working.   We'll continue to test but I am pretty sure this was not a 
> ZSyncer problem.

You might be interested to know that I made substantial improvements
to the error reporting and logging for ZSyncer 0.6.
Problems like this are generally easier to diagnose now.

-PW

-- 

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


Re: [Zope] Finding an object in a folder

2005-05-26 Thread Paul Winkler
On Wed, May 25, 2005 at 09:03:13PM +0100, Chris Withers wrote:
> >>if getattr(thefolder.aq_inner.aq_explicit,the_id,None):
> >
> >You are aware that this is in general *NOT* an emulation
> >of "hasattr".
> 
> I didn't say it was ;-)
> 
> >It may fail e.g. for properties.
> 
> How would it fail for properties?

Well, it doesn't distinguish between an attribute which doesn't exist 
and an attribute which has any false value.  This makes it unsuitable as
a hasattr() replacement IMHO.

It feels kind of hacky, but for this kind of thing I've used the "marker" 
pattern that you find throughout the Zope source:

marker = ()
if getattr(some_object, marker) is not marker:
...

-- 

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


Re: [Zope] Finding an object in a folder

2005-05-26 Thread Paul Winkler
On Fri, May 27, 2005 at 09:20:52AM +1200, Phillip Hutchings wrote:
> > Well, it doesn't distinguish between an attribute which doesn't exist
> > and an attribute which has any false value.  This makes it unsuitable as
> > a hasattr() replacement IMHO.
> 
> But you're asking if the object posesses an attribute, not any
> question about the value of the object. I think returning false if the
> value is false is potentially dangerous - I may want to retrieve a
> false value.

"But" what? You just said the same thing that I said :-)
 
-- 

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


Re: [Zope] Finding an object in a folder

2005-05-26 Thread Paul Winkler
On Thu, May 26, 2005 at 11:52:36PM +0200, Dieter Maurer wrote:
> Chris Withers wrote at 2005-5-25 21:03 +0100:
> > ...
> >> I strongly argue against it. Fix "hasattr" in the Zope context,
> >> instead!
> >
> >Make it so! :-)
> 
>   _marker = []
>   def hasattr(obj, attr, marker):
> a = getattr(obj, attr, _marker)
> return a is not _marker
> 
>   import __builtin__
>   __builtin__.hasattr = hasattr
> 
> Easy enough, isn't it?

Are you currently running zope with a patch like this?
Have you noticed any performance difference?
the zope 2.6 source code contains over 700 calls to hasattr()...

> Now, there need only to be someone who checks it in.

Well, first I think it should be discussed on zope-dev...
unless it already has been? I'll post a message there.
 
-- 

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


Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
> Paul Winkler wrote:
> 
> >marker = ()
> >if getattr(some_object, marker) is not marker:
> 
> For good measure, I wonder if that should be a [], no a ()?

What's wrong with a tuple? There's no reason to mutate the marker. 

-- 

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


Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 01:58:44PM +0200, Florent Guillaume wrote:
> And all empty tuples are equal.

Not just equal, but all empty tuples are *identical*,
so () is () == True. 

I had no idea this was so :-\
 
> In python 2.3, the idiom most commonly found is to use marker = object().

Thanks for that.

-- 

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


Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 03:26:04PM +0200, Dieter Maurer wrote:
> A higher risk comes from the fact that some Python packages may
> rely on the broken "hasattr" behaviour. That's the reason why
> the problem is not fixed in Python itself.

And that's a very good reason not to monkeypatch it.
We can't have arbitrary third-party packages breaking when
they are used with Zope. Such bugs could be maddeningly difficult
to diagnose and find.

Anyway, Jim has made a papal edict on zope-dev:
We will never monkeypatch hasattr in the zope core.

-- 

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


Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Tue, May 24, 2005 at 08:59:01PM +0200, Dieter Maurer wrote:
> An incredibly long time ago, I filed a feature request for
> "hasattr_unacquired" -- together with patch, unit tests and documentation
> update. 

Do you mean this?
http://www.zope.org/Collectors/Zope/742

the unit tests and docs are missing.
But I like the idea.

-- 

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


Re: [Zope] How to read a file object

2005-06-01 Thread Paul Winkler
On Wed, Jun 01, 2005 at 10:01:22AM +0100, John Poltorak wrote:
> I'd appreciate it if anyone could point me to a repository of small code 
> snippets which illustrate some simple techniques usable in Python scripts 
> running under Zope.

http://zopelabs.com/
Note there is a "Python(Script)" category with over 100 recipes:
http://zopelabs.com/cookbook/byCategory?category=Python%28Script%29

-- 

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


Re: [Zope] Property id clashes with object id?

2005-06-02 Thread Paul Winkler
On Thu, Jun 02, 2005 at 12:05:00PM -0700, Rob Boyd wrote:
> I just observed something which I really wouldn't have expected. If I
> set a property on an object, via a PropertySheet, I then cannot add an
> object of the same id at the same level (and vice-versa).

Yes. PropertyManager just stores properties as attributes.
So they're in the same namespace as ObjectManager sub-objects.

Arguably that's wrong, but this is the first time I've heard
of anybody having a problem with it :-)

-- 

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


Re: [Zope] importing encode_base64

2005-06-03 Thread Paul Winkler
On Fri, Jun 03, 2005 at 10:50:25PM +0200, Tino Wildenhain wrote:
> Am Donnerstag, den 02.06.2005, 10:34 -0700 schrieb Varun Parange:
> > however when i try using it:
> >  
> > from Products.EmailTools import
> > MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64
> > 
> > i get an error saying:
> > 
> > Error Type: ImportError
> > Error Value: cannot import name encode_base64
> > 
> > All other modules are imported except this one...
> > 
> Thats funny. I do the same and it works.

What zope versions are you guys running?

Just now I saw something that *may* be related,
some imports that were fine on zope 2.7.3 are giving me
trouble on 2.7.6, but this is a very preliminary observation
and i have not had time to troubleshoot yet.  Monday...

-- 

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


Re: [Zope] importing encode_base64

2005-06-06 Thread Paul Winkler
On Fri, Jun 03, 2005 at 04:58:57PM -0400, Paul Winkler wrote:
> Just now I saw something that *may* be related,
> some imports that were fine on zope 2.7.3 are giving me
> trouble on 2.7.6, but this is a very preliminary observation
> and i have not had time to troubleshoot yet.  Monday...

False alarm, I get the same problem in 2.7.3 and 2.7.0,
most likely an error in my own code.

-- 

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


Voodoo with ModuleSecurityInfo, was Re: [Zope] importing encode_base64

2005-06-08 Thread Paul Winkler
On Mon, Jun 06, 2005 at 05:50:42PM -0400, Paul Winkler wrote:
> On Fri, Jun 03, 2005 at 04:58:57PM -0400, Paul Winkler wrote:
> > Just now I saw something that *may* be related,
> > some imports that were fine on zope 2.7.3 are giving me
> > trouble on 2.7.6, but this is a very preliminary observation
> > and i have not had time to troubleshoot yet.  Monday...
> 
> False alarm, I get the same problem in 2.7.3 and 2.7.0,
> most likely an error in my own code.

Maybe the following will be interesting, if not helpful,
at some date in the future if somebody else experiences weird problems 
with ModuleSecurityInfo().declarePublic()...

More info about the symptom:

While importing (i.e. from a .zexp file) an entire CMF site, I was
getting an Unauthorized error that I was not allowed to access the method 
(let's call it 'foo') in the current context.  
Now, foo.py is a script in one of my filesystem directory views, and is 
used both for a keyword index and metadata in my catalog tool.
And yes, I verified that there is no other object by that name.

foo.py is pretty darn simple:
 
from Products.FooProduct import Utils
return Utils.foo(context)


And in Products/FooProduct/__init__.py, I had this:

ModuleSecurityInfo('Products.FooProduct').declarePublic(
'blah', 'foo')


The interesting thing is that all this works just fine in the
normal operation of the CMF site.  It *only* raises Unauthorized
during an import of a .zexp of the CMF site.

As if that wasn't weird enough, after a very long and tedious round of 
troubleshooting today, I discovered that two changes were sufficient to 
make the symptom go away:

* Remove an (unused) import from FooProduct/__init__.py.
(The imported object was a class, defined in the same Utils.py as the
foo function. This import was vestigial.)

* Completely remove another product (which does not import any code from
FooProduct, nor vice versa.)

Neither of these changes alone is sufficient - I have to do both.
Once I do that, I can import the .zexp, then I can revert those
code changes and restart zope and all is good.
Neither one of those changes has anything whatsoever to do with foo.py
AFAICT.  Sounds bizarre, but this is 100% reproducible.
This is some crazy voodoo. If I can boil it down to a reasonably small
demonstration, I'll file a collector issue. 

But I don't think I will bother to, because it finally occurred to me
that if I change the form of the import in the script, it works.
i.e. if I change foo.py to look like this:

from Products.FooProduct.Utils import foo
return foo(context)

... then it works all the time, even during the import,
regardless of the aforementioned voodoo changes.

Weird, huh?

Security sucks.

-- 

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


Re: [Zope] Product architecture question (long)

2005-06-09 Thread Paul Winkler
On Thu, Jun 09, 2005 at 11:34:31AM -0600, Nikko Wolf wrote:
> However my question is this -- is it necessary for me to shutdown zope 
> to snapshot the directory?  Given the times of access, I'm *almost* 
> guaranteed that it's been idle for 1+ hours when I do this (famous last 
> words, though those may be).
> 
> Knowing that zope is event-driven (and no sleeper thread):
>  -- is there any consistency issues of backing up (Data.fs)
> without stopping?

This should be interesting:
http://www.plope.com/Members/chrism/repozo

>  -- is there another feature of "zopectl" that would tell
> it to "sync" the DB to the file system?

I don't know what you mean by "sync".  Are you trying to
extract data from zope and put it in some human-useful form
on the filesystem?

If so, I'd probably just use a script that calls wget
or some other standard http client to extract the data
I want.

Or possibly look into using Ape, but I've never done that.
http://hathawaymix.org/Software/Ape

> I've looked but found no Zope SSL capabilities, so does this requires 
> placing Zope behind Apache, right? 
> Ref: http://www.zope.org/Members/simonb/howtos/Set%20Up%20SSL

Pound would do the job too.
 
-- 

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


Re: Voodoo with ModuleSecurityInfo, was Re: [Zope] importing encode_base64

2005-06-09 Thread Paul Winkler
On Thu, Jun 09, 2005 at 08:18:30PM +0200, Dieter Maurer wrote:
> Paul Winkler wrote at 2005-6-8 20:48 -0400:
> > ...
> >from Products.FooProduct import Utils
> >return Utils.foo(context)
> >
> >
> >And in Products/FooProduct/__init__.py, I had this:
> >
> >ModuleSecurityInfo('Products.FooProduct').declarePublic(
> >'blah', 'foo')
> 
> This allows something like:
> 
>  from Products.FooProduct import foo
> 
> But, in fact, you use
> 
>  from Products.FooProduct import Utils
>  ... Utils.foo ...
> 
> Strange, that it worked at all...

Yeah, I think I just happened to hit on some undocumented
behavior that *mostly* works.

The moral of the story, of course, is "don't do that"!

-- 

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


Re: [Zope] Problem Installing Zope 2.7.0

2005-06-12 Thread Paul Winkler
On Mon, Jun 13, 2005 at 11:55:20AM +0530, rni users wrote:
> Hello Members,
> 
> i m installing zope2.7.0 on red hat linux advance server 3.0

why are you installing such an old version of zope?

> n m trying 
> 2 create a new zope instance..but the problem is that there is no /bin 
> directory created in my zope_home folder( which is zope-2.7.0) though all 
> other
> 
> doc ,import,lib, skel,Zserver,utilites,import, test.py,setup,py,sbin 
> etchave been created
> 
> is sbin similar to bin??

have you looked to see what is in it? :-)

Are you installing from RPM or something?  Of those, only
"import" is normally created in a Zope instance home...
I have generally avoided the zope packages provided by linux
distributions, because:

* they are usually way behind the current stable release.
(2.7.6, or 2.8.0 if you are comfortable with a dot-zero release).
Which is fine for playing around, but sooner or later you will have 
a need to upgrade to a version not supported by the distribution.
E.g. you may find that you *need* one of the several dozen, if not 
hundred, bugfixes and/or new features they haven't picked up yet.

* When you have installation problems, zope people on this list will 
have no idea what the hell you're talking about :-)

* Installing zope from source on linux is trivial, and
well-documented (e.g. in the online Zope Book at www.plope.com ).
 
> m unable to execute the command/bin/mkzopeinstance.py
> it says no such file or directory
> 
> from where shld i run /mkzopeinstance.py???
> 
> m completely new to zope...

sounds like you are pretty new to linux/unix too.  Try one
of the standard ways of finding stuff on linux, such as:

locate mkzopeinstance.py

That should tell you where it is.

If you are installing from RPM, there should be documentation
(maybe in /usr/share/doc ) explaining everything about where 
redhat puts stuff, since they apparently do it weird. 

If there is not, either complain to redhat, or install from 
source instead.

-- 

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


Re: [Zope] zope backward compatibility policy?

2005-06-13 Thread Paul Winkler
On Mon, Jun 13, 2005 at 10:58:25AM +0200, gabor wrote:
> i see..
> thanks a lot...
> 
> it's just that this is documented in the 'bugfix' part.
> 
> i didn't expect bugfixes to change the api

But you should expect bugfixes to change implementation details,
which is what this is :-)

If you read the documentation, e.g. at
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/UsingZope.stx
which was current as of Zope 2.6, it says:

 lines

A lines property is a sequence of strings.

Nowhere does it say "list".

> hmm.. it seems that i will have to read the whole changelog (what 
> happened between 2.6.4 and 2.7.2 ;))

Probably a good idea anyway :-)
When I am considering a major zope upgrade, I do this.

-- 

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


Re: [Zope] ACTUAL_URL vs. VIRTUAL_URL

2005-06-13 Thread Paul Winkler
On Mon, Jun 13, 2005 at 02:37:44PM +0200, Bert Vanderbauwhede wrote:
> Hi,
> 
> What's the difference between ACTUAL_URL and VIRTUAL_URL in the REQUEST 
> object?

VIRTUAL_URL only appears in the REQUEST when VirtualHostMonster does its
thing. So if you are not using virtual-hosting, VIRTUAL_URL does not
appear in the request. This is inconvenient; we wanted something
that would always be available and would always mean 
"the URL originally sent by the client".  This is what ACTUAL_URL is.

Having said that, I'm not clear on the difference between 
ACTUAL_URL and URL :-)

-- 

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


Re: [Zope] ACTUAL_URL vs. VIRTUAL_URL

2005-06-13 Thread Paul Winkler
On Mon, Jun 13, 2005 at 07:15:45PM +0200, Dieter Maurer wrote:
> Paul Winkler wrote at 2005-6-13 10:27 -0400:
> > ...
> >Having said that, I'm not clear on the difference between 
> >ACTUAL_URL and URL :-)
> 
> "URL" is in fact computed.
> 
> Thus, it can be both shorter (e.g. in case of a PythonScript
> with active "traverse_subpath"), longer (e.g. in case
> of ":{method|action}" request variables) or almost
> unrelated (e.g. in case of active '__before_traverse__' hooks
> (such as VHM)).

Ahh, right, thanks, I had forgotten traversal hooks that were
mentioned in the original discussion about this.

So, all told, ACTUAL_URL is quite valuable: AFAICT it is the only value
that is guaranteed to represent the "actual" URL seen by the user,
and it is always available.

-- 

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


Re: [Zope] Transferring Zope Settings

2005-06-14 Thread Paul Winkler
On Tue, Jun 14, 2005 at 11:56:47AM -0500, J Cameron Cooper wrote:
> The ZSyncer product may help. I don't recall how good it is at syncing 
> attributes, but it can certainly help you get your tools and skins and 
> whatnot configured the same.

ZSyncer currently syncs only entire objects. So if you
sync a folder, you automatically sync all its sub-objects.

But it can still help with some things, if e.g. it's safe to sync
your entire portal_skins tool.
 
-- 

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


Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 02:19:26PM +0200, J?rgen Herrmann wrote:
> hi all!
> 
> i make heavy use of indexes in my extension classes. these all inherit
> from catalogpathaware, so i have to call object.reindex_object() on
> each changed instance. calling it from attribute getters/setters f.ex.
> is not a good idea, because changing 3 attributes will reindex the object
> 3 times.
> 
> what i'd like to have is that such objects are reindexed automatically
> before comitting a transaction.
> 
> is it possible? where should i start looking in the source, is there
> possibly a before_transaction_commit hook?

I vaguely recall a similar discussion on zodb-dev; a search of the 
archives of that list may be a good idea.

You might also find QueueCatalog useful. AFAICT, if you are
using QueueCatalog and an object asks to be reindexed three times
before the next time the queue is processed, the QueueCatalog will
only actually reindex the object once. The tradeoff is that the
catalog results can be stale. 

It's only available via CVS, and doesn't come with docs, but
the embedded docstrings look pretty good. Note, I haven't used
it yet myself.
http://cvs.zope.org/Products/QueueCatalog/
Or to get a tarball,
http://cvs.zope.org/Products/QueueCatalog/QueueCatalog.tar.gz?tarball=1


It looks like you need some external process to actually 
trigger the processing of the queue.  A cron job calling a wget script
would do the job, or (better imho because it runs as a separate process)
if you are using zeo you could run a pretty trivial python script 
via bin/zopectl ... something like (untested):

import time
while 1:
time.sleep(30)
events_count = app.path.to.my.queuecatalog.process(max=1000)
print "processed %d events" % events_count  # or log it somewhere.

Hope that helps, 
-PW

-- 

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


Re: [Zope] Passing parameters using DTML

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 08:24:23PM +0100, John Poltorak wrote:
> Is there also something which explains how to call ZPTs from a DTML 
> object?
>
> I'm unable to pick up a passed parameter.
> 
> This is what I've conjured up:-
> 
> python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 
> 
> hoping that "options['parm']" would get resolved as "ABC" but it doesn't.

John, please, *always* provide tracebacks instead of saying things
like "it doesn't".  

> Any ideas? 

Without a traceback, everything I say below is guesswork.
 
I'm assuming the above line comes from a page template.
You neglected to mention what the calling DTML looks like,
but I *guess* that it was something like this:

yes? no?

I am pretty sure that your problem is with the expression
context.options['parm'].  Why do I say this?
Hint 1: Look at that expression from left to right.
Hint 2: Think about what "context.options" means.

In general, if you have not, you really should read the whole of 
http://www.plope.com/Books/2_7Edition/BasicScripting.stx
and  http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
... not just once but several times :-)

Taken together, they answer all "how to call X from Y" questions.

-- 

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


Re: [Zope] Passing parameters using DTML

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 11:25:30PM +0100, John Poltorak wrote:
> This is what I have:-
> 
> 
> 
> I wish to get 'myobjectname' into this line in 'testlist' which is marked
> with *
> 
> python:here.parse_file(file=context.**,sepr=',',clone=1)"> 
>
 
> There must be a simple way of doing this, but I haven't come across an 
> example of it and I've spent most of the day on it.

OK, I repeat my earlier suggestion:
  
> > Hint 1: Look at that expression from left to right.
> > Hint 2: Think about what "context.options" means.

Here's another clue: 
You are not really having a DTML problem. 
You are not really having a ZPT problem.
You are not even really having a Zope problem.
You are having a python problem.

The problem is:  given an object, foo, and an arbitrary string that 
identifies an attribute of foo, how do you get at that attribute?

There is a built-in python function that exists for exactly
this purpose.  Read about the getattr() function here:
http://python.org/doc/2.3.5/lib/built-in-funcs.html

> > In general, if you have not, you really should read the whole of 
> > http://www.plope.com/Books/2_7Edition/BasicScripting.stx
> > and  http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
> > ... not just once but several times :-)
> 
> There is too much to read and understand. Much of it only ever makes any 
> sense in retrospect. Manuals are not a very useful way of learning how to 
> do something

(resists urge to rant)

Look - it doesn't have to all make sense on the first read, but
eventually it starts to click. If you won't even read it at all, you're
screwed before you begin.
 
-- 

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


Re: [Zope] developing with zmi: how to move a patch from data fro m devel to live?

2005-06-20 Thread Paul Winkler
On Mon, Jun 20, 2005 at 09:13:57AM +0200, Pascal Peregrina wrote:
> You can manually export objects from your dev zope to individual files and
> then import them back to the live instance through ZMI.
> 
> You could try this : http://zsyncer.sourceforge.net/
> It will enable you, for built-in Zope object types (but then you can extend
> it with your own types) to list the differences between your dev and live
> zope instances and deploy your changes.

... in a limited fashion, yes.
However, it doesn't tell you anything about valuable metadata such
as properties, security settings, etc.
And if you sync a folderish object, zsyncer will necessarily sync
all its sub-objects as well.  But within those limitations,
it's still pretty useful.
 
-- 

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


Re: [Zope] custom_persist_obj

2005-06-20 Thread Paul Winkler
On Mon, Jun 20, 2005 at 05:12:29AM -0400, Tamas Hegedus wrote:
> Hi,
> 
> I am new to Zope and not a programmer. It is a little bit complex for
> me. I am very frustrated, as I can not find the solution for a pretty
> simple task:
> 
> I would like to have persistent object with dictionaries.
> I think I do not need a ZClass or Product, just a simple object for
> holding mutable and persistent dictionaries (Manipulating with Script).
> Like
> MyObject:
>   dict1 = [ a:1, b:1, c:1, ...]
>   dict2 = [ a:2, d:4, e:6]
>   etc.
> 
> Thanks for your help in advance,
> Tamas

If you want a custom persistent object, you do indeed
need to write a Product.

But that needn't be complex.
http://www.zope.org/Members/maxm/HowTo/minimal_01


-- 

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


Re: [Zope] custom_persist_obj

2005-06-20 Thread Paul Winkler
Well, sure. But you need to write some unrestricted (i.e.
filesystem-based) code if you want to create instanced of
PersistentMapping and the like.

by the way, if it's ever going to get large, you might look
into using OOBTree instead of PersistentMapping.
See:
http://www.zope.org/Wikis/ZODB/guide/node6.html#SECTION00063

-PW

On Mon, Jun 20, 2005 at 03:24:12PM +0200, Pascal Peregrina wrote:
> You have a built-in Zope object for this : PersistentMapping.
> 
> dict1=PersistentMapping({'a':1,'b':1,'c':1, ...})
> dict1=PersistentMapping({'a':2,'d':4,'e':6})
> 
> The only thing you can not do compared to dictionaries is :
> for key in dict1:
>  do something
> (you need to use for key in dict1.keys():...)
> 
> Pascal
> 
> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
> Tamas Hegedus
> Envoy? : lundi 20 juin 2005 11:12
> ? : zope@zope.org
> Objet : [Zope] custom_persist_obj
> 
> 
> Hi,
> 
> I am new to Zope and not a programmer. It is a little bit complex for
> me. I am very frustrated, as I can not find the solution for a pretty
> simple task:
> 
> I would like to have persistent object with dictionaries.
> I think I do not need a ZClass or Product, just a simple object for
> holding mutable and persistent dictionaries (Manipulating with Script).
> Like
> MyObject:
>dict1 = [ a:1, b:1, c:1, ...]
>dict2 = [ a:2, d:4, e:6]
>etc.
> 
> Thanks for your help in advance,
> Tamas
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
> 
> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> www.mimesweeper.com
> **
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

-- 

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
re. zopelabs.com:

> It probably is very useful, but I know I'd get hopelessly lost because 
> there is just so much stuff on it.

So you prefer to ignore it?

Granted, zopelabs.com has flaws. It's harder to find stuff than it
should be.  Nevertheless, browsing that site, along with reading the
Zope book (the old print version), was instrumental in getting me from
knowing nothing, to the point where I became a full-time zope developer.
We didn't even have the great resource of zopewiki.org back then.
Use that too, zopewiki is your friend.
There are tons of good links from http://zopewiki.org/PageTemplates

In general, I don't know how you expect to make any progress when your
typical response to the (many) suggestions you receive on this list is
"I can't read that, it's too much work".

> Most of the newbie stuff about macros 
> is probably quite old by now so I doubt whether I'd find it with a 
> sequential browse through the Cookbook. 

"probably"? "doubt"? 

> It's disappointing to find that the link from Newbies under the ZOPE 
> section does not function.

True that. I don't know what happened to zopenewbies.net.
 
> What I really need is something like a ZPT macro which defines a header 
> and footer and leaves a slot in the middle for my own content. I don't  
> expect to be able to write my own macro for quite a while - too many 
> pitfalls... I'm not even sure is that is how I should be approaching 
> writing a home page.

Have you tried the tutorial that comes with Zope?
It includes at least one simple example of macros - see lesson 4.

Not sure how to run the tutorial?  The default index_html for a new Zope 
server tells you:

"""There is a built-in interactive Zope Tutorial which gets you started
with some simple tasks using the Zope managment interface. To use the
tutorial, go to any Folder and select Zope Tutorial from the add list
and click the Add button. Provide a name for the tutorial and click Add
to begin working with the tutorial.
"""

-- 

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


Re: [Zope] accessing session data error

2005-06-21 Thread Paul Winkler
On Mon, Jun 20, 2005 at 05:20:29PM -0400, Leticia Larrosa wrote:
> Hi:
> 
>  I follow the steps to replicate the error in zope2.7 for Debian and i get 
> the error to.

fwiw, I have not been able to reproduce this following your instructions
(zope 2.7.6 running on gentoo linux; browser is IE 6.whatever
on win2k).
 
-- 

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 10:10:06PM +0100, John Poltorak wrote:
> On Tue, Jun 21, 2005 at 03:15:33PM -0400, Paul Winkler wrote:
> > On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
> > re. zopelabs.com:
> > 
> > > It probably is very useful, but I know I'd get hopelessly lost because 
> > > there is just so much stuff on it.
> > 
> > So you prefer to ignore it?
> 
> Just how much time should you spend on something when you are deriving no 
> benefit just increasing frustration?

Sometimes, answering questions on the mailing list feels exactly 
like that :-P

> I was on a course over the weekend where ordinary people in their 70's 
> with no technical ability were knocking together websites in just a few 
> hours with no prior training and no understanding of the 
> underlying concepts involved. Why should Zope be just as easy?

I highly doubt the stuff they were "knocking together" was
a sophisticated application, e.g. anything on the order of CMFDefault, not
to mention CPS or Plone.  There's a big difference between developing
web apps and slapping together some static HTML.

> There is a quantum leap between the tutorial and being able to do anything 
> useful with a website. What the tutorial needs to to handhold you through 
> putting together something like the homepage of zope.org.

That would be an immense tutorial!
There are some case studies of similar sites in Andy McKay's excellent
"Plone Book". But they depend on reading and understanding
many chapters before you get that far.

Jon, I know this is frustrating for you. You are encountering
the (in)famous "Z-shaped learning curve".  You have hit the upslope.
At this point, the trivial stuff (mostly) makes sense to you, but
there's a vast-looking chasm between where you are and where
you want to be. We've all been there. It *does* get better. Really.
But it can take months of perseverance to reach the other side.
And there's not really any way to skip the hard part.

You might find this interesting.
It was written by Chris McDonough years ago (back in the
pre-ZPT days).
http://www.zope.org/Members/mcdonc/HowTos/gainenlightenment

-- 

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


Re: [Zope] ZPT code sample

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 09:58:32PM +0100, John Poltorak wrote:
> I got the impression that DTML and ZPT make some aspects of HTML 
> redundant... 

redundant? no.
DTML and ZPT are better understood as languages that you use
"on top of" HTML.  (Or on top of XML, as the case may be.)
  
-- 

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


Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-22 Thread Paul Winkler
On Wed, Jun 22, 2005 at 02:02:30PM +0200, Andreas Pakulat wrote:
> No, method 2 aka ZClasses don't involve producing a Product. 

Sure it does.  A ZClass-based Product is still a Product.

As for why I don't use ZClasses:

1) Doing everything in "restricted" mode is a big pain.
You end up writing a bunch of external methods anyway.

2) Source code version control is mandatory, and ZClasses make it nearly 
impossible.

-- 

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


Re: [Zope] External editor for ZMI

2005-06-23 Thread Paul Winkler
On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote:
> 
> What alternatives are there to editing objects through ZMI?

ExternalEditor.
 
-- 

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


Re: [Zope] Newbie-question

2005-06-23 Thread Paul Winkler
On Thu, Jun 23, 2005 at 08:55:05PM +0200, Thomas Adams wrote:
> hi all,
> 
> I have specific folder name "art" in Zope in which i installed a user 
> folder, and a user
> with "manager role". now i want anaonymous user to access i.e view
> the website ubeneath the folder "art". Therefore i granted "View 
> Permission" to the "Anonymous Role"
> at the folder level "art", but that doesn't work. Then i came to the 
> conclusion to grant that
> Permission at root level. But that doesn't work too. So my question is:
> What i have to do if:
> 
> 1. i want only a manager user acces to the ZMI beneath the folder "art"

It should be enough to give only to Manager the permission
"View management screens" on that folder.

> 2. grant anonymous user acces to view the "generated pages" beneath this 
> folder

"View" and "Access Contents Information" usually do the trick.
If not, google for VerboseSecurity - a great add-on product
that will help debug security issues.

-- 

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


Re: [Zope] 2.5.1 to 2.8.0

2005-06-27 Thread Paul Winkler
On Mon, Jun 27, 2005 at 08:29:01AM -0500, Tim Suter wrote:
> I have a Zope install 2.5.1 that I am wanting to migrate to another box
> that has 2.8.0.  After the 2.8.0 install I import the .zexp's and copy
> the data.fs file from the old var to the new.  

Redundant. If you copy the Data.fs file, you do not need to import
any .zexp's.

If the failure occurs during import, well then, just don't do that :-)

-- 

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


Re: [Zope] 2.5.1 to 2.8.0

2005-06-27 Thread Paul Winkler
On Mon, Jun 27, 2005 at 10:28:45AM -0500, Tim Suter wrote:
> I deleted the Zope dir to start over.  Went through the configure make
> and make install routine from the source directoryran
> mkzopeinstance.py then after running:
> 
> # su -c "/opt/zope/knowledge/bin/runzope" itadmin
> 
> I get this:
> 
> Traceback (most recent call last):
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in ?
> run()
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run
> starter.prepare()
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 92, in
> prepare
> self.setupServers()
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 207, in
> setupServers
> raise ZConfig.ConfigurationError(socket_err
> ZConfig.ConfigurationError: There was a problem starting a server of
> type "HTTPServer". This may mean that your user does not have permission
> to bind to the port which the server is trying to use or the port may
> already be in use by another application. (Address already in use)
> 
> Can someone tell me what this is?

Did you read the error message?
Most likely, you left your old version of Zope running
on the same port. You can't run two servers on the same port at once.

-PW
 
-- 

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


Re: [Zope] 2.5.1 to 2.8.0

2005-06-27 Thread Paul Winkler
On Mon, Jun 27, 2005 at 11:51:02AM -0500, Tim Suter wrote:
> All I did was import the Data.fs this time.  No good.  Still get:
> 
> Zope Error
> Zope has encountered an error while publishing this resource.
> 
> Error Type: AttributeError
> Error Value: __getitem__
> 
> Should I just use the import function?

We need the whole traceback, which should be listed in
the /error_log object in the root of your zope folder tree.  

Find that and maybe we can get a clue from it.

-- 

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


  1   2   3   4   >