Skip to content
ederag edited this page Feb 19, 2020 · 1 revision

Code-Layout

Currently, the repositories /src-tree contains at least the following components

Storage-Backend

  • storage/storage.py provides some basic controller like functionality. It is a semi-abstract class. Any concrete class should define the private methods such as __get_facts.

  • storage/db.py contains a concrete storage, with hand-build SQL queries to take care of storing our data

  • however, there is also a good chunk of (almost non documented) logic hidden in between (prime example: __solve_overlaps. There are plans to move that out.)

  • Both rely on hamster.lib.fact.Fact().

dbus-service

  • hamster-service.py / hamster/client.py
  • hamster-service.py provides the 'dbus-server'
  • entire API is almost undocumented, little feedback/error reporting
  • assumes PKs to be Int > 0
  • client.py has some doc-strings

CLI

  • Mainly a cli-interface using the dbus-service client to issue its request to backend functionality.
  • contains some doc-strings illuminating the API a bit.

GUI

  • Initially hard to follow. Parts or it are spread around most of the source-tree. Yet the orthogonality is quite good. There are plans to improve some areas though.
  • "Main entry/start-point is not even clear, it almost seems that individual windows just inherit from Controler to create a ad-hoc session."
    Indeed, that was the old way of doing these things. The dialogs in configuration.py should be removed soon, since now we use GtkApplication to ensure the unicity of dialogs.

Procedures

Waf update

# replace `~/share/prog` with the place where you want the waf repository
cd ~/share/prog
git clone https://gitlab.com/ita1024/waf.git
./waf-light configure build
# in the hamster root directory
rm waf
rm -rf wafadmin
~/share/prog/waf/waf-light --make-waf

Strip the waf footer; as debian chokes on it. From https://wiki.debian.org/UnpackWaf:

sed -i '/^#==>$/,$d' waf