Page 1 of 1

python SDK issues in call for next/prev

PostPosted: Sat Mar 11, 2017 6:23 pm
by florian
hi,

In pbauto.py v1.2.13077: it looks like functions with next/last functionality are making spurious calls to a non-existant function ByteUtil.write_byte().

replacing this with .write_bool() and supplying True/False booleans for next/last seems to be a clean fix.

i suppose duplicating the write_bool() def in ByteUtil and naming the copy write_byte would work too, but it seems dirty.

I was going to update it on git but got confused about where post the fix. So I'm putting it here instead.

:)

Re: python SDK issues in call for next/prev

PostPosted: Sun Mar 12, 2017 2:04 am
by Dennis Kuypers
Hello Flo,

lacking types, python doesn't force you to use this handy enum:

Code: Select all
class NextOrPrev:
    Next = 1
    Prev = 0


Any suggestions on how to make the usage clear?

Regards
Dennis

Re: python SDK issues in call for next/prev

PostPosted: Sun Mar 12, 2017 3:33 am
by florian
The issue is that write_byte doesn't exist.

If you want to add it and then use the enum to encourage more readable code, I understand that. To me 1/0 for True/False are basically the same.

What would improve the clarity of the function is if instead it took a signed int for how many steps to go back or forward:
Ie: -1 is back one, 1 is next one, 3 jumps three cues ahead, etc.

But that probably requires a rewrite of the server side.

Re: python SDK issues in call for next/prev

PostPosted: Mon Mar 13, 2017 4:57 pm
by Dennis Kuypers
Hello,

florian wrote:The issue is that write_byte doesn't exist.

I misread, sorry. It should be fixed now.

florian wrote:What would improve the clarity of the function is if instead it took a signed int for how many steps to go back or forward:
Ie: -1 is back one, 1 is next one, 3 jumps three cues ahead, etc.

But that probably requires a rewrite of the server side.

Yes, that would require a change in code on PB side.

https://github.com/PandorasBoxSDK/pbaut ... a491ce27e7

Dennis