
    Xf	                     n   d Z ddlZddlmZmZ ddlmZmZmZm	Z	  ej                  e      Zdej                  j                  deej                  j                     deej                   j"                     ded	e	j&                  d
eej                   j(                     dej                   j"                  fdZy)z|All core generic plugins.

These modules should only be imported from volatility3.plugins NOT
volatility3.framework.plugins
    N)ListType)
interfaces	automagic
exceptions	constantscontext
automagicspluginbase_config_pathprogress_callbackopen_methodreturnc           	      2   t        j                  || |||      }t        j                  j	                  ||j
                        }|j                  | |      }|r|D ]  }	|	j                         D 
cg c]  }
|
 c}
d   }t        j                  d|dd         t        j                  t        j                  dj                  |	j                  d                    t        j                   |       || ||      }|r|j#                  |       |S c c}
w )a~  Constructs a plugin object based on the parameters.

    Clever magic figures out how to fulfill each requirement that might not be fulfilled

    Args:
        context: The volatility context to operate on
        automagics: A list of automagic modules to run to augment the context
        plugin: The plugin to run
        base_config_path: The path within the context's config containing the plugin's configuration
        progress_callback: Callback function to provide feedback for ongoing processes
        open_method: class to provide context manager for opening the file

    Returns:
        The constructed plugin object
    )r   zAutomagic exception occurred: N T)chain)r   runr   configuration	path_join__name__unsatisfiedformat_exception_onlyvollogwarninglogr   
LOGLEVEL_Vjoinformatr   UnsatisfiedExceptionset_open_method)r	   r
   r   r   r   r   errorsplugin_config_pathr   errorxerror_stringconstructeds                X/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/__init__.pyconstruct_pluginr)      s   . ]]+F $11;;&//
 $$W.@AK 	PE','B'B'DE!AEbILNN;L"<M;NOPJJy++RWWU\\\5M-NO	P --k::#7HK ##K0 Fs   0	D)__doc__loggingtypingr   r   volatility3.frameworkr   r   r   r   	getLoggerr   r   r	   ContextInterfaceAutomagicInterfacepluginsPluginInterfacestrProgressCallbackFileHandlerInterfacer)        r(   <module>r8      s      N N			8	$1001Z))<<=1 ##3341 	1
 !111 j((==>1 ''1r7   