#NEWLINE# def __init__( self , paths = [ ] ) : #NEWLINE# #INDENT# self . order = [ 'backend' , 'repomanager' , 'metadata' , 'validator' , 'transformer' , 'instrumentation' , 'representation' ] #NEWLINE# self . plugins = { #NEWLINE# #INDENT# 'backend' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'instrumentation' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'repomanager' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'metadata' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'validator' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'transformer' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'representation' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . sources = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# thisdir = os . path . abspath ( os . path . dirname ( __file__ ) ) #NEWLINE# def get_path( p ) : #NEWLINE# #INDENT# return os . path . abspath ( os . path . join ( thisdir , '../contrib' , p ) ) #NEWLINE# #UNINDENT# allplugins = [ { #NEWLINE# #INDENT# 'package' : 'backend' , #NEWLINE# 'base' : get_path ( 'backends' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'instrumentation' , #NEWLINE# 'base' : get_path ( 'instrumentations' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'repomanager' , #NEWLINE# 'base' : get_path ( 'repomanagers' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'metadata' , #NEWLINE# 'base' : get_path ( 'metadata' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'validator' , #NEWLINE# 'base' : get_path ( 'validators' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'transformer' , #NEWLINE# 'base' : get_path ( 'transformers' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'package' : 'representation' , #NEWLINE# 'base' : get_path ( 'representations' ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# for p in allplugins : #NEWLINE# #INDENT# plugin_base = PluginBase ( package = p [ 'package' ] , searchpath = [ thisdir [ 'base' ] ] ) #NEWLINE# source = plugin_base . make_plugin_source ( searchpath = [ ] , identifier = 'Plugin Manager' ) #NEWLINE# for plugin_name in source . list_plugins ( ) : #NEWLINE# #INDENT# plugin = source . load_plugin ( plugin_name ) #NEWLINE# plugin . setup ( self ) #NEWLINE# #UNINDENT# self . sources [ p [ 'package' ] ] = source #NEWLINE# #UNINDENT# self . discover_all_plugins ( )