[Zope-Checkins] SVN: Zope/tags/2.9.4/ Zope 2.9.4

2006-07-19 Thread Andreas Jung
Log message for revision 69220:
  Zope 2.9.4
  

Changed:
  A   Zope/tags/2.9.4/

-=-
Copied: Zope/tags/2.9.4 (from rev 69219, Zope/branches/2.9)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/configure removed Python 2.4.1 as acceptable version

2006-07-19 Thread Andreas Jung
Log message for revision 69221:
  removed Python 2.4.1 as acceptable version
  

Changed:
  U   Zope/trunk/configure

-=-
Modified: Zope/trunk/configure
===
--- Zope/trunk/configure2006-07-20 05:30:34 UTC (rev 69220)
+++ Zope/trunk/configure2006-07-20 05:53:56 UTC (rev 69221)
@@ -18,7 +18,7 @@
 # sys.version) below in best to worst order, not including the
 # target version.  Up to six acceptable python versions are allowed.
 # Do not include the target version number in this list!
-ACCEPTABLE=2.4.1 2.4.2
+ACCEPTABLE=2.4.2
 
 # provide the executable names for all the acceptable versions
 # (and the target version) below

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/configure removed Python 2.4.1 as acceptable version

2006-07-19 Thread Andreas Jung
Log message for revision 69222:
  removed Python 2.4.1 as acceptable version
  

Changed:
  U   Zope/branches/2.9/configure

-=-
Modified: Zope/branches/2.9/configure
===
--- Zope/branches/2.9/configure 2006-07-20 05:53:56 UTC (rev 69221)
+++ Zope/branches/2.9/configure 2006-07-20 05:54:23 UTC (rev 69222)
@@ -18,7 +18,7 @@
 # sys.version) below in best to worst order, not including the
 # target version.  Up to six acceptable python versions are allowed.
 # Do not include the target version number in this list!
-ACCEPTABLE=2.4.1 2.4.2
+ACCEPTABLE=2.4.2
 
 # provide the executable names for all the acceptable versions
 # (and the target version) below

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] 2.9.4? reStructuredText support?

2006-07-19 Thread Jim Fulton


On Jul 16, 2006, at 7:29 PM, Richard Jones wrote:


On Sunday 09 July 2006 22:56, Jim Fulton wrote:

Whoever integrated reST didn't even read the documentation, much less
the code.


FWIW.

The ZReST product was originally released by me around 2002 -  
before those
directives existed. According to the docutils HISTORY file, the  
directives

themselves added in 2003. The *warning* about them was added in 2004.
The configuration to *disable* them appears to have been added in  
2005.


Fair enough.  This points out that we need to be as vigilant when  
updating
3rd-party packages as when initially using them.  I understand that  
you didn't

upgrade distutils in Zope.

Please understand, and this is directed to everyone in this  
discussion,  it
is not my goal to blame individuals.  *We* made a mistake and we need  
to learn
from it.  We can't learn from mistakes and stop repeating them unless  
we admit them.


We made a number of mistakes in this episode.  We exposed (an update
to) a 3rd-party library TTW without doing enough homework to be  
reasonably
assured that it was safe.  When we found a problem, we didn't write  
tests to
assure that it was solved sufficiently.  Again, I don't want to get  
on anyone's case,
but I want to make sure that we follow processes that will reduce the  
chance

of a repeat of something like this.


What the hell docutils was doing turning this feature on by default...


I don't think that TTW entry of reST was a use case for docutils.  In  
it's

normal usage, it makes sense for these to be enabled IMO.  The onus
should be on us, when we decide to expose something TTW to make
sure that the power we're exposing is controlled.

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



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

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope 2.9.4

2006-07-19 Thread Andreas Jung



