diff options
| author | Justus Winter <[email protected]> | 2016-10-31 13:42:26 +0000 | 
|---|---|---|
| committer | Justus Winter <[email protected]> | 2016-10-31 14:42:35 +0000 | 
| commit | 20dc37a0e7e1531b0e568a6ec29b1c2d18de59c3 (patch) | |
| tree | 27b9415a448303e9741cc2ee416c9a7598560755 /lang/python/examples/verifydetails.py | |
| parent | python: Improve constants module. (diff) | |
| download | gpgme-20dc37a0e7e1531b0e568a6ec29b1c2d18de59c3.tar.gz gpgme-20dc37a0e7e1531b0e568a6ec29b1c2d18de59c3.zip | |
python: Import the topmost module in tests and examples.
* examples/verifydetails.py: Only import the topmost module 'gpg' and
update the code accordingly.
* tests/support.py: Likewise.
* tests/t-callbacks.py: Likewise.
* tests/t-data.py: Likewise.
* tests/t-decrypt-verify.py: Likewise.
* tests/t-decrypt.py: Likewise.
* tests/t-edit.py: Likewise.
* tests/t-encrypt-large.py: Likewise.
* tests/t-encrypt-sign.py: Likewise.
* tests/t-encrypt-sym.py: Likewise.
* tests/t-encrypt.py: Likewise.
* tests/t-export.py: Likewise.
* tests/t-file-name.py: Likewise.
* tests/t-import.py: Likewise.
* tests/t-keylist.py: Likewise.
* tests/t-sig-notation.py: Likewise.
* tests/t-sign.py: Likewise.
* tests/t-signers.py: Likewise.
* tests/t-trustlist.py: Likewise.
* tests/t-verify.py: Likewise.
* tests/t-wait.py: Likewise.
* tests/t-wrapper.py: Likewise.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/examples/verifydetails.py')
| -rwxr-xr-x | lang/python/examples/verifydetails.py | 15 | 
1 files changed, 7 insertions, 8 deletions
| diff --git a/lang/python/examples/verifydetails.py b/lang/python/examples/verifydetails.py index 0d2b72cb..b3ca1339 100755 --- a/lang/python/examples/verifydetails.py +++ b/lang/python/examples/verifydetails.py @@ -21,24 +21,23 @@ from __future__ import absolute_import, print_function, unicode_literals  del absolute_import, print_function, unicode_literals  import sys -from gpg import core -from gpg.constants import protocol +import gpg  def print_engine_infos(): -    print("gpgme version:", core.check_version(None)) +    print("gpgme version:", gpg.core.check_version(None))      print("engines:") -    for engine in core.get_engine_info(): +    for engine in gpg.core.get_engine_info():          print(engine.file_name, engine.version) -    for proto in [protocol.OpenPGP, protocol.CMS]: -        print("Have {}? {}".format(core.get_protocol_name(proto), -                                   core.engine_check_version(proto))) +    for proto in [gpg.constants.protocol.OpenPGP, gpg.constants.protocol.CMS]: +        print("Have {}? {}".format(gpg.core.get_protocol_name(proto), +                                   gpg.core.engine_check_version(proto)))  def verifyprintdetails(filename, detached_sig_filename=None):      """Verify a signature, print a lot of details.""" -    with core.Context() as c: +    with gpg.Context() as c:          # Verify.          data, result = c.verify(open(filename), | 
