@ -21,161 +21,161 @@ if 'DATA_TRANSPORT_REGISTRY_PATH' in os.environ :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    REGISTRY_PATH  =  os . environ [ ' DATA_TRANSPORT_REGISTRY_PATH ' ] 
 
					 
					 
					 
					    REGISTRY_PATH  =  os . environ [ ' DATA_TRANSPORT_REGISTRY_PATH ' ] 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					REGISTRY_FILE =  ' transport-registry.json ' 
 
					 
					 
					 
					REGISTRY_FILE =  ' transport-registry.json ' 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					DATA  =  { } 
 
					 
					 
					 
					DATA  =  { } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					class  plugins  :
 
					 
					 
					 
					# class plugins  :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     #
 
					 
					 
					 
					#       #
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     # This is a utility function that should enable management of plugins-registry
 
					 
					 
					 
					#       # This is a utility function that should enable management of plugins-registry
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     # The class allows to add/remove elements 
 
					 
					 
					 
					#       # The class allows to add/remove elements 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     #
 
					 
					 
					 
					#       #
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     # @TODO: add read/write properties to the class (better design practice)
 
					 
					 
					 
					#       # @TODO: add read/write properties to the class (better design practice)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     #
 
					 
					 
					 
					#       #
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     _data   =   { }
 
					 
					 
					 
					#       _data = {}
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     FOLDER   =   os . sep . join ( [ REGISTRY_PATH , ' plugins ' ] )
 
					 
					 
					 
					#       FOLDER = os.sep.join([REGISTRY_PATH,'plugins'])
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    CODE  =  os . sep . join ( [ REGISTRY_PATH , ' plugins ' , ' code ' ]  )
 
					 
					 
					 
					#     CODE = os.sep.join([REGISTRY_PATH,'plugins','code']  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     FILE   =   os . sep . join ( [ REGISTRY_PATH , ' plugin-registry.json ' ] )
 
					 
					 
					 
					#       FILE = os.sep.join([REGISTRY_PATH,'plugin-registry.json'])
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    def  init ( )  :
 
					 
					 
					 
					#     def init()  :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   not   os . path . exists ( plugins . FOLDER )   :
 
					 
					 
					 
					#           if not os.path.exists(plugins.FOLDER) :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             os . makedirs ( plugins . FOLDER )
 
					 
					 
					 
					#               os.makedirs(plugins.FOLDER)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   not   os . path . exists ( plugins . CODE ) :
 
					 
					 
					 
					#           if not os.path.exists(plugins.CODE):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             os . makedirs ( plugins . CODE )
 
					 
					 
					 
					#               os.makedirs(plugins.CODE)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   not   os . path . exists ( plugins . FILE ) :
 
					 
					 
					 
					#           if not os.path.exists(plugins.FILE):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            f  =  open ( plugins . FILE , ' w '  )
 
					 
					 
					 
					#             f = open(plugins.FILE,'w'  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             f . write ( " {} " )
 
					 
					 
					 
					#               f.write("{}")
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             f . close ( )
 
					 
					 
					 
					#               f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         plugins . _read ( )   #-- will load data as a side effect
 
					 
					 
					 
					#           plugins._read() #-- will load data as a side effect
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   copy   ( path )   :
 
					 
					 
					 
					#       def copy (path) :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        shutil . copy2 ( path , plugins . CODE  )
 
					 
					 
					 
					#         shutil.copy2(path,plugins.CODE  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    def  _read  ( )  :
 
					 
					 
					 
					#     def _read ()  :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         f   =   open ( plugins . FILE )
 
					 
					 
					 
					#           f = open(plugins.FILE)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         try :
 
					 
					 
					 
					#           try:
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            _data  =  json . loads ( f . read ( )  )
 
					 
					 
					 
					#             _data = json.loads(f.read()  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             f . close ( )
 
					 
					 
					 
					#               f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        except  Exception  as  e  :
 
					 
					 
					 
					#         except Exception as e  :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            print  ( f " Corrupted registry, resetting ... "  )
 
					 
					 
					 
					#             print (f"Corrupted registry, resetting ..."  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             _data   =   { }
 
					 
					 
					 
					#               _data = {}
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            plugins . _write ( _data  )
 
					 
					 
					 
					#             plugins._write(_data  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        plugins . _data  =   _data
 
					 
					 
					 
					#         plugins._data =   _data
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   _write   ( _data ) :
 
					 
					 
					 
					#       def _write (_data):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        f  =  open ( plugins . FILE , ' w '  )
 
					 
					 
					 
					#         f = open(plugins.FILE,'w'  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         f . write ( json . dumps ( _data ) )
 
					 
					 
					 
					#           f.write(json.dumps(_data))
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         f . close ( )
 
					 
					 
					 
					#           f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        plugins . _data  =   _data
 
					 
					 
					 
					#         plugins._data =   _data
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   inspect   ( _path ) :
 
					 
					 
					 
					#       def inspect (_path):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         _names   =   [ ]
 
					 
					 
					 
					#           _names = []
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   os . path . exists ( _path )   :
 
					 
					 
					 
					#           if os.path.exists(_path) :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             _filename   =   _path . split ( os . sep ) [ - 1 ]
 
					 
					 
					 
					#               _filename = _path.split(os.sep)[-1]
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            spec  =  importlib . util . spec_from_file_location ( _filename ,  _path  )
 
					 
					 
					 
					#             spec = importlib.util.spec_from_file_location(_filename, _path  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             module   =   importlib . util . module_from_spec ( spec )
 
					 
					 
					 
					#               module = importlib.util.module_from_spec(spec)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             spec . loader . exec_module ( module )
 
					 
					 
					 
					#               spec.loader.exec_module(module)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             # _names = [{'name':getattr(getattr(module,_name),'name'),'pointer':getattr(module,_name)} for _name in dir(module) if type( getattr(module,_name)).__name__ == 'function']
 
					 
					 
					 
					#               # _names = [{'name':getattr(getattr(module,_name),'name'),'pointer':getattr(module,_name)} for _name in dir(module) if type( getattr(module,_name)).__name__ == 'function']
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             for   _name   in   dir ( module )   :
 
					 
					 
					 
					#               for _name in dir(module) :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 _pointer   =   getattr ( module , _name )  
 
					 
					 
					 
					#                   _pointer = getattr(module,_name) 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 if   hasattr ( _pointer , ' transport ' )   :
 
					 
					 
					 
					#                   if hasattr(_pointer,'transport') :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    _item  =  { ' real_name ' : _name , ' name ' : getattr ( _pointer , ' name ' ) , ' pointer ' : _pointer , ' version ' : getattr ( _pointer , ' version ' )  }
 
					 
					 
					 
					#                     _item = {'real_name':_name,'name':getattr(_pointer,'name'),'pointer':_pointer,'version':getattr(_pointer,'version')  }
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    _names . append ( _item  )
 
					 
					 
					 
					#                     _names.append(_item  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        return   _names
 
					 
					 
					 
					#         return   _names
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   add   ( alias , path ) :
 
					 
					 
					 
					#       def add (alias,path):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         """
 
					 
					 
					 
					#           """
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         Add   overwrite   the   registry   entries
 
					 
					 
					 
					#           Add overwrite the registry entries
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         """
 
					 
					 
					 
					#           """
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         _names   =   plugins . inspect   ( path )
 
					 
					 
					 
					#           _names = plugins.inspect (path)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         _log   =   [ ]
 
					 
					 
					 
					#           _log = []
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   _names   :
 
					 
					 
					 
					#           if _names :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             #
 
					 
					 
					 
					#               #
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             # We should make sure we have all the plugins with the attributes (transport,name) set
 
					 
					 
					 
					#               # We should make sure we have all the plugins with the attributes (transport,name) set
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            _names  =  [ _item  for  _item  in  _names  if  hasattr ( _item [ ' pointer ' ] , ' transport ' )   ]
 
					 
					 
					 
					#             _names = [_item for _item in _names if hasattr(_item['pointer'],'transport')   ]
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             if   _names   :
 
					 
					 
					 
					#               if _names :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                plugins . copy ( path  )
 
					 
					 
					 
					#                 plugins.copy(path  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 _content   =   [ ]
 
					 
					 
					 
					#                   _content = []
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 for   _item   in   _names   :
 
					 
					 
					 
					#                   for _item in _names :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    _key  =  ' @ ' . join ( [ alias , _item [ ' name ' ] ]  )
 
					 
					 
					 
					#                     _key = '@'.join([alias,_item['name']]  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    _log . append ( _item [ ' name ' ]  )
 
					 
					 
					 
					#                     _log.append(_item['name']  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 #
 
					 
					 
					 
					#                   #
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 # Let us update the registry 
 
					 
					 
					 
					#                   # Let us update the registry 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 # 
 
					 
					 
					 
					#                   # 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                 plugins . update ( alias , path , _log )         
 
					 
					 
					 
					#                   plugins.update(alias,path,_log)        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        return   _log
 
					 
					 
					 
					#         return   _log
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    
 
					 
					 
					 
					    
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    def  update  ( alias , path , _log )   :
 
					 
					 
					 
					#     def update (alias,path,_log)   :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         """
 
					 
					 
					 
					#           """
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        updating  the  registry  entries  of  the  plugins  ( management  data  )
 
					 
					 
					 
					#         updating the registry entries of the plugins (management data  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         """
 
					 
					 
					 
					#           """
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # f = open(plugins.FILE)
 
					 
					 
					 
					#           # f = open(plugins.FILE)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # _data = json.loads(f.read())
 
					 
					 
					 
					#           # _data = json.loads(f.read())
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # f.close()
 
					 
					 
					 
					#           # f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        _data  =  plugins .  _data
 
					 
					 
					 
					#         _data = plugins.  _data
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # _log = plugins.add(alias,path)
 
					 
					 
					 
					#           # _log = plugins.add(alias,path)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   _log   :
 
					 
					 
					 
					#           if _log :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            _data [ alias ]  =  { ' content ' : _log , ' name ' : path . split ( os . sep ) [ - 1 ]  }
 
					 
					 
					 
					#             _data[alias] = {'content':_log,'name':path.split(os.sep)[-1]  }
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             plugins . _write ( _data )   #-- will update data as a side effect
 
					 
					 
					 
					#               plugins._write(_data) #-- will update data as a side effect
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        return   _log
 
					 
					 
					 
					#         return   _log
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   get ( * * _args )   :
 
					 
					 
					 
					#       def get(**_args) :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # f = open(plugins.FILE)
 
					 
					 
					 
					#           # f = open(plugins.FILE)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # _data = json.loads(f.read())
 
					 
					 
					 
					#           # _data = json.loads(f.read())
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # f.close()
 
					 
					 
					 
					#           # f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # if 'key' in _args :
 
					 
					 
					 
					#           # if 'key' in _args :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     alias,name = _args['key'].split('.') if '.' in _args['key'] else _args['key'].split('@')
 
					 
					 
					 
					#           #     alias,name = _args['key'].split('.') if '.' in _args['key'] else _args['key'].split('@')
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # else :
 
					 
					 
					 
					#           # else :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     alias = _args['alias']
 
					 
					 
					 
					#           #     alias = _args['alias']
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     name  = _args['name']
 
					 
					 
					 
					#           #     name  = _args['name']
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # if alias in _data :
 
					 
					 
					 
					#           # if alias in _data :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     _path = os.sep.join([plugins.CODE,_data[alias]['name']])
 
					 
					 
					 
					#           #     _path = os.sep.join([plugins.CODE,_data[alias]['name']])
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     _item = [_item for _item in plugins.inspect(_path) if name == _item['name']]
 
					 
					 
					 
					#           #     _item = [_item for _item in plugins.inspect(_path) if name == _item['name']]
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     _item = _item[0] if _item else None
 
					 
					 
					 
					#           #     _item = _item[0] if _item else None
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #     if _item :
 
					 
					 
					 
					#           #     if _item :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         #         return _item['pointer'] 
 
					 
					 
					 
					#           #         return _item['pointer'] 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         # return None
 
					 
					 
					 
					#           # return None
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        _item  =  plugins . has ( * * _args  )
 
					 
					 
					 
					#         _item = plugins.has(**_args  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         return   _item [ ' pointer ' ]   if   _item   else   None
 
					 
					 
					 
					#           return _item['pointer'] if _item else None
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    
 
					 
					 
					 
					    
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     def   has   ( * * _args ) :
 
					 
					 
					 
					#       def has (**_args):
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         f   =   open ( plugins . FILE )
 
					 
					 
					 
					#           f = open(plugins.FILE)
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         _data   =   json . loads ( f . read ( ) )
 
					 
					 
					 
					#           _data = json.loads(f.read())
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         f . close ( )
 
					 
					 
					 
					#           f.close()
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   ' key '   in   _args   :
 
					 
					 
					 
					#           if 'key' in _args :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            alias , name  =  _args [ ' key ' ] . split ( ' . ' )  if  ' . '  in  _args [ ' key ' ]  else  _args [ ' key ' ] . split ( ' @ '  )
 
					 
					 
					 
					#             alias,name = _args['key'].split('.') if '.' in _args['key'] else _args['key'].split('@'  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         else   :
 
					 
					 
					 
					#           else :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             alias   =   _args [ ' alias ' ]
 
					 
					 
					 
					#               alias = _args['alias']
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             name    =   _args [ ' name ' ]
 
					 
					 
					 
					#               name  = _args['name']
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        
 
					 
					 
					 
					        
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         if   alias   in   _data   :
 
					 
					 
					 
					#           if alias in _data :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            _path  =  os . sep . join ( [ plugins . CODE , _data [ alias ] [ ' name ' ] ]  )
 
					 
					 
					 
					#             _path = os.sep.join([plugins.CODE,_data[alias]['name']]  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            _item  =  [ _item  for  _item  in  plugins . inspect ( _path )  if  name  ==  _item [ ' name ' ]  ]
 
					 
					 
					 
					#             _item = [_item for _item in plugins.inspect(_path) if name == _item['name']  ]
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            
 
					 
					 
					 
					            
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             _item   =   _item [ 0 ]   if   _item   else   None
 
					 
					 
					 
					#               _item = _item[0] if _item else None
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					             if   _item   :
 
					 
					 
					 
					#               if _item :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                return  copy . copy ( _item  )
 
					 
					 
					 
					#                 return copy.copy(_item  )
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        return   None
 
					 
					 
					 
					#         return   None
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					     @staticmethod
 
					 
					 
					 
					#       @staticmethod
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					    def  synch ( )  :
 
					 
					 
					 
					#     def synch()  :
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					         pass
 
					 
					 
					 
					#           pass
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					def  isloaded  ( ) : 
 
					 
					 
					 
					def  isloaded  ( ) : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    return  DATA  not  in  [ { } , None ] 
 
					 
					 
					 
					    return  DATA  not  in  [ { } , None ]