--On 14. Juli 2006 16:01:22 -0400 Tres Seaver [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas Jung wrote:

If there are no objections, I plan to release Zope 2.9.4 in about one
week (likely next Thu or Fri).






Note that the 2.9 branch depends at the moment on unreleased ZODB
changes (for a fix to issue #2016) and that there is a sizable set of
changes on the 3.2 branch after 3.2.1, at least some of which might be
important for Zope2.




Since nobody replied to my posting about a 3.2.2 release this week I will 
release 2.9.4 using Zope 3.2.1.


Andreas 

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


[Zope-PAS] groups/roles and PAS

2006-07-19 Thread Mrozkowski, Andy


I have searched and posted in 
plone-users and I can't find an answer to this question on using PAS and 
ldap:
How do you add custom zope roles, and 
then map them to ldap groups?I work in a university setting and 
have the need for finer grained 
role-control..Thanks!AndyPlone 2.5Zope 
2.8.7python 2.3.5python-ldapldapUserfolder 2.7 
betaldapMultiPlugins 1.2Fedora Core 4 server @ http://thewell.mhc.edu 



background:
I have an acl_users folder (PAS) in my Plone site 
and inside that, I have an LDAPMultiPlugin. Inside the plug-in is an 
LDAPUserFolder. I feel that it is configured correctly because all 
mydomain un/pw'swork,and I can 
search for users and list all my groups. 

I figured out that it is preferable to map my LDAP 
groups to Zope roles by using the portal_role_manager, and it is working - as 
long as I use the built-in Zope roles.

My requirement is to add custom roles within Zope 
and map my LDAP roles to those. 

In the past I added custom roles from the security 
tab at the root of my Plone site. This method does not seem to work anymore. 
What is the preferred method of adding custom Zope roles and mapping them to 
LDAP 
groups?___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope] ZSQL Method Question

2006-07-19 Thread John Schinnerer

Aloha,

I think so, for the moment anyhow!
Thanks all,
John S.

Cliff Ford wrote:
Comment on Peter's suggestion: I am no expert on these things, but it is 
my understanding that for MySQL LAST_INSERT_ID() fetches the last 
autoincrement value made by the current insert, so the outcome is not 
affected by virtually simultaneous requests. And I don't think MySQL 
accepts a value for the autoincrement key. I am a bit surprised that the 
code you quote is reliable - surely there is a possibility of an insert 
after calling GetNextID and before calling SQLInsert in the python code?


Comment on Tino's suggestion: I think that LAST_INSERT_ID() is MySQL 
specific and I guess CURRVAL() is Postgres specific. But the principle 
is the same: calling within the same Z SQL Method ought to be safe.


Anyway, I hope John has had is question answered.

Cliff

Tino Wildenhain wrote:


Peter Bengtsson wrote:


What if you have 1,000,000 requests/sec?
What if between the INSERT and the LAST_INSERT_ID() another INSERT is 
made?


I use PostgreSQL and with postgres you can always ask the sequence what
the next id is going to be. It goes something like this::

next_id = context.GetNextId()[0].next_id
context.SQLInsertUser(uid=next_id, name='Peter')

where 'GetNextId' is a ZSQL method that looks like this::

params/params
SELECT NEXTVAL('users_uid_seq') AS next_id




Its even easier:
one ZSQL Method:

INSERT INTO foo (foo_id,blah,bar) VALUES
(nextval('foo_foo_id_seq'),dtml-sqlvar blah ... );
SELECT CURRVAL('foo_foo_id_seq') as foo_id;

But your above solution is valid too.

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


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



--

John Schinnerer - MA, Whole Systems Design
--
- Eco-Living -
Whole Systems Design Services
People - Place - Learning - Integration
[EMAIL PROTECTED]
http://eco-living.net
___
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] question on simple_send in MailHost

2006-07-19 Thread John Schinnerer

Aloha,

