Package tipy :: Module minr :: Class MinerRegistry
[hide private]
[frames] | no frames]

Class MinerRegistry

source code

object --+    
         |    
      list --+
             |
            MinerRegistry

List every "miner" classes to be used.

MinerRegistry gather every miners to be used according to the configuration file. It provide methods to mine corpuses from different sources, using different processing strategies and store the results in different outputs.

Class Hierarchy for MinerRegistry
Class Hierarchy for MinerRegistry

Instance Methods [hide private]
new empty list
__init__(self, config)
Constructor of the MinerRegistry class.
source code
 
set_miners(self)
Add miner class(es) to the list according to the configuration.
source code
 
add_miner(self, minerName)
Try to add a miner class to the list using its name.
source code
 
mine(self)
Use the miner instances list to mine the sources.
source code
 
close_databases(self)
Close database of every miner instances using a database.
source code

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, config)
(Constructor)

source code 

Constructor of the MinerRegistry class.

Parameters:
  • config (drvr.Configuration) - The configuration file. It is used to retrieve the miners classes names that will be added to the MinerRegistry.
Returns: new empty list
Overrides: object.__init__

set_miners(self)

source code 

Add miner class(es) to the list according to the configuration.

Retrieve the miners classes names from the configuration and try to add them to the list.

add_miner(self, minerName)

source code 

Try to add a miner class to the list using its name.

Get the miner class name from the configuration and create an instance of this class if it exists, then, add the instance to the list.

Parameters:
  • minerName (str) - The name of the miner. It must correspond to a section of the configuration so that its miner class can be retrieved.

mine(self)

source code 

Use the miner instances list to mine the sources.

Loop through every miner instances of the list and call their mine() method to perform their mining operation.