Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

commit changes from upstream release 0.2.9 on http://code.google.com/…

  • Loading branch information...
commit bebf31eee0304b9f93158a782f4605af1d4fb53f 1 parent 65bfd54
Daniel Folkinshteyn authored
View
2  LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2008-2011 by Vinay Sajip.
+Copyright (c) 2008-2012 by Vinay Sajip.
All rights reserved.
Redistribution and use in source and binary forms, with or without
View
4 PKG-INFO
@@ -1,11 +1,11 @@
Metadata-Version: 1.0
Name: python-gnupg
-Version: 0.2.8
+Version: 0.2.9
Summary: A wrapper for the Gnu Privacy Guard (GPG or GnuPG)
Home-page: http://www.red-dove.com/python_gnupg.html
Author: Vinay Sajip
Author-email: vinay_sajip@red-dove.com
-License: Copyright (C) 2008-2011 by Vinay Sajip. All Rights Reserved. See LICENSE for license.
+License: Copyright (C) 2008-2012 by Vinay Sajip. All Rights Reserved. See LICENSE for license.
Description: This module allows easy access to GnuPG's key management, encryption and signature functionality from Python programs. It is intended for use with Python 2.4 or greater.
Platform: No particular restrictions
Classifier: Development Status :: 5 - Production/Stable
View
17 gnupg.py
@@ -27,14 +27,15 @@
and so does not work on Windows). Renamed to gnupg.py to avoid confusion with
the previous versions.
-Modifications Copyright (C) 2008-2011 Vinay Sajip. All rights reserved.
+Modifications Copyright (C) 2008-2012 Vinay Sajip. All rights reserved.
A unittest harness (test_gnupg.py) has also been added.
"""
import locale
+__version__ = "0.2.9"
__author__ = "Vinay Sajip"
-__date__ = "$02-Sep-2011 13:18:12$"
+__date__ = "$29-Mar-2012 21:12:58$"
try:
from io import StringIO
@@ -143,7 +144,8 @@ def __nonzero__(self):
def handle_status(self, key, value):
if key in ("TRUST_UNDEFINED", "TRUST_NEVER", "TRUST_MARGINAL",
"TRUST_FULLY", "TRUST_ULTIMATE", "RSA_OR_IDEA", "NODATA",
- "IMPORT_RES", "PLAINTEXT", "PLAINTEXT_LENGTH"):
+ "IMPORT_RES", "PLAINTEXT", "PLAINTEXT_LENGTH",
+ "POLICY_URL", "DECRYPTION_INFO", "DECRYPTION_OKAY"):
pass
elif key == "BADSIG":
self.valid = False
@@ -171,6 +173,10 @@ def handle_status(self, key, value):
cls,
self.timestamp) = value.split()[:5]
self.status = 'signature error'
+ elif key == "DECRYPTION_FAILED":
+ self.valid = False
+ self.key_id = value
+ self.status = 'decryption failed'
elif key == "NO_PUBKEY":
self.valid = False
self.key_id = value
@@ -341,7 +347,8 @@ def __str__(self):
def handle_status(self, key, value):
if key in ("ENC_TO", "USERID_HINT", "GOODMDC", "END_DECRYPTION",
- "BEGIN_SIGNING", "NO_SECKEY", "ERROR", "NODATA"):
+ "BEGIN_SIGNING", "NO_SECKEY", "ERROR", "NODATA",
+ "CARDCTRL"):
# in the case of ERROR, this is because a more specific error
# message will have come first
pass
@@ -435,7 +442,7 @@ def __str__(self):
def handle_status(self, key, value):
if key in ("USERID_HINT", "NEED_PASSPHRASE", "BAD_PASSPHRASE",
- "GOOD_PASSPHRASE", "BEGIN_SIGNING"):
+ "GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL"):
pass
elif key == "SIG_CREATED":
(self.type,
View
BIN  random_binary_data
Binary file not shown
View
22 setup.py
@@ -1,20 +1,22 @@
from distutils.core import setup
+from gnupg import __version__ as version
+
setup(name = "python-gnupg",
description="A wrapper for the Gnu Privacy Guard (GPG or GnuPG)",
long_description = "This module allows easy access to GnuPG's key \
management, encryption and signature functionality from Python programs. \
It is intended for use with Python 2.4 or greater.",
- license="""Copyright (C) 2008-2011 by Vinay Sajip. All Rights Reserved. See LICENSE for license.""",
- version = "0.2.8",
- author = "Vinay Sajip",
- author_email = "vinay_sajip@red-dove.com",
- maintainer = "Vinay Sajip",
- maintainer_email = "vinay_sajip@red-dove.com",
- url = "http://www.red-dove.com/python_gnupg.html",
- py_modules = ["gnupg"],
- platforms = "No particular restrictions",
- classifiers = [
+ license="""Copyright (C) 2008-2012 by Vinay Sajip. All Rights Reserved. See LICENSE for license.""",
+ version=version,
+ author="Vinay Sajip",
+ author_email="vinay_sajip@red-dove.com",
+ maintainer="Vinay Sajip",
+ maintainer_email="vinay_sajip@red-dove.com",
+ url="http://www.red-dove.com/python_gnupg.html",
+ py_modules=["gnupg"],
+ platforms="No particular restrictions",
+ classifiers=[
'Development Status :: 5 - Production/Stable',
"Intended Audience :: Developers",
'License :: OSI Approved :: BSD License',
View
6 test_gnupg.py
@@ -2,7 +2,7 @@
"""
A test harness for gnupg.py.
-Copyright (C) 2008-2011 Vinay Sajip. All rights reserved.
+Copyright (C) 2008-2012 Vinay Sajip. All rights reserved.
"""
import doctest
import logging
@@ -253,6 +253,10 @@ def test_signature_verification(self):
logger.debug("ver: %r", verified.fingerprint)
self.assertEqual(key.fingerprint, verified.fingerprint,
"Fingerprints must match")
+ if not os.path.exists('random_binary_data'):
+ data_file = open('random_binary_data', 'wb')
+ data_file.write(os.urandom(5120 * 1024))
+ data_file.close()
data_file = open('random_binary_data', 'rb')
sig = self.gpg.sign_file(data_file, keyid=key.fingerprint,
passphrase='aable')
Please sign in to comment.
Something went wrong with that request. Please try again.