I am trying to create a zope product and it basically works in python, so I thought I would start trying to 'zopify' it. I created a directory in the zope Products directory called zIMAP and placed my code in there, along with a __init__.py file to initialise the product. Here is what it looks like,
 
    import zIMAP
 
    def initialize(context):
        """Initialize the zIMAP product.
        """
        context.registerClass(
            zMAP.zimap,
            constructors = (zIMAP.manage_addzIMAPForm, zIMAP.manage_addzIMAP), icon = '')
The main bit of my product code is in a file called zIMAP.py. When I restarted zope, my zIMAP product appeared in the product management list (broken, as I'd expected). I looked at the debug info that zope provides for broken products and made some changes to the code... followed by restarting zope. I then got a different error from the broken product info screen. However, when I made changes to the code and restarted zope this time, it was as if I had done nothing. The same error was there (despite that particular line of code being different, and in fact at a different line). I could not make zope recognise my changes no matter how many times I restarted zope. So I tried deleting the product from the product management screen. It did indeed go away, but now it won't come back! When I delete any other working product, it simply reappears next time I restart zope. What has gone wrong with my product? How can I make zope recognise it again?
 
I have included the top of my zIMAP.py file as well in case it is required.
 
I'd really appreciate any help.
 
tim
 
top of zIMAP.py
 
 
import imaplib, re, string, sys, os, DocumentTemplate
import Globals
from Globals import Persistent, Acquisition
import AccessControl
import OFS
 
class zimap (
 Acquisition.Implicit,
 Persistent,
 AccessControl.Role.RoleManager,
 OFS.SimpleItem.Item,
 ):
 
 """zIMAP - Zope Product for displaying IMAP mailbox contents.
 """
 
 index_html =  DocumentTemplate.HTMLFile("zIMAP1.dtml")
 manage_addzIMAPForm = Globals.HTMLFile('add_zIMAP', globals())
 
 meta_type = 'zIMAP (webmail)'
 
 def __init__(self, host):
  self.host = host
  self.product_root = '.'
 
 class email:
 
  def connect(self, user, passw):
   self.user = user
   self.passw = passw
                 self.M = imaplib.IMAP4(self.host)
   self.M.login(self.user, self.passw)
   self.user_dir = zimap.product_root+'/spool/'+self.user
   email.makefiles(self)
 
...
 

Reply via email to