Re: python / tinymail.Account.set_pass_func



Shikhar wrote:
Shikhar wrote:
I would appreciate some guidance about how to make use of tinymail.Account.set_pass_func()

What would the (Python) signature of the function be?


Ah, looking at the tmut source code helped me figure out PasswordGetter

Not actually, it turns out. I have spent a lot of time figuring this out so it would be great if someone could help me out. I don't have experience with GObject so that could be tripping me, or maybe it has something to do with the bindings

>>> from tinymail.camel import *
>>> from tinymail.uigtk import GtkPasswordDialog
>>>
>>> def get_pass(aid, prompt):
...     pwdgetter = GtkPasswordDialog()
...     return pwdgetter.get_password(aid, prompt)
...
>>> acc = CamelTransportAccount()
>>> acc.set_id('tny_test')
>>> acc.set_pass_func(get_pass)
__main__:1: Warning: invalid cast from `TnyCamelTransportAccount' to `TnyList'
Segmentation fault


(Same error even if the account has a Camel session/username/password/hostname/port/name etc. attributes set)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]