Skip to content

Python guidelines

Thomas Milox edited this page Apr 28, 2017 · 24 revisions

How write a python class to create a plugin for AVA

Alright, here we are :) If you are reading these lines that means you choose to develop your plugin for AVA in Python... Great choice!

You'll see there are only 4 rules to create your plugin... "What only 4? this guy has to be kidding me"

  • Python version:

We are using Python3, only!

  • Plugin conception:

You plugin must be conceived as a Python class ! This class must have as attribute a dictionnary binding the commands to catch and the methods of your class to execute, and the get_commands method which returns this dictionnary.

  • The dictionnary

Ok take again our git plugin as example


   class git(object):
    "Git plugin"

    def __init__(self):
        self.commands = {
            'log': self.log,
            'version': self.version,
        }

Clone this wiki locally