text: #!/usr/bin/env python
  """
    Copyright 2012-2013 The MASTIFF Project, All Rights Reserved.
  
    This software, having been partly or wholly developed and/or
    sponsored by KoreLogic, Inc., is hereby released under the terms
    and conditions set forth in the project's "README.LICENSE" file.
    For a list of all contributors and sponsors, please refer to the
    project's "README.CREDITS" file.
  """
  
  __doc__ = """
  Output plugin skeleton code
  
  Purpose:
    This file provides the skeleton code for a plugin that formats the data 
    generated by the analysis plug-ins. This is an example that shows all 
    functions defined.
    
    __init__(): MANDATORY: Any initialization code the plugin requires. It must
              also call the __init__ for masOutput.MastiffOutputPlugin.
  
  activate(): OPTIONAL: Activation code called by Yapsy to activate the plugin.
  
  deactivate(): OPTIONAL: Deactivated code called by Yapsy.
  
  output(config, output): MANDATORY: Function that formats the data from analysis
                          plug-ins into a specific format. Receives the MASTIFF configuration
                          as the config parameter, and the pages of data in the data 
                          parameter.
  """
  
  __version__ = "$Id: 960d687e79158fbba349a472f85ff2b75d8c9bb1 $"
  
  import logging
  import mastiff.plugins.output as masOutput
  
  class OUTPUTSkeleton(masOutput.MastiffOutputPlugin):
      """Raw output plugin.."""
  
      def __init__(self):
          """Initialize the plugin."""
          masOutput.MastiffOutputPlugin.__init__(self)
  
      def activate(self):
          """Activate the plugin."""
          masOutput.MastiffOutputPlugin.activate(self)
  
      def deactivate(self):
          """Deactivate the plugin."""
          masOutput.MastiffOutputPlugin.deactivate(self)
  
      def output(self, config, data):
          log = logging.getLogger('Mastiff.Plugins.Output.' + self.name)
          
          # see if we are enabled
          if config.get_bvar(self.name, 'enabled') is False:
              log.debug('Disabled. Exiting.')
              return True
  
          log.info('Writing FORMAT output.')
          
          # loop through category data
          for cats, catdata in data[data.keys()[0]].iteritems():
              catstr = '{} Category Analysis Results'.format(cats)
              log.debug('Writing {} results.'.format(cats))
  
          # loop through plugin data and generate the output text
          for plugin, pages in catdata.iteritems():
              # process the page data into the specific format and 
              # output it to the appropriate file/files
              
              # loop through each table in the page
              for tabledata in sorted(pages, key=lambda page: pages[2]):
                  (title, mytable, index) = tabledata
                  
                  # process table data here
                  for row in mytable:
                      # act on row data 
                      # (REMOVE THE NEXT LINE)
                      pass
  
              
          
          return True
  