Skip to content

Commit

Permalink
stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed May 15, 2017
1 parent e726867 commit 07e92bc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/keas/kmi/README.txt
Expand Up @@ -93,7 +93,7 @@ We can also encrypt data given by a file descriptor

>>> import tempfile
>>> tmp_file = tempfile.TemporaryFile()
>>> data=b"encryptioniscool"*24*1024
>>> data = b"encryptioniscool"*24*1024
>>> pos = tmp_file.write(data)
>>> pos = tmp_file.seek(0)
>>> encrypted_file = tempfile.TemporaryFile()
Expand All @@ -103,7 +103,7 @@ We can also encrypt data given by a file descriptor
And decrypt the file

>>> decrypted_file = tempfile.TemporaryFile()
>>> pos =encrypted_file.seek(0)
>>> pos = encrypted_file.seek(0)
>>> keys.decrypt_file(key, encrypted_file, decrypted_file)
>>> encrypted_file.close()

Expand Down
1 change: 0 additions & 1 deletion src/keas/kmi/facility.py
Expand Up @@ -37,7 +37,6 @@

from hashlib import md5

__docformat__ = "reStructuredText"

logger = logging.getLogger('kmi')

Expand Down
3 changes: 0 additions & 3 deletions src/keas/kmi/interfaces.py
Expand Up @@ -18,9 +18,6 @@
from zope.interface.common import mapping


__docformat__ = "reStructuredText"


class IEncryptionService(zope.interface.Interface):
"""Utility providing encryption mechanism"""

Expand Down
1 change: 0 additions & 1 deletion src/keas/kmi/keyholder.py
Expand Up @@ -13,7 +13,6 @@
##############################################################################
"""Simple Key Holder
"""
__docformat__ = "reStructuredText"
from zope.interface import implementer
from keas.kmi.interfaces import IKeyHolder

Expand Down
9 changes: 5 additions & 4 deletions src/keas/kmi/testclient.py
@@ -1,4 +1,3 @@
from __future__ import print_function
##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
Expand All @@ -14,7 +13,7 @@
##############################################################################
"""Test client to access the KMI server API.
"""
__docformat__ = "reStructuredText"
from __future__ import print_function

import os
import sys
Expand Down Expand Up @@ -45,7 +44,8 @@ def new_key(kmf):

def read_kek(kekfile):
try:
return open(kekfile, 'rb').read()
with open(kekfile, 'rb') as fp:
return fp.read()
except IOError as e:
print("Could not read key encrypting key from %s" % kekfile, file=sys.stderr)
print(e, file=sys.stderr)
Expand All @@ -57,7 +57,8 @@ def read_data(filename=None):
return sys.stdin.read()
else:
try:
return open(filename, 'rb').read()
with open(filename, 'rb') as fp:
return fp.read()
except IOError as e:
print("Could not read %s" % filename, file=sys.stderr)
print(e, file=sys.stderr)
Expand Down

0 comments on commit 07e92bc

Please sign in to comment.