Skip to content

Overview of each file

krishnangovindraj edited this page Jun 19, 2014 · 3 revisions

CallbackDBI.py

A class to interact easily with the database. Used by callback functions such as on receiving a message / receiving acks. If the database connection is busy, The script is forced to wait till the connection is free. On timeout, queries are added to the queue.

Config.py

Constants and Configuration: A lot of static variables so that no values are hardcoded in the script

Core.py

A class which handles the Yowsup Listener and Sender classes as well as running the instance. All communication between the requestHandler and Yowsup goes through the core. Handles disconnects, Starting the instance and Stopping it.

Listener.py

Serves as an interface with Yowsup's listener thread. Has the callbacks for when messages are received. Stores incoming messages in the DB

Readme.md

A very poorly written readme

RequestHandler.py

A class to handle HTTP requests received by the WSGI server. A new instance is created for each request.

Sender.py

Class to send messages, Store them in the DB, Keep track of their delivery status and retry failed/timedout messages.

Session.py

Handles the whatsapp session (not the HTTP session). Contains methods for logging in and callbacks for changes in authentication status.

Skin.py

TODO:

A non-exhaustive list of things to do

WWMException.py

A custom class i defined because i didn't know how python handled Exceptions. Too obscure, Remove this as soon as possible.

adduser.py

Run through Commandline to register a user. Format

py adduser.py -n [NAME] -e [EMAIL] -f [PHONE] -p [PASS] -w [WHATSAPP_PASSWORD]

dbinterface.py

A Database interface to use for planned execution ( One that happens on request and MUST be completed for the script to execute ). Uses a 'BlockingDBICursor' to prevent two threads stemming from 2 requests. A thread will be forced to wait till the current query is finished before it can execute it's query. You should only use this through the "with DBICursor(correspondingDBIInstance) as dbiCursor:" technique Timedout requests (should) raise an exception

webwhatsapp.sql

The database schema used. Badly needs it's indexing to be reviewed ( MySQL, Create a database named webwhatsapp and import )

wsgi.py

Starts up the http server that serves as the interface. As of now, This is the only script you have to start through commandline or so. Everything else can be done through the web interface. I'd like to find a way to run it without having to login through SSH