Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31358/src/classes
Modified Files:
ComposeTemplate.cpp
Log Message:
implemented support for Python functions in message templates
Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -b -u -2 -r1.68 -r1.69
--- ComposeTemplate.cpp 14 Jul 2004 16:13:58 -0000 1.68
+++ ComposeTemplate.cpp 18 Sep 2004 19:32:30 -0000 1.69
@@ -45,4 +45,8 @@
#include "Mpers.h"
+#ifdef USE_PYTHON
+ #include "PythonHelp.h"
+#endif // USE_PYTHON
+
#include <wx/confbase.h> // for wxExpandEnvVars()
#include <wx/file.h> // for wxFile
@@ -323,5 +327,7 @@
String *value) const;
#ifdef USE_PYTHON
- bool ExpandPython(const String& name, String *value) const;
+ bool ExpandPython(const String& name,
+ const wxArrayString& arguments,
+ String *value) const;
#endif // USE_PYTHON
bool ExpandMessage(const String& name, String *value) const;
@@ -446,4 +452,6 @@
// the whole menu
+//
+// Available accels: ABCDEGIJKLNQRSTUVWYZ
static TemplatePopupMenuItem gs_popupMenu[] =
{
@@ -461,5 +469,8 @@
WXSIZEOF(gs_popupSubmenuFile)),
TemplatePopupMenuItem(),
- TemplatePopupMenuItem(gettext_noop("&Execute command..."), _T("${cmd:%s}"), FALSE),
+#ifdef USE_PYTHON
+ TemplatePopupMenuItem(gettext_noop("Run &Python function..."), _T("${python:%s}"),
FALSE),
+#endif // USE_PYTHON
+ TemplatePopupMenuItem(gettext_noop("E&xecute command..."), _T("${cmd:%s}"), FALSE),
};
@@ -933,5 +944,5 @@
#ifdef USE_PYTHON
case Category_Python:
- return ExpandPython(name, value);
+ return ExpandPython(name, arguments, value);
#endif // USE_PYTHON
@@ -1188,10 +1199,19 @@
#ifdef USE_PYTHON
+
bool
-VarExpander::ExpandPython(const String& /* name */, String * /* value */) const
+VarExpander::ExpandPython(const String& name,
+ const wxArrayString& arguments,
+ String *value) const
{
- // TODO
+ // call Python function with the given name
+ if ( !PythonStringFunction(name, arguments, value) )
+ {
return FALSE;
+ }
+
+ return TRUE;
}
+
#endif // USE_PYTHON
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates