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: if len(data) == 0:
break break
sent += len(data) 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: try:
outstream.write(data) outstream.write(data)
except UnicodeError: except UnicodeError:
try: try:
outstream.write(data.encode(enc)) outstream.write(data.encode(enc))
except IOError: except IOError:
logger.exception('_copy_data(): Error sending data: Broken pipe') logger.exception(
'_copy_data(): Error sending data: Broken pipe')
break break
except IOError: except IOError:
# Can get 'broken pipe' errors even when all data was sent # 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) except IndexError as ie: logger.debug(ie.message)
if binary is None: if binary is None:
try: binary = _which('gpg')[0] try: binary = _which('gpg')[0]
except IndexError: raise RuntimeError("gpg is not installed") except IndexError: raise RuntimeError("GnuPG is not installed!")
try: try:
assert os.path.isabs(binary), "Path to gpg binary not absolute" assert os.path.isabs(binary), "Path to gpg binary not absolute"
assert not os.path.islink(binary), "Path to gpg binary is symlink" assert not os.path.islink(binary), "Path to gpg binary is symlink"