Update of /cvsroot/mahogany/M/src/Python/Scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15692/src/Python/Scripts

Modified Files:
        Minit.py 
Log Message:
fixed folder open callback

Index: Minit.py
===================================================================
RCS file: /cvsroot/mahogany/M/src/Python/Scripts/Minit.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -u -2 -r1.6 -r1.7
--- Minit.py    12 Jan 2004 17:41:44 -0000      1.6
+++ Minit.py    4 Feb 2004 19:05:48 -0000       1.7
@@ -1,16 +1,15 @@
-####################################################################
-# Minit.py : initialisation of the embedded Python interpreter     #
-#                                                                  #
-# (C) 1998 by Karsten Ball�der ([EMAIL PROTECTED])                 #
-#                                                                  #
-# $Id$                 #
-####################################################################
-
-####################################################################
-#                                                                  #
-# import the classes  which are part of M:                         #
-#                                                                  #
-####################################################################
+###############################################################################
+# Project:     M - cross platform e-mail GUI client
+# File name:   src/Python/Scripts/Minit.py
+# Purpose:     example of a Python module read by Mahogany on startup
+# Author:      Karsten Ball�der, Vadim Zeitlin
+# Modified by:
+# Created:     1998
+# CVS-ID:      $Id$
+# Copyright:   (c) 1998-2004 M-Team
+# Licence:     M license
+###############################################################################
 
+# import the classes defined by M
 import MDialogs
 import MailFolder
@@ -38,10 +37,5 @@
     return username
 
-####################################################################
-#                                                                  #
-# define the global initialisation callback Minit():               #
-#                                                                  #
-####################################################################
-
+# define the global initialisation callback Minit():
 def Minit():
     msg = "Welcome, " + GetUserName() + \
@@ -53,18 +47,10 @@
     MDialogs.Message(msg)
 
-####################################################################
-#                                                                  #
-# define any other functions used as callbacks:                    #
-#                                                                  #
-####################################################################
-    
-def callback_func(arg):
-    msg = "This is a Python Callback Function!\nThe argument is: " + arg
-    MDialogs.Message(msg);
-    
-def OpenFolderCallback(name, arg):
-    msg = "This is the Python OpenFolderCallback function!\n" + "  called on the 
hook: " +  name 
-    mf = MailFolder.MailFolder(arg)
-    msg = msg + "\n  from the mailfolder called:" + mf.GetName().c_str()
-    msg = msg + "\n  The folder contains " + mf.CountMessages() + " messages."
-    MDialogs.Message(msg);
+
+# example of a callback being called when a folder is opened (you need to
+# configure it by entering the function name in "Folder open callback" field
+# in the Python page of the folder properties dialog):
+def OpenFolderCallback(mf):
+    MDialogs.Message("Opening folder %s (with %d messages)" % (mf.GetName(), 
mf.GetMessageCount()))
+    return 1
+



-------------------------------------------------------
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-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to