src package

Submodules

src.COM module

class src.COM.COM(port='/dev/ttySC0', baudrate=115200, parity='N', stopbits=1)[source]

Bases: object

close()[source]
receive()[source]
receiveByte()[source]
sendByte(data)[source]
sendString(data)[source]

src.check-loop module

src.main module

src.main.main() None[source]

The main function as an entry point.

Todo

  • Rewrite the actual logics.

Module contents

src.get_logger(file_prefix: str = '', file_postfix: str = '', level: Union[str, int] = 'DEBUG') <loguru.logger handlers=[(id=1, level=10, sink='logs/{time:YYYYMMDD}.log'), (id=2, level=10, sink=<lambda>)]>[source]

Create a logger with default configurations.

Parameters:
  • file_prefix (str, optional) – Default is “”.

  • file_postfix (str, optional) – Default is “”.

  • level (Union[str, int], optional) – Default is “DEBUG”.

Returns:

With configurations.

Return type:

logger

src.is_prod() bool[source]

Determine whether or not the app is running in development or production.

Returns:

True if the environment is production and false otherwise.

Return type:

bool

src.logger_timing(*, entering=True, leaving=True, timeit=True, level='DEBUG')[source]

Wrapper for additional output about timing.

Parameters:
  • entering (bool) – Whether or not to output the entry time.

  • leaving (bool) – Whether or not to output the leaving time.

  • timeit (bool) – Whether or not to output the processing time.

  • level (str) – Level of additional output.

Returns:

A Decorator.

Return type:

wrapper

src.print_env_vars() None[source]

Print all environment variables to stdout.