[Pyme-help] Problems with import
Status: Beta
Brought to you by:
belyi
From: Stefan N. <ste...@fr...> - 2005-12-05 19:19:39
|
Hi, I just have another problem: Whem I am importing keys from an file, i need the information, which keys are imported. This function looks like this: ************************************* def importFromFile(data): """ Importing a key from a string. Parameters: data - The data as a string """ c=3Dcore.Context() keydata =3D core.Data(data) c.op_import(keydata) result =3D c.op_import_result() return result ************************************* Now I have to examine the result: (I subsitute the >>> to $) $ result=3Dcrypto.importFromFile(keys) $ result.imported 25 Then I want iterate over the list of imported keys: $ print result.imports <pyme.gpgme._gpgme_import_statusPtr; proxy of C _gpgme_import_status instance at _d0781408_p__gpgme_import_status> (It is not None) $ for imp in result.imports: ... print imp.fpr Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: iteration over non-sequence This should be the first error. Like mentioned in the gpgme-documentation, it should be a list, so i should be able to iterate over the list. The second problem is, that the result-information is totally corrupted: $ result.imports.fpr '`\xce\xbc\xb7\xb1' # This is not a real fpr $ result.imports.next.fpr segmentation fault I hope, you can help me. greets Stefan --=20 Stefan Neumann Dipl.-Ing. (FH) freiheit.com technologies gmbh Stra=DFenbahnring 22 / 20251 Hamburg, Germany fon +49 (0)40 / 890584-0 fax +49 (0)40 / 890584-20 1CB2 BA3C 168F 0C2B 6005 FC5E 3EBA BCE2 1BF0 21D3 B=FCcher kaufen und Freie Software f=F6rdern | http://bookzilla.de/ |