Menu

Modules

Martin S. Lindner

GPS Modules

MicrobeGPS can be easily extended by modules that can provide additional functionality to the core program. Modules are simple Python scripts with a fixed structure, that are executed upon program start. The neat thing of modules is that you can easily add functionality to MicrobeGPS without touching (or even breaking) the core application. And the modules can also be used to extend the binary distributions!

How to create your own module

Simply place a python script (text file with ending .py) in the microbegps/modules directory. MicrobeGPS will automatically import all python files in this location. The python script is expected to have a class called GPSModule with an __init__ function that takes the whole MicrobeGPS instance as argument. Otherwise the module will not be loaded.

The most simple module would look like that and does nothing:

class GPSModule:
    def __init__(self,GPS):
        pass

You can now access all elements of MicrobeGPS via the GPS variable. In principle, you would be able to change every little detail of the tool, including the analysis pipeline. Since you are interacting with the core of MicrobeGPS, you should take some minutes and read up the lines of code in the gui.py file you intend to interact with.

A good starting point would be to have a look at the existing modules, where the search tab implementation (search_tab.py) is the most comprehesible one.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.