PEP-8ify a couple lines that were running off the screen.

* Also, change a logger string to say 'GnuPG' instead of the binary's name
   'gpg'.
testing/mmn/mktime_takes_localtime_not_gmtime
Isis Lovecruft 2013-05-11 18:34:28 +00:00
parent e3eb7eea0c
commit 25637ef50e
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 5 additions and 3 deletions

View File

@ -95,14 +95,16 @@ def _copy_data(instream, outstream):
if len(data) == 0:
break
sent += len(data)
logger.debug("_copy_data(): sending chunk (%d):\n%s" % (sent, data[:256]))
logger.debug("_copy_data(): sending chunk (%d):\n%s"
% (sent, data[:256]))
try:
outstream.write(data)
except UnicodeError:
try:
outstream.write(data.encode(enc))
except IOError:
logger.exception('_copy_data(): Error sending data: Broken pipe')
logger.exception(
'_copy_data(): Error sending data: Broken pipe')
break
except IOError:
# Can get 'broken pipe' errors even when all data was sent
@ -161,7 +163,7 @@ def _find_binary(binary=None):
except IndexError as ie: logger.debug(ie.message)
if binary is None:
try: binary = _which('gpg')[0]
except IndexError: raise RuntimeError("gpg is not installed")
except IndexError: raise RuntimeError("GnuPG is not installed!")
try:
assert os.path.isabs(binary), "Path to gpg binary not absolute"
assert not os.path.islink(binary), "Path to gpg binary is symlink"