Displaying 5 results from an estimated 5 matches for "preadinto".
Did you mean:
readinto
2019 Nov 24
1
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...this case we have to do:
> >
> > buf[:] = r.read()
> >
> > Since we work on v2 now, I think we should consider this change.
>
> Right, we can consider this for v2, while leaving v1 callers alone.
>
> > An uglier alternative is:
> >
> > def preadinto(h, buf, offset):
> >
> > Matching python read() and readinto() interface.
>
> Is this different somehow from def pread(h, buf, offset) defined above?
>
We keep nicer pread for compatibility and add preadinto for people that
care about performence. This is the current approach...
2019 Nov 23
2
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...ef pread(h, buf, offset):
So the python side we can do:
f.readinto(buf)
Or:
sock.recv_info(buf)
It does not work for HTTPResponse, so in this case we have to do:
buf[:] = r.read()
Since we work on v2 now, I think we should consider this change.
An uglier alternative is:
def preadinto(h, buf, offset):
Matching python read() and readinto() interface.
> > test-python-plugin.py
> >
> > This text can use python docstring:
> >
> > """
> > This tests ...
> > """
>
> Good point, I'll fix this. We could...
2019 Nov 24
0
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...> It does not work for HTTPResponse, so in this case we have to do:
>
> buf[:] = r.read()
>
> Since we work on v2 now, I think we should consider this change.
Right, we can consider this for v2, while leaving v1 callers alone.
> An uglier alternative is:
>
> def preadinto(h, buf, offset):
>
> Matching python read() and readinto() interface.
Is this different somehow from def pread(h, buf, offset) defined above?
Rich.
> > > test-python-plugin.py
> > >
> > > This text can use python docstring:
> > >
> > > "&q...
2019 Nov 25
6
[nbdkit PATCH 0/5] Counterproposal for python v2 interfaces
As mentioned in my reviews, I wonder if we should make our python
callbacks look a bit more Pythonic by having kwargs added for each
new flag that we want to expose. The idea was first floated here:
https://www.redhat.com/archives/libguestfs/2018-April/msg00108.html
Note that with my proposal, there is no need for a python script to
expose a global API_VERSION variable; new flags are added
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
On Fri, Nov 22, 2019 at 9:55 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>
> This tests the Python plugin thoroughly by issuing client commands
> through libnbd and checking we get the expected results.
> ---
> tests/Makefile.am | 13 +--
> tests/test-python-plugin.py | 134 ++++++++++++++++++++++++++++
> tests/test-python.py | 172