diff options
| author | Christian Heimes <cheimes@redhat.com> | 2015-08-16 19:00:00 +0200 |
|---|---|---|
| committer | Christian Heimes <cheimes@redhat.com> | 2015-08-17 21:14:11 +0200 |
| commit | f98ca7fa1903e12a4b2c49a70163077b3560dc1d (patch) | |
| tree | a3446113d3a7d32c5ce79b1b359d5353ec49afee /base/common/python/pki/key.py | |
| parent | 71148b8f79a5d6ba0c949a3ca0acf5aec6321f0a (diff) | |
| download | pki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.tar.gz pki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.tar.xz pki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.zip | |
Py3 modernization: libmodernize.fixes.fix_print
Replace print statement with Python 3's print() function.
For Python 2 'from __future__ import print_function' turns the print
statement into Python 3 compatible print function.
See https://www.python.org/dev/peps/pep-3105/
Diffstat (limited to 'base/common/python/pki/key.py')
| -rw-r--r-- | base/common/python/pki/key.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/base/common/python/pki/key.py b/base/common/python/pki/key.py index 3433bce03..8064ffc19 100644 --- a/base/common/python/pki/key.py +++ b/base/common/python/pki/key.py @@ -25,6 +25,7 @@ Module containing the Python client classes for the KeyClient and KeyRequestClient REST API on a DRM """ from __future__ import absolute_import +from __future__ import print_function import base64 import json import urllib @@ -1009,23 +1010,23 @@ encoder.NOTYPES['AsymKeyGenerationRequest'] = AsymKeyGenerationRequest def main(): """ Some unit tests - basically printing different types of requests """ - print "printing symkey generation request" + print("printing symkey generation request") client_key_id = "vek 123" usages = [SymKeyGenerationRequest.DECRYPT_USAGE, SymKeyGenerationRequest.ENCRYPT_USAGE] gen_request = SymKeyGenerationRequest(client_key_id, 128, "AES", usages) - print json.dumps(gen_request, cls=encoder.CustomTypeEncoder, sort_keys=True) + print(json.dumps(gen_request, cls=encoder.CustomTypeEncoder, sort_keys=True)) - print "printing key recovery request" + print("printing key recovery request") key_request = KeyRecoveryRequest("25", "MX12345BBBAAA", None, "1234ABC", None, None) - print json.dumps(key_request, cls=encoder.CustomTypeEncoder, sort_keys=True) + print(json.dumps(key_request, cls=encoder.CustomTypeEncoder, sort_keys=True)) - print "printing key archival request" + print("printing key archival request") archival_request = KeyArchivalRequest(client_key_id, "symmetricKey", "MX123AABBCD", "AES", 128) - print json.dumps(archival_request, cls=encoder.CustomTypeEncoder, - sort_keys=True) + print(json.dumps(archival_request, cls=encoder.CustomTypeEncoder, + sort_keys=True)) if __name__ == '__main__': |
