utils Module

Utility methods.

AYABInterface.utils.sum_all(iterable, start)[source]

Sum up an iterable starting with a start value.

In contrast to sum(), this also works on other types like lists and sets.


Determine the numer of colors in the rows.

Return type:int
AYABInterface.utils.next_line(last_line, next_line_8bit)[source]

Compute the next line based on the last line and a 8bit next line.

The behaviour of the function is specified in The reqLine Message.

  • last_line (int) – the last line that was processed
  • next_line_8bit (int) – the lower 8 bits of the next line

the next line closest to last_line


Return the underscore name of a camel case name.

Parameters:camel_case_name (str) – a name in camel case such as "ACamelCaseName"
Returns:the name using underscores, e.g. "a_camel_case_name"
Return type:str