[Pyme-help] Constants for import/secret flag in key
Status: Beta
Brought to you by:
belyi
From: Stefan N. <ste...@fr...> - 2005-11-28 19:19:54
|
Hi, it's me again ;-) So, I have just two question: 1) Constants for import I think, this is based on the analogie how you make constants available. I need the GPGME_IMPORT_SECRET constant. I will find it in: pyme.constants.import Problem: ======== >>> import pyme.constants.import.SECRET File "<stdin>", line 1 import pyme.constants.import.SECRET ^ SyntaxError: invalid syntax OR: >>> pyme.constants.import.SECRET File "<stdin>", line 1 pyme.constants.import.SECRET ^ SyntaxError: invalid syntax OR ... (could be continued in all different import styles ;-) ) Reason: ======= "import" is a reserved word and cannot be used in this way. Solving: ======== Up to you. "import" must have a different name. (Or do i make a mistake?) 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? Thanks for your help cheers, Stefan |