On Wed, 28 Jan 2004 14:45:14 +0100 (Central Europe Standard Time) Robert Cernansky
<[EMAIL PROTECTED]> wrote:
RC> I was trying attach "callback_func" from Minit.py to open folder action and
RC> I get:
Sorry, I forgot to update Minit.py. Try this instead:
def OpenFolderCallback(mf):
MDialogs.Message("Opening folder %s (with %d messages)" % (mf.GetName(),
mf.GetMessageCount()))
return 1
RC> 14:15:49: Status: Mailbox "New Mail" opened.
RC> 14:15:49: Error: Traceback (most recent call last):
RC> File "C:\Program Files\Mahogany\Python\Minit.py", line 62, in callback_func
RC> msg = "This is a Python Callback Function!\nThe argument is: " + arg
RC> TypeError: cannot concatenate 'str' and 'MailFolderPtr' objects
Right... should be arg.GetName() probably but to be honest I don't even
know what was this supposed to do.
RC> When I try "OpenFolderCallback", I get:
RC>
RC> 14:14:14: Status: Mailbox "New Mail" opened.
RC> 14:14:14: Error: TypeError:OpenFolderCallback() takes exactly 2 arguments (1 given)
RC>
RC> 14:14:14: Error: Calling Python function "Minit.OpenFolderCallback" failed.
There are no more (dummy) "name" arguments for the callbacks and this one
wasn't updated. It also uses the non existent (any longer) CountMessages()
instead of GetMessageCount().
RC> Can somebody give me a hint how to call Python functions correctly, please?
RC> I was trying to type function name into Preferences -> Python -> "Folder
RC> open callback" box in various ways (callback_func, callback_func(),
RC> "callback_func",...) but none was working.
You should use either callback_func if the function is defined in Minit.py
or, better because you can modify the file on the fly, while Mahogany is
running, filename.funcname if it is in the file filename.py. For example, I
had put the function OpenFolderCallback() above in a file cb.py and so I
entered cb.OpenFolderCallback in the "folder open callback" field.
HTH,
VZ
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Mahogany-Users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-users