python: Fix reading data from existing files.
authorJustus Winter <justus@gnupg.org>
Wed, 25 May 2016 10:47:28 +0000 (12:47 +0200)
committerJustus Winter <justus@gnupg.org>
Fri, 27 May 2016 10:18:29 +0000 (12:18 +0200)
commitbf188e280b8b4fc775f33c47e2e1e275ed044004
tree1054c20ee41658ffaa89d84d7baf1e49e00c9d89
parentce73ae9d0cbf782cd3a1949fc4f568f0d1da60d9
python: Fix reading data from existing files.

* lang/python/pyme/core.py (Data.__init__): Add 'copy' kwargument, and
pass it to functions supporting it.  PEP8 fix.
(Data.new_from_fd): PEP8 fix.
(Data.new_from_file): Give a more helpful error message if copy is
False.  PEP8 fix.
(Data.new_from_fd): Hand the file descriptor to
'gpgme_data_new_from_fd', not a stream.  Fix docstring.
* lang/python/tests/t-data.py: Add tests for this.

Signed-off-by: Justus Winter <justus@gnupg.org>
lang/python/pyme/core.py
lang/python/tests/t-data.py