I have an application where I would collect various automated e-mail responses which arrive more or less randomly. How can I get these into Zope? It looks like I could use the ZPublisher.Client module. Following along in the code, it looks like it ought to do the job. Is there some existing object type I can use for this, or do I have to make one? Note: the Client module uses rand, which I think is obsoleted; it is no longer in the Python Library Reference. To get around this, I did: #from rand import rand from whrandom import randint def rand(): return randint(0,2**31) Although, the only thing it is doing with rand.rand() is making a MIME multipart boundary, which could also be done with mimetools.choose_boundary(). -- Andy Dustman You should always say "spam" and "eggs" ComStar Communications Corp. instead of "foo" and "bar" (706) 549-7689 | PGP KeyID=0xC72F3F1D in Python examples. (Mark Lutz)
On Mon, 7 Dec 1998, Andy Dustman wrote:
Note: the Client module uses rand, which I think is obsoleted; it is no longer in the Python Library Reference. To get around this, I did:
#from rand import rand from whrandom import randint def rand(): return randint(0,2**31)
For entries that change regularly and often I do not use BoboPOS. Assuming that the e-mails arrive on the server machine you can store them in any format you want (shelve,xml plain text) and have Zope open your e-mail database and process them. Pavlos
On Mon, 7 Dec 1998, Pavlos Christoforou wrote:
For entries that change regularly and often I do not use BoboPOS. Assuming that the e-mails arrive on the server machine you can store them in any format you want (shelve,xml plain text) and have Zope open your e-mail database and process them.
Okay. In one particular case, I have a sort of status report which is in a fixed location in a flat text file, but it's not even clear how I can get that. Basically, I have a module in the Extensions directory. It defines one function. When I try to add an External method, it does find the module, and it does find the function, but then it barfs: Traceback (innermost last): File /home/rlist/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py, line 861, in publish_module File /home/rlist/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py, line 583, in publish (Info: /Remailers/manage_addExternalMethod) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMethod.py, line 125, in manage_addExternalMethod (Object: Navigation) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMethod.py, line 167, in __init__ (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMethod.py, line 186, in manage_edit (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMethod.py, line 207, in getFunction (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/App/Extensions.py, line 104, in __cmp__ AttributeError: 'None' object has no attribute 'co_argcount' So I'm obviously overlooking something. -- Andy Dustman You should always say "spam" and "eggs" ComStar Communications Corp. instead of "foo" and "bar" (706) 549-7689 | PGP KeyID=0xC72F3F1D in Python examples. (Mark Lutz)
On Tue, 8 Dec 1998, Andy Dustman wrote:
in __cmp__ AttributeError: 'None' object has no attribute 'co_argcount'
So I'm obviously overlooking something.
Andy I am not using Zope so I won't be of much help in deciphering the Zope tracebacks. I am using the ORB formerly known as Bobo and some simple framework I have developed on my own. I did have a situation similar to yours so I wrote a configuration class that maps dictionary like objects to XML and back. The sychronization is done automatically so administrators can edit the conf files using a text editor or through the Web. BoboPOS only keeps a reference to the configuration object but does not deal updates etc. I remember other posts on the subject and solutions varied from using b+trees to gdbm/bsddb to gadfly/etc. Pavlos
Okay. In one particular case, I have a sort of status report which is in a fixed location in a flat text file, but it's not even clear how I can get that. Basically, I have a module in the Extensions directory. It defines one function. When I try to add an External method, it does find the module, and it does find the function, but then it barfs:
Traceback (innermost last): File /home/rlist/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py, line 861, in publish_module File /home/rlist/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py, line 583, in publish (Info: /Remailers/manage_addExternalMethod) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMetho d.py, line 125, in manage_addExternalMethod (Object: Navigation) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMetho d.py, line 167, in __init__ (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMetho d.py, line 186, in manage_edit (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/Products/ExternalMethod/ExternalMetho d.py, line 207, in getFunction (Object: Item) File /home/rlist/Zope-1.9b1-src/lib/python/App/Extensions.py, line 104, in __cmp__ AttributeError: 'None' object has no attribute 'co_argcount'
So I'm obviously overlooking something.
It seems that External Methods are broken in beta 1. There was at least on patch posted to the Zope list. They should be fixed in beta 2. Sorry. -Amos
Andy Dustman writes:
I have an application where I would collect various automated e-mail responses which arrive more or less randomly. How can I get these into Zope? It looks like I could use the ZPublisher.Client module. Following along in the code, it looks like it ought to do the job. Is there some existing object type I can use for this, or do I have to make one?
Ah! I've been fuzzily thinking of the objects that would be useful for an upcoming site, and one of them would be an object for receiving mail messages. Outside of Zope, you'd have to add a line to /etc/aliases and pipe mail to some script which would stick messages in a directory or GDBM file or something. Actually processing messages is another matter; would it be better to have external scripts that read mail and twiddle objects in the Bobobase, or do everything in the long-running Zope process? If handled internally, you could have a publish/subscribe model: objects could send out a message with an ID in the subject line, and then be notified when a response with that ID comes in again. IMHO an important task will be to assemble a library of Zope objects, letting people assemble systems out of lower-level building blocks. For example, given a mail receiving object, you could write a mailing list manager like Mailman as a Zope application. -- A.M. Kuchling http://starship.skyport.net/crew/amk/ It may be objected by some that I have concentrated too much on the dry bones, and too little on the flesh which clothes them, but I would ask such critics to concede at least that the bones have an austere beauty of their own. -- A.B. Pippard, _Classical Thermodynamics_
participants (4)
-
Amos Latteier -
Andrew M. Kuchling -
Andy Dustman -
Pavlos Christoforou