Thanks all for the suggestions...for the time being I can do what I need 
by sending to only one address.
It was trying to test the send by sending to multiple addresses (mine 
and others') that brought this out...

I will try a list next time I need multiple addresses in the To: field.

thanks,
John S.

Jonathan wrote:


- Original Message - From: John Schinnerer [EMAIL PROTECTED]
To: zope@zope.org
Sent: Sunday, July 16, 2006 11:49 PM
Subject: [Zope] question on simple_send in MailHost



Aloha,

The Zope (2.7.5) API docs for MailHost show this for simple_send:

--
simple_send(self, mto, mfrom, subject, body):

Sends a message. Only To:, From: and Subject: headers can be set. 
The arguments are:


mto
A commaseparated string or list of recipient(s) of the message.
mfrom
The address of the message sender.
subject
The subject of the message.
body
The body of the message.
--

So it reads like it can handle more than one To: address, something 
like this comma-separated string:


'[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]'

...but when I do this the message only gets sent to the first address 
in the list.




I have never used simple_send..., but have you tried putting the 'To' 
addresses in a list format, eg. ['addr1', 'addr2', ...]?  - if you 
already have a comma-separated string you can easily pass this as a list 
with something like:  string.split(addressString, ',').



Jonathan

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



--

John Schinnerer - MA, Whole Systems Design
--
- Eco-Living -
Whole Systems Design Services
People - Place - Learning - Integration
[EMAIL PROTECTED]
http://eco-living.net
___
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] question on simple_send in MailHost

2006-07-19 Thread Andreas Jung



--On 18. Juli 2006 21:23:59 -1000 John Schinnerer [EMAIL PROTECTED] 
wrote:



Aloha,

Thanks all for the suggestions...for the time being I can do what I need
by sending to only one address.
It was trying to test the send by sending to multiple addresses (mine and
others') that brought this out...
I will try a list next time I need multiple addresses in the To: field.


Why don't you use the send() method which works perfectly fine with multiple
recipient addresses???

-aj



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


Re: [Zope] Catalog aware

2006-07-19 Thread Garito

Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and 
make it

catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't it?

I would like to convert a normal PT is this possible?


I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this 
feature it does not mean that everyone needs this feature by default.


-aj

Sure but Is the cost so big?

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Andreas Jung



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.

But with this class I could create a new class of PT Catalog aware, isn't
it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to present 
a view on a particular instance of your class but not for providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either implement 
it as stated above or use one of the frameworkslittle need to discuss 
the pros and cons...by default Zope default content-types  don't depend on 
the catalog. CMF and Plone depend on the catalog for various reasons. If 
you have the requirement to use a catalog you have the mentioned options.


-aj



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


Re: [Zope] question on simple_send in MailHost

2006-07-19 Thread John Schinnerer

Aloha,

I did try send() - it seems one must know something about RFC822 message 
formatting to use it...?
I know nothing about that, and could not quickly find any clear and 
concise howtos or tutorials, just verbose and confusing specs and 
mailing list posts and so on.


I tried using send() with the same plain text body and from and to 
strings I was using for simple_send()...in case it might work...
When the mail arrived, some of the header content was in the body and 
not in the header.

It did arrive at all addresses in the To: field, I will admit... :-)
But the header was broken somehow, I assume because I didn't know how to 
format it correctly.

That was all the time I had to mess with it for now.

thanks,
John S.

Andreas Jung wrote:



--On 18. Juli 2006 21:23:59 -1000 John Schinnerer [EMAIL PROTECTED] 
wrote:



Aloha,

Thanks all for the suggestions...for the time being I can do what I need
by sending to only one address.
It was trying to test the send by sending to multiple addresses (mine and
others') that brought this out...
I will try a list next time I need multiple addresses in the To: field.



Why don't you use the send() method which works perfectly fine with 
multiple

recipient addresses???

-aj





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


--

John Schinnerer - MA, Whole Systems Design
--
- Eco-Living -
Whole Systems Design Services
People - Place - Learning - Integration
[EMAIL PROTECTED]
http://eco-living.net
___
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] Catalog aware

2006-07-19 Thread Garito

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use a 
catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?



--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] question on simple_send in MailHost

