The source code of wat-bridge
is not very intuitive, so here is a list of
what each file is in charge of:
watbridge.py
: program launcher, connects signals with handlers and initializes configurationhelper.py
: generally, functions that interact with the TinyDB database (in case database changes in the future)listeners.py
: the main loops for the WhatsApp and Telegram botssignals.py
: signal handlers for terminating the program and message relaying between WhatsApp and Telegramstatic.py
: settings and static stuff used accross all modulestg.py
: Telegram bot implementation using pyTelegramBotAPIwa.py
: WhatsApp bot implementation using Yowsup
Usually, each component is well isolated, which allows for easier modifications and maintenance.
I tend to use Google style docstrings where appropriate as shown here: http://www.sphinx-doc.org/es/stable/ext/napoleon.html, as I find these are easy to read at a glance when viewing the source code.