[git] GPGME - branch, master, updated. gpgme-1.11.1-120-g7962cde
by Ben McGinnes
cvs at cvs.gnupg.org
Sat Aug 18 07:08:17 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, master has been updated
via 7962cde13c5cbdc643bbde795e2c29e638dfc186 (commit)
from 279cac0ffbb3d865d997dc7fc9c1b53bbb55d3a2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7962cde13c5cbdc643bbde795e2c29e638dfc186
Author: Ben McGinnes <ben at adversary.org>
Date: Sat Aug 18 15:05:34 2018 +1000
Python bindings src: PEP8 compliance
* import namespace clearance for src/*.py.
* Fixed a handful of is/is not None checks as well.
diff --git a/lang/python/src/__init__.py b/lang/python/src/__init__.py
index 82c1cce..30e638c 100644
--- a/lang/python/src/__init__.py
+++ b/lang/python/src/__init__.py
@@ -95,7 +95,6 @@ GPGME documentation: https://www.gnupg.org/documentation/manuals/gpgme/
"""
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
from . import core
from . import errors
@@ -106,6 +105,8 @@ from . import version
from .core import Context
from .core import Data
+del absolute_import, print_function, unicode_literals
+
# Interface hygiene.
# Drop the low-level gpgme that creeps in for some reason.
diff --git a/lang/python/src/callbacks.py b/lang/python/src/callbacks.py
index e8a9c43..9aacf56 100644
--- a/lang/python/src/callbacks.py
+++ b/lang/python/src/callbacks.py
@@ -16,17 +16,18 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
from getpass import getpass
+del absolute_import, print_function, unicode_literals
+
def passphrase_stdin(hint, desc, prev_bad, hook=None):
"""This is a sample callback that will read a passphrase from
the terminal. The hook here, if present, will be used to describe
why the passphrase is needed."""
why = ''
- if hook != None:
+ if hook is not None:
why = ' ' + hook
if prev_bad:
why += ' (again)'
@@ -35,7 +36,7 @@ def passphrase_stdin(hint, desc, prev_bad, hook=None):
def progress_stdout(what, type, current, total, hook=None):
- print("PROGRESS UPDATE: what = %s, type = %d, current = %d, total = %d" %\
+ print("PROGRESS UPDATE: what = %s, type = %d, current = %d, total = %d" %
(what, type, current, total))
diff --git a/lang/python/src/core.py b/lang/python/src/core.py
index 7858468..d471131 100644
--- a/lang/python/src/core.py
+++ b/lang/python/src/core.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
import re
import os
@@ -14,6 +13,8 @@ from . import constants
from . import errors
from . import util
+del absolute_import, print_function, unicode_literals
+
# Copyright (C) 2016-2018 g10 Code GmbH
# Copyright (C) 2004, 2008 Igor Belyi <belyi at users.sourceforge.net>
# Copyright (C) 2002 John Goerzen <jgoerzen at complete.org>
diff --git a/lang/python/src/errors.py b/lang/python/src/errors.py
index 45157c5..9c7f037 100644
--- a/lang/python/src/errors.py
+++ b/lang/python/src/errors.py
@@ -17,11 +17,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
from . import gpgme
from . import util
+del absolute_import, print_function, unicode_literals
+
# To appease static analysis tools, we define some constants here.
# They are overwritten with the proper values by process_constants.
NO_ERROR = None
@@ -64,33 +65,33 @@ class GpgError(Exception):
@property
def code(self):
- if self.error == None:
+ if self.error is None:
return None
return gpgme.gpgme_err_code(self.error)
@property
def code_str(self):
- if self.error == None:
+ if self.error is None:
return None
return gpgme.gpgme_strerror(self.error)
@property
def source(self):
- if self.error == None:
+ if self.error is None:
return None
return gpgme.gpgme_err_source(self.error)
@property
def source_str(self):
- if self.error == None:
+ if self.error is None:
return None
return gpgme.gpgme_strsource(self.error)
def __str__(self):
msgs = []
- if self.context != None:
+ if self.context is not None:
msgs.append(self.context)
- if self.error != None:
+ if self.error is not None:
msgs.append(self.source_str)
msgs.append(self.code_str)
return ': '.join(msgs)
diff --git a/lang/python/src/util.py b/lang/python/src/util.py
index 77d1421..320a823 100644
--- a/lang/python/src/util.py
+++ b/lang/python/src/util.py
@@ -17,10 +17,11 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
import sys
+del absolute_import, print_function, unicode_literals
+
def process_constants(prefix, scope):
"""Called by the constant modules to load up the constants from the C
-----------------------------------------------------------------------
Summary of changes:
lang/python/src/__init__.py | 3 ++-
lang/python/src/callbacks.py | 7 ++++---
lang/python/src/core.py | 3 ++-
lang/python/src/errors.py | 15 ++++++++-------
lang/python/src/util.py | 3 ++-
5 files changed, 18 insertions(+), 13 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list