python: Import from __future__ to align behavior of Python 2.7.

--
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-09-14 11:39:00 +02:00
parent 3b37c4efcf
commit dc23fdf555
59 changed files with 177 additions and 0 deletions

View File

@ -17,6 +17,9 @@
"""Demonstrate the use of the Assuan protocol engine"""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
with pyme.Context(protocol=pyme.constants.PROTOCOL_ASSUAN) as c:

View File

@ -24,6 +24,9 @@ be used like this:
"""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import pyme
pyme.Context().decrypt(sys.stdin, sink=sys.stdout)

View File

@ -19,6 +19,9 @@
# Sample of key deletion
# It deletes keys for joe@example.org generated by genkey.py script
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
with pyme.Context() as c:

View File

@ -22,6 +22,9 @@ This program will try to encrypt a simple message to each key on your
keyring. If your keyring has any invalid keys on it, those keys will
be skipped and it will re-try the encryption."""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
import pyme

View File

@ -19,6 +19,9 @@
# Sample of export and import of keys
# It uses keys for joe+pyme@example.org generated by genkey.py script
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
import pyme

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
# This is the example from the GPGME manual.

View File

@ -18,6 +18,9 @@
"""Simple interactive editor to test editor scripts"""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import pyme
import pyme.constants.status

View File

@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import pyme
from pyme.constants.sig import mode

View File

@ -19,6 +19,9 @@
# Sample of unattended signing/verifying of a message.
# It uses keys for joe+pyme@example.org generated by genkey.py script
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
import pyme

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
import pyme

View File

@ -18,6 +18,9 @@
"""A test applicaton for the CMS protocol."""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import pyme

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
from pyme import core

View File

@ -17,6 +17,9 @@
# License along with this library; if not, write to the Free Software
# 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, re
if len(sys.argv) != 2:

View File

@ -99,6 +99,9 @@ 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
from . import constants

View File

@ -15,6 +15,9 @@
# License along with this library; if not, write to the Free Software
# 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
def passphrase_stdin(hint, desc, prev_bad, hook=None):

View File

@ -1,4 +1,7 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from pyme import util
util.process_constants('GPGME_', globals())

View File

@ -1,3 +1,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from . import encoding
__all__ = ['encoding']

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_DATA_ENCODING_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_EVENT_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_IMPORT_', globals())

View File

@ -1,3 +1,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from . import mode
__all__ = ['mode']

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_KEYLIST_MODE_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_MD_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_PK_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_PROTOCOL_', globals())

View File

@ -1,3 +1,6 @@
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from . import mode
__all__ = ['mode']

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_SIG_MODE_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_SIGSUM_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_STATUS_', globals())

View File

@ -15,5 +15,8 @@
# License along with this library; if not, write to the Free Software
# 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 pyme import util
util.process_constants('GPGME_VALIDITY_', globals())

View File

@ -24,6 +24,9 @@ and the 'Data' class describing buffers of data.
"""
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import re
import os
import weakref

View File

@ -15,6 +15,9 @@
# License along with this library; if not, write to the Free Software
# 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

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
"""Robust result objects
Results returned by the underlying library are fragile, i.e. they are

View File

@ -16,6 +16,9 @@
# License along with this library; if not, write to the Free Software
# 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
def process_constants(prefix, scope):

View File

@ -16,6 +16,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from __future__ import absolute_import, print_function
del absolute_import, print_function
from . import gpgme
productname = 'pyme'

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
import subprocess

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
import subprocess
import pyme

View File

@ -15,6 +15,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
from pyme import core

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import io
import os
import tempfile

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
from pyme import core, constants, errors
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
from pyme import core, constants
import support

View File

@ -18,6 +18,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
from pyme import core, constants

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import random
from pyme import core, constants

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import pyme
from pyme import core, constants

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
import pyme
from pyme import core, constants

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import io
import os

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
with pyme.Context(protocol=pyme.constants.PROTOCOL_ASSUAN) as c:

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import os
import pyme
from pyme import core, constants

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import pyme
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
from pyme import core, constants
import support

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import sys
import os
import pyme

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
del absolute_import, print_function, unicode_literals
import time
from pyme import core, constants, errors
import support