My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
ProcessingTemplate  
A basic processing template
Phase-Implementation
Updated Oct 6, 2014 by Robby@Zeitfuchs.org

All processing-plugins are and should be placed inside the folder at /processing/.

Every plugin should also have a dedicated section in the file config/processing.conf: for this example if you create a module module/reporting/mymodul.py you will have to append the following section to config/processing.conf:

[mymodul]
enabled = yes
test = 1234

Every additional option you add to your section will be available to your processing plugin in the self.options dictionary.

A basic processing plugin could look like:

 import logging
 from core.abstracts import Processing
 

try: from yapsy.IPlugin import IPlugin except ImportError: raise ImportError, 'Yapsy is required'

log = logging.getLogger("ProcessingMyModule")

class MyModule(IPlugin, Processing): def run(self, cls_file): self.key = "MyKey" self.score = -1 test = self.options.get("test", None)

data = do_something() return data

Every processing module should contain:

  • A run() function.
  • A self.key attribute defining the name to be used as a subcontainer for the returned data.
  • A self.score attribute what the risk level determines (The value "-1" disabled this function)
  • A set of data (list, dictionary or string etc.) that will be appended to the global container.

Powered by Google Project Hosting