Re: [Pyme-help] Constants for import/secret flag in key
Status: Beta
Brought to you by:
belyi
From: Igor B. <be...@us...> - 2005-11-30 15:06:59
|
Stefan Neumann wrote: >1) Constants for import > > > >>>>import pyme.constants.import.SECRET >>>> >>>> > File "<stdin>", line 1 > import pyme.constants.import.SECRET > ^ >SyntaxError: invalid syntax > > Yes, I noticed this problem as well. I'm still thinking about what will be a good solution. I don't like change package name just for one type of constant and I don't like changing name for all constants... > 2) secret flag in key > >Looking at this code snipplet: > >########################################################### > >def getKey(email,secret): > """ > get Key for a specific e-Mail-adress. Result is the original gpg-Key > > email - used as identifier > secret - should be a secret key > """ > > > ctx = core.Context() > > keylist=ctx.op_keylist_all(email,secret) > return keylist.next() > >########################################################### > >Every Key has a flag, if this key is a secret key. > >The problem is now, that I get this depending on the parameter secret: > > > > >>>>key=getKey("ste...@fr...",True) >>>>key.secret >>>> >>>> >1 > > >>>>key=getKey("ste...@fr...",False) >>>>key.secret >>>> >>>> >0 > >Is this a correct behaviour? > > Well... It looks like the 'SECRET_ONLY' parameter to the gpgme_op_keylist_start() which is the second parameter to ctx.op_keylist_all() works not how it is described in 'info gpgme'. According to what I see - True means to retrieve only secret keys and False means to retrieve _only_ public keys. Some time ago I've accepted it and didn't bother to push for a change in gpgme or update of its documentation. If you think this is very important I can follow up on gpgme list with such request. Igor |