2006-07-19 Thread Andreas Jung



--On 18. Juli 2006 21:55:36 -1000 John Schinnerer [EMAIL PROTECTED] 
wrote:



Aloha,

I did try send() - it seems one must know something about RFC822 message
formatting to use it...?
I know nothing about that, and could not quickly find any clear and
concise howtos or tutorials, just verbose and confusing specs and mailing
list posts and so on.


Nonsense. The Python 'email' module is perfectly suited and documented 
(with examples). We use the 'email' module in various places for generating 
rfc822 compliant emails that are send through MailHost.send().


-aj

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


Re: [Zope] question on simple_send in MailHost

2006-07-19 Thread Tino Wildenhain

Andreas Jung wrote:



--On 18. Juli 2006 21:55:36 -1000 John Schinnerer [EMAIL PROTECTED] 
wrote:



Aloha,

I did try send() - it seems one must know something about RFC822 message
formatting to use it...?
I know nothing about that, and could not quickly find any clear and
concise howtos or tutorials, just verbose and confusing specs and mailing
list posts and so on.


Nonsense. The Python 'email' module is perfectly suited and documented 
(with examples). We use the 'email' module in various places for 
generating rfc822 compliant emails that are send through MailHost.send().


So you are writing a Product to enable it to python scripting? .-))

Well, its so easy... some of the beginners should be able to do it.

from AccessControl import allow_module, allow_class, allow_type

from formatter import BlockFormatter
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from MailCrypt import signmail
from email.Encoders import encode_base64

allow_class(BlockFormatter)
allow_class(MIMEBase)
allow_class(MIMEText)
allow_class(MIMEMultipart)
allow_class(Header)
allow_class(signmail)
allow_class(encode_base64)


would roughly do it.
Pack it nicely, add some ZMI howtos
and be ready :-)

Regards
Tino Wildenhain
___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain

Garito wrote:

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use a 
catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
___
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 method with import tarfile

2006-07-19 Thread Alan

Hi there!

I managed to find the problem and the solution.

First, I've forgot to mention that in my script, oname is an uploaded file.
I just inserted a f.close() and voilá!

def upload_external(self,file,REQUEST):
  import os,tarfile
...
  f=open(oname,wb)
  f.write(file.read())
  f.close()
...
  tar = tarfile.open(oname,r:gz)
  for itar in tar:
  tar.extract(itar.name,jobdir)
  return Done

Cheers,
Alan

On 18/07/06, Alan [EMAIL PROTECTED] wrote:

Thanks for your reply.

Yes, my script works and my file are not broken. I am using mac osx
tiger 10.4.7, zope 2.9.3 and python 2.4.2.

Cheers,
Alan

On 18/07/06, Andreas Jung [EMAIL PROTECTED] wrote:


 --On 18. Juli 2006 16:12:18 +0100 Alan [EMAIL PROTECTED] wrote:
 
  Error Type: IOError
  Error Value: CRC check failed
 
 

 This is unlikely a Zope issue. Either your tar file is broken or the
 tarfile module is broken. Check if your code runs without Zope as a
 simple PythonScript..there is nothing about Zope involved in your issue.

 -aj




--
Alan Wilter S. da Silva, D.Sc. - Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
http://www.bio.cam.ac.uk/~awd28




--
Alan Wilter S. da Silva, D.Sc. - Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need 
all my

object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use 
a catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
Sure, but I can't create a new product for every product I'll use only 
to do it catalog aware, isn't it?


Can you say more about monkeypatching?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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 method with import tarfile

2006-07-19 Thread Tino Wildenhain
Alan wrote:
 Hi there!
 
 I managed to find the problem and the solution.
 
 First, I've forgot to mention that in my script, oname is an uploaded file.
 I just inserted a f.close() and voilá!
 
 def upload_external(self,file,REQUEST):
   import os,tarfile
 ...
   f=open(oname,wb)
   f.write(file.read())
   f.close()
 ...
   tar = tarfile.open(oname,r:gz)
   for itar in tar:
   tar.extract(itar.name,jobdir)
   return Done
 

Err. why not

tar=tarfile.open(fileobj=file) ?
Why bother with potentially name clashing
files in filesystem?

Regards
Tino
___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
 Tino Wildenhain escribió:
 Garito wrote:
 Andreas Jung escribió:


 --On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:

 Andreas Jung escribió:


 --On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:

 Hi all!

 Is possible to create an object (for example a Page Template) and
 make it
 catalog aware?

 Look at the CatalogAware mixin class.
 But with this class I could create a new class of PT Catalog aware,
 isn't
 it?
 I would like to convert a normal PT is this possible?

 It makes little sense to index the contents of PTs. PTs are used to
 present a view on a particular instance of your class but not for
 providing content
 itself.


 I wonder why the objects aren't catalogable by default (I need
 all my
 object catalogables)


 Because Zope is not CMF and Zope is not Plone. Because you need this
 feature it does not mean that everyone needs this feature by default.

 -aj
 Sure but Is the cost so big?

 This is not the question. If you need catalog awareness, either
 implement it as stated above or use one of the frameworkslittle
 need to discuss the pros and cons...by default Zope default
 content-types  don't depend on the catalog. CMF and Plone depend on
 the catalog for various reasons. If you have the requirement to use
 a catalog you have the mentioned options.

 -aj

 Yes but what about something like

 if self.default_catalog != '': self.reindex_object()

 ?

 I think it's a question of preferences

 Then can I inject Catalog awarness to an object?

 Yes you can. Its possible with so called monkeypatching.
 However if you can do that, you better just write
 a product w/ subclasses of the standard zope objects and
 your CatalogAwareness. Its easy and clean and you dont
 interfere with further development of zope.

 Regards
 Tino
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?

Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.


 Can you say more about monkeypatching?

If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:
  

Tino Wildenhain escribió:


Garito wrote:
  

Andreas Jung escribió:


--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:

  

Andreas Jung escribió:


--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:

  

Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
  

But with this class I could create a new class of PT Catalog aware,
isn't
it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to
present a view on a particular instance of your class but not for
providing content
itself.

  

I wonder why the objects aren't catalogable by default (I need
all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj
  

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either
implement it as stated above or use one of the frameworkslittle
need to discuss the pros and cons...by default Zope default
content-types  don't depend on the catalog. CMF and Plone depend on
the catalog for various reasons. If you have the requirement to use
a catalog you have the mentioned options.

-aj

  

Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
  

Sure, but I can't create a new product for every product I'll use only
to do it catalog aware, isn't it?



Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to times: you 
first, me later
In my opinion (is only an opinion) these is not the best situation in a 
future


Sorry but is not so acceptable for me


  

Can you say more about monkeypatching?



If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
  

A! sure, I'll searched at google!

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
...
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?
 

 Yes you can. Why not? I mean you are using them - so you can use
 your products instead as well.
   
 Yes but what if tomorrow you create a product? need work to times: you
 first, me later

Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?

 In my opinion (is only an opinion) these is not the best situation in a
 future
 
 Sorry but is not so acceptable for me

The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.


  
 Can you say more about monkeypatching?
 

 If you cant figure out (google, imagination)
 you better dont do it :-)

 The code to monkey-patch is roughly the same
 as subclassing. So you better just subclass
 and use your products.

 Hint: you can use loops in python too .-)

 Kind regards
 Tino
   
 A! sure, I'll searched at google!

great :-)

Regards
Tino


___
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] Using the DTML REQUEST Object

2006-07-19 Thread Berthold Stöger
On Tuesday 18 July 2006 19:33, Muk Yan wrote:
 I'm using DTML on Zope (yes I know Plone and Tal is now the norm) and
 I was wondering if regularly using the REQUEST(set and get) object is
 bad practice.

If you want a variable whose scope is a single request, then use the REQUEST
object. If, on the other hand, your purpose is to work around the fact that
DTML is not a general purpose language, but rather a document templating
language, use PythonScripts instead. IMHO, of course.

 I was wondering if there was any way to pass 
 information from DTML Documents to DTML Methods and vice versa (and
 maybe from DTML Methods to DTML Methods) without using the REQUEST
 object.

There's at least two ways to pass variables between DTML-objects:

dtml-let var1='one' var2='two'
dtml-var other_dtml
/dtml-let
dtml-var other_dtml(_.None,_,var1='three',var2='four')

HTH
___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:
...
  

Sure, but I can't create a new product for every product I'll use only
to do it catalog aware, isn't it?



Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
  

Yes but what if tomorrow you create a product? need work to times: you
first, me later



Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?
  
I want to make every class catalogable only if I point a zcatalog id 
(with self.default_catalog) but If I point it I want to catalogue the object


Now is a search era, isn't it?

Use another framework only to do the objects catalogable?

I love simple things
  

In my opinion (is only an opinion) these is not the best situation in a
future

Sorry but is not so acceptable for me



The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.
  
And if I use them dinamically (a user with the role1 use the template 
Ver but a user with the role2 use the template Ver1 for the same 
context)? (I'm not sure if I understand you clear, sorry If I make a 
mistake, please
  
 
  

Can you say more about monkeypatching?



If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
  
  

A! sure, I'll searched at google!



great :-)

Regards
Tino


  



--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
 Tino Wildenhain escribió:
 Garito wrote:
 ...
  
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?
 
 Yes you can. Why not? I mean you are using them - so you can use
 your products instead as well.
 
 Yes but what if tomorrow you create a product? need work to times: you
 first, me later
 

 Who says you have a use for the product I create? Or if it makes
 sense to catalog it? If you want a cataloguing framework, why
 dont you use CMF or something?
   
 I want to make every class catalogable only if I point a zcatalog id
 (with self.default_catalog) but If I point it I want to catalogue the
 object

And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?


 Now is a search era, isn't it?

Yes, search for what and by whom is the question here.

 
 Use another framework only to do the objects catalogable?
 
 I love simple things

So why are you trying to make standard zope objects more
complicated? :)
  
 In my opinion (is only an opinion) these is not the best situation in a
 future

 Sorry but is not so acceptable for me
 

 The point is, it makes no sense to catalog Pagetemplates,
 Python Scripts, Folders and ZSQL Methods, Mailhosts
 and Database connections. These are all standard zope
 objects, yet they make catalogable content only in derived
 work or when they play together - which is a custom
 solution anyway. There you can add whatever cataloguing
 awareness you want.
   
 And if I use them dinamically (a user with the role1 use the template
 Ver but a user with the role2 use the template Ver1 for the same
 context)? (I'm not sure if I understand you clear, sorry If I make a
 mistake, please

This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
___
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] Problem with ZEO connection - DisconnectedError

2006-07-19 Thread krokodylek

Hi :)

My site was running fine with Zope-2.7.4 and ZEO when all of a sudden on some
(!) of the pages I've started getting DisconnectedError. This hasn't happened
before and I didn't change anything in my configuration...


I've checked the zeo-server's log, here is the important entry:

2006-07-17T13:58:46 ERROR(200) zrpc-conn:172.16.0.43:54825 Error caught in
asyncore
Traceback (most recent call last):
  File /home/zope/usr/lib/python/ThreadedAsync/LoopCallback.py, line 120, in
poll
obj.handle_read_event()
  File /usr/lib/python2.3/asyncore.py, line 390, in handle_read_event
self.handle_read()
  File /home/zope/usr/lib/python/ZEO/zrpc/smac.py, line 217, in handle_read
self.message_input(msg)
  File /home/zope/usr/lib/python/ZEO/zrpc/connection.py, line 225, in
recv_handshake
raise ZRPCError(bad handshake %r % proto)
ZRPCError: bad handshake '(K\x00K\x00U\x0fgetAuthProtocol)t.'


I really have no idea what's happening :-O I've searched the Internet and the
only thing I could found is this news (see: What's new in ZODB3 3.2.6b1? ZEO):

http://www.zope.org/Products/ZODB3.2/NEWS

Could I be a victim of this bug? It seems strange that this only happens on
some of the pages...

If so - Zope-2.7.4 has to have an old ZODB version, how do I safely upgrade it?
This is a production server, I really can't loose any data :-( Maybe this is
important - ZEO server and ZEO client are not on the same machine, they're
connected with network.

Or is it something else? Can anyone please help me? I'm glad to give you more
information if needed :-)

I wanted to send this message to ZODB-Dev but I can't seem to register nor send 
mails there...

Best regards,
Crocodil







___
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] Reading and parsing a text file object

2006-07-19 Thread egf05
Hi,

I am new to Zope (but familiar with Python) and have a question.
I have a text file in  a folder and I would like to parse its content, and I
wanted to put the text in a string variable. I understand I can access the
content through file.data or better str(file.data).
However, the string I obtain has no carriage returns anymore, they are replaced
by a space. This is annoying because I cannot split the file line by line.

Is there a trick I do not know? Or is there a better way to parse the content
of a text file object? Any advice would be very appreciated.

Thanks,
Eric
___
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] ExternalFile - getting back the file

2006-07-19 Thread krokodylek

Hi  :-)

I'm using the ExternalFile product:

http://www.zope.org/Members/arielpartners/ExternalFile

because I need to have a file both in ZMI, as well as in filesystem.

I would like to ask if anyone can tell me how to get back the file that 
ExternalFile was created from, having only the object? In fact I do not need 
the file itself, but tha data (bytes) that were inside.

I would be very grateful for any help.

Best regards,
Maciej Zieba 




___
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] ExternalFile - getting back the file

2006-07-19 Thread krokodylek

Hi  :-)

I'm using the ExternalFile product:

http://www.zope.org/Members/arielpartners/ExternalFile

because I need to have a file both in ZMI, as well as in filesystem.

I would like to ask if anyone can tell me how to get back the file that
ExternalFile was created from, having only the object? In fact I do not need
the file itself, but tha data (bytes) that were inside.

I would be very grateful for any help.

Best regards,
Maciej Zieba 







___
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] ExternalFile - getting back the file

2006-07-19 Thread Gabriel Genellina

At Wednesday 19/7/2006 15:16, [EMAIL PROTECTED] wrote:



I'm using the ExternalFile product:

http://www.zope.org/Members/arielpartners/ExternalFile

because I need to have a file both in ZMI, as well as in filesystem.

I would like to ask if anyone can tell me how to get back the file that
ExternalFile was created from, having only the object? In fact I do not need
the file itself, but tha data (bytes) that were inside.


Do you mean, the file in the filesystem does not exist anymore? An 
ExternalFile is like a pointer to a file, it does not store the 
actual file content, so if the original file is not there you can't 
get anything.


Or, if you are asking about how to retrieve the (existing) file 
contents, look in the sources for the getContents() method.




Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


___
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] ExternalFile - getting back the file

2006-07-19 Thread David H

[EMAIL PROTECTED] wrote:


Hi  :-)

I'm using the ExternalFile product:

http://www.zope.org/Members/arielpartners/ExternalFile

because I need to have a file both in ZMI, as well as in filesystem.

I would like to ask if anyone can tell me how to get back the file that
ExternalFile was created from, having only the object? In fact I do not need
the file itself, but tha data (bytes) that were inside.

I would be very grateful for any help.

Best regards,
Maciej Zieba 





 

a) why do you need access to *both* the file system *and* the ZMI for 
the same object?  (because ExternalFile (says) the external files appear 
as objects in the ZMI)
b) You want to get back the file that ExternalFile was created from, 
having only the object?  Can you explain that?  Sounds like Freud would 
be interested.


David



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