talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 784a101b7c2a898f893c656de01f08da00d19c1e
parent a193b41e8f120d4f742b8f81bec58ca34a79b805
Author: Holger Berndt <hb@claws-mail.org>
Date:   Sat, 10 Aug 2013 15:09:19 +0200

Python pluging: Folder: Add accessor to Mailbox object
Diffstat:
Msrc/plugins/python/foldertype.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/plugins/python/foldertype.c b/src/plugins/python/foldertype.c @@ -25,6 +25,7 @@ #include "foldertype.h" #include "folderpropertiestype.h" #include "messageinfotype.h" +#include "mailboxtype.h" #include <structmember.h> @@ -145,6 +146,14 @@ static PyObject* get_mailbox_name(clawsmail_FolderObject *self, void *closure) Py_RETURN_NONE; } +static PyObject* get_mailbox(clawsmail_FolderObject *self, void *closure) +{ + if(self->folderitem && self->folderitem->folder) + return clawsmail_mailbox_new(self->folderitem->folder); + Py_RETURN_NONE; +} + + static PyObject* get_identifier(clawsmail_FolderObject *self, void *closure) { if(self->folderitem) { @@ -189,8 +198,12 @@ static PyGetSetDef Folder_getset[] = { {"identifier", (getter)get_identifier, (setter)NULL, "identifier - identifier of folder", NULL}, + {"mailbox", (getter)get_mailbox, (setter)NULL, + "mailbox - corresponding mailbox", NULL}, + {"mailbox_name", (getter)get_mailbox_name, (setter)NULL, - "mailbox_name - name of the corresponding mailbox", NULL}, + "mailbox_name - name of the corresponding mailbox\n\n" + "DEPRECATED: Use folder.mailbox.name instead", NULL}, {"properties", (getter)get_properties, (setter)NULL, "properties - folder properties object", NULL},