← Back to team overview

gtg-gsoc team mailing list archive

Invernizzi - GSoC code review

 

Hello there,
I'm  going to  briefly explain  the  architecture brought  up so  far about  the
multi-backends feature. Bryce, you're in Cc: since  I know that you read code as
bedtime stories..

My code is in lp:~gtg-user/gtg/multi-backends__invernizzi_gsoc/

First of all, backends exist in  two forms: backend instances (configured by the
user, the stuff  we have in projects.xml) and types  (which define the structure
of the backend). It's the same difference  that stands between "int" and "int i"
in C, so to speak.

Backends instances are dealt with in the datastore, as before. Backends type are
managed in  the new class BackendsTypeManager,  inside GTG/backends/__init__.py.
BackendsTypeManager is capable of listing the available backends type, construct
an new backend  and restore a backend  from and xml object. This  will also take
care (in the future) of checking if all the required modules are available.


A     prototype     for     all      backends,     GenericBackend,     is     in
GTG/backends/genericbackend.py. That  means that  all the  backends should  be a
derived class  of that. GenericBackend  describes the interface  backends should
have, how  to define a  backend general description (name,  description, icon..)
and how to describe the backend parameters and its default values. It will be in
charge of  handling all the common  things among backends, which  at the moment,
are  just the  "attached tags"  (tags for  which the  backends is  in charge  of
storing and loading tasks).

The Datastore  is now aware  that backends have attached  tags, and it  has been
refactored a bit (TaskSource too).

Having created the BackendsTypeManager, I've  also refactored the loading of the
backends in GTG/core/__init__.py (at the end).  Now, it should be clearer what's
happening. I had to change the format of  projects.xml (I had to add a series of
things -attached tags  ...), but I took  care that the code works  also with the
old format, and changes it on first loading.


Still alive? Good. This  is the briefest I could get. Tell me  if you didn't get
something or you found a weak side of this approach.

Ciao!
   Luca

ps: vim justifies text! Awesome..



Attachment: signature.asc
Description: Digital signature


Follow ups