I have been messing around with the py-TOC code, and am looking forward to implementing it into my zope/MySQL site.

I think I am missing something about how to connect it to my zope folder class

My goal with this is to tie in the AIM messages in with the folder class I am using in zope to affect database queries. However, I've only been able to successfully get it running using the "bot" and "bm" classes as global variables (not and so they are now outside the class where I need them... This was my best attempt at getting them inside the zope folder class, but zope does not like it... Is there a better way?

class SystemofControlSite(Folder):
   def __init__(self, id, title, content): = MyBot("syscontrolbot23","pass") = " notification bot." = BotManager(),"myBot") # start it up

on init, I get this error:


Sorry, a site error occurred.

Traceback (innermost last):

   * Module ZPublisher.Publish, line 150, in publish_module
   * Module Products.PlacelessTranslationService.PatchStringIO, line
     51, in new_publish
   * Module ZPublisher.Publish, line 114, in publish
   * Module Zope, line 171, in zpublisher_exception_hook
   * Module ZPublisher.Publish, line 102, in publish
   * Module Zope, line 188, in commit
   * Module ZODB.Transaction, line 222, in commit
   * Module ZODB.Transaction, line 195, in commit
   * Module ZODB.Transaction, line 256, in _commit_objects
   * Module ZODB.Connection, line 387, in commit
     'SystemofControlSite'), '\x00\x00\x00\x00\x00\x00\xdd1', '')

UnpickleableError: Cannot pickle <type 'file'> objects (Also, an error occurred while attempting to render the standard error message.)

I'm assuming this is because zope is attempting to make the bot connection persistant...

so then I did:

bot = MyBot("syscontrolbot23","pass")
bm = BotManager()
bm.addBot(bot,"myBot") # start it up

and use global variables to control it. def initbot(self):
       """ create the bot  """
       global bot
       global bm
       bm.addBot(bot,"myBot") # start it up
       return 1

This sucks though becasue I cannot pass a message from AIM back into my zope product to do something with the database...

Any ideas?  Suggestions?


Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to