[Zope] [ANN] Zope 2.9.4 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.9.4. This bugfix release corrects the information exposure vulnerability addressed in the "2007/07/05 Hotfix.", http://www.zope.org/Products/Zope/Hotfix-2006-07-05 You may remove that hotfix product from your instances after upgrading to this version of Zope. You can download it from http://www.zope.org/Products/Zope/2.9.4/ Some new features of Zope 2.9: - ZODB 3.6 - Five 1.3 - integration for Zope 3 events for object creation and deletion - Zope 3 i18n integration for page templates For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.9.4/CHANGES.txt Please bring all the bugs you have found to the Zope bugtracker: "http://collector.zope.org/Zope":http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Supported Python versions: Zope 2.9 requires Python 2.4.3 (Python 2.4.1, 2.4.2 are still acceptable). Older Python versions are no longer supported. -- Andreas Jung(andreas at zopyx dot com) pgpsrjLx4WJJR.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] ExternalFile - getting back the file
[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 )
Re: [Zope] ExternalFile - getting back the file
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 )
[Zope] ExternalFile - getting back the file
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
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] Reading and parsing a text file object
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] Problem with ZEO connection - DisconnectedError
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 )
Re: [Zope] Catalog aware
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 )
Re: [Zope] Catalog aware
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] Using the DTML REQUEST Object
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: 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
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] Catalog aware
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
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] external method with import tarfile
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
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
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
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] question on simple_send in MailHost
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] question on simple_send in MailHost
--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] Catalog aware
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
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
--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] Catalog aware
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] question on simple_send in MailHost
--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] question on simple_send in MailHost
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: 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 )