[SoC] Report 4 - QGIS Symbology Sharing Tools

Akbar Gumbira akbargumbira at gmail.com
Sun Jun 19 03:51:49 PDT 2016


Hi All,

I want to share the progress of QGIS Symbology Sharing Tool for the GSoC
project. This tool will allow you to share collections (symbol, svgs, etc)
in a repository, fetch it, and use it in QGIS.


What did you get done this week?
This week I worked on:

*Handler Classes*
Handler class is responsible to interact with the repository (fetch the
metadata and download the collections). I made some classes for this:

   - BaseHandler: it's a base class that we can inherit from if we want to
   make another repository handler. It's an abstract class (OK, I don't use
   Python's abc but let's agree that it's an abstract class :)) (
   https://github.com/akbargumbira/qgis_symbology_sharing/blob/master/symbology_sharing/handler/base.py
   ).
   - RemoteGitHandler: It's a base class to deal with remote git handler.
   It's not a concrete class but it's disabled. I create this class so that we
   can easily make handler classes inherit from this (
   https://github.com/akbargumbira/qgis_symbology_sharing/blob/master/symbology_sharing/handler/remote_git_handler.py
   )
   - Github Handler and Bitbucket Handler. It's a concrete class (see here
   https://github.com/akbargumbira/qgis_symbology_sharing/blob/master/symbology_sharing/handler/bitbucket_handler.py).
   It only works for public repositories for now.

So if we want to implement handler for another git remote repository, we
can inherit from RemoteGitHandler and define some methods like in
GithubHandler class.

It wouldn't be hard too to add another handler like FIleSystem Handler
(inheriting from BaseHandler). The handler classes are autoregistered as
long as you inherit it from BaseHandler. If can_handle(url) method is
implemented correctly, the tool will pick the right handler depending on
the URL.

This is the screencast I made to see how handlers work:
https://youtu.be/DxE_PONFsjY

*Parsing Metadata*
After adding a repository, it will fetch the metadata and register
avaialable collections from that metadata (it will only register, not
download).

*Separation between Repository Manager and Collection Manager*
Repository manager is a class responsible for managing repository and
calling the collection manager. Collection manager is responsible for
registering/unregistering collections. Main class only needs to deal with
repository manager.


*What do you plan on doing next week?*
Next week I want to work on:

   - Right now every time users add/edit/delete repo, it will fetch all the
   repositories registered after these actions. I am going to save the
   collections in QSettings when user closes QGIS, and when user
   add/edit/delete repository, it will only update collections belong to that
   repo in the collections registry.
   - Make tests
   - Show the detail of the collections when user clicks a collection.
   - Filter the collections based on the QGIS version
   - Start thinking about upgrading collections mechanism (perhaps we
   should add the version of the collection in the metadata)
   - Start implementing download collection for github and bitbucket
   handler.

If you have some thoughts for me, please email me.

*Are you blocked on anything?*
No.


-- 

*-------------------*
*Akbar Gumbira *
*www.akbargumbira.com <http://www.akbargumbira.com>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/soc/attachments/20160619/699f936b/attachment-0001.html>


More information about the SoC mailing list