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.

AYABInterface.utils.number_of_colors(rows)[source]

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.

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

the next line closest to last_line

AYABInterface.utils.camel_case_to_under_score(camel_case_name)[source]

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