python SDK issues in call for next/prev

Christie Pandoras Box Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Pandoras Boa you are using. If your question is related to hardware, please state if you are using coolux hardware (which one) or if you built your own.

python SDK issues in call for next/prev

Postby florian » Sat Mar 11, 2017 6:23 pm

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.

:)
-flo

"Wise men learn more from fools than fools from the wise."

Cato the Elder, Plutarch's Life of Cato
User avatar
florian
 
Posts: 154
Joined: Fri Jul 25, 2008 3:49 pm
Location: New York, NY

Re: python SDK issues in call for next/prev

Postby Dennis Kuypers » Sun Mar 12, 2017 2:04 am

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
Dennis Kuypers
Product Developer, Software

Online Manual
User avatar
Dennis Kuypers
coolux Germany
 
Posts: 704
Joined: Thu Jul 05, 2012 12:18 pm

Re: python SDK issues in call for next/prev

Postby florian » Sun Mar 12, 2017 3:33 am

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.
-flo

"Wise men learn more from fools than fools from the wise."

Cato the Elder, Plutarch's Life of Cato
User avatar
florian
 
Posts: 154
Joined: Fri Jul 25, 2008 3:49 pm
Location: New York, NY

Re: python SDK issues in call for next/prev

Postby Dennis Kuypers » Mon Mar 13, 2017 4:57 pm

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
Dennis Kuypers
Product Developer, Software

Online Manual
User avatar
Dennis Kuypers
coolux Germany
 
Posts: 704
Joined: Thu Jul 05, 2012 12:18 pm


Return to Pandoras Box V6

Who is online

Users browsing this forum: No registered users and 1 guest

cron