mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
py: added asym en/decryption, fine tuned test script
This commit is contained in:
@@ -2,12 +2,12 @@ from pypcp.dll import *
|
||||
|
||||
|
||||
class Stream(object):
|
||||
def __init__(self, string=None, file=None):
|
||||
if file:
|
||||
fd = open(file, 'r')
|
||||
def __init__(self, backend=None):
|
||||
if type(backend) is file:
|
||||
fd = open(backend, 'r')
|
||||
self._stream = libpcp.ps_new_file(fd)
|
||||
elif string:
|
||||
buf = libpcp.buffer_new_buf('inbuf', string, len(string))
|
||||
elif type(backend) is str:
|
||||
buf = libpcp.buffer_new_buf('inbuf', backend, len(backend))
|
||||
self._stream = libpcp.ps_new_inbuffer(buf)
|
||||
else:
|
||||
self._stream = libpcp.ps_new_outbuffer()
|
||||
|
||||
Reference in New Issue
Block a user