+
    d‚•ió  ã                   óx   € ] tR .t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 Rt]]J d   ]M]t ! R R 4      tR# )ÚPluginManagerN)ÚPluginÚ c                   óV   a € ] tR t^"t o RtR tR t]R 4       tR t	R t
R
R ltR	tV tR# )r   z}Find and load plugins.

Plugins are stored in files named '*_plugin.py' in the list of directories
given to the constructor.
c                ó²   € Wn         \        V\        4      '       d$   \        R P	                  \        V4      4      4      h\        V4      V n        RV n        R# )zExpected sequence, got {}N)	Ú_appÚ
isinstanceÚ	STR_TYPESÚ	TypeErrorÚformatÚtypeÚlistÚ_plugin_dirsÚ_plugins)ÚselfÚappÚplugin_dirss   &&&Ú</usr/lib/python3/dist-packages/janitor/plugincore/manager.pyÚ__init__ÚPluginManager.__init__)   sL   € ØŒ	ô �k¤9×-Ò-ÜØ+×2Ñ2´4¸Ó3DÓEóð ô ! Ó-ˆÔØˆŽó    c           	   #  óR  "  € V P                    F®  p \        P                  ! V4       Uu. uF  pVP                  R4      '       g   K  VNK   	  pp\        P                  ! RP                  T\        P                  T4      4      4       \        T4       F$  p\        P                  P                  Y4      x € K&  	  K°  	  R# u upi   \         dR   pTP
                  \
        P                  8w  d   h \        P                  ! RP                  T4      4        Rp?EK  Rp?ii ; i5i)z4Return all filenames in which plugins may be stored.z
_plugin.pyzNo such plugin directory: {}NzPlugin modules in {}: {})r   ÚosÚlistdirÚendswithÚOSErrorÚerrnoÚENOENTÚloggingÚdebugr   ÚSPACEÚjoinÚsortedÚpath)r   ÚdirnameÚfilenameÚ	basenamesÚerrors   &    r   Úget_plugin_filesÚPluginManager.get_plugin_files4   sé   é € ð ×(Ô(ˆGð
ô %'§J¢J¨wÔ$7óá$7˜Ø×(Ñ(¨×6÷ �HÙ$7ð ð ô �MŠMØ*×1Ñ1ØœUŸZ™Z¨	Ó2óôô # 9Ö-�Ü—g‘g—l‘l 7Ó5Ô5ó .ó% )ùòøô
 ô Ø—;‘;¤%§,¡,Ô.ØÜ—’Ð<×CÑCÀGÓLÔMÞûð	üsG   ‚D'“C«CÁ	CÁCÁA2D'ÃCÃD$ÃADÄD'ÄD$Ä$D'c              #  óD   "  € V P                  4        F  pVx € K	  	  R # 5i©N)r(   )r   r%   s   & r   Úplugin_filesÚPluginManager.plugin_filesL   s   é € à×-Ñ-Ö/ˆHØŒNó 0ùs   ‚ c           	   #  ó  "  € R p\         P                  ! W4       UUu. uF  w  r4VNK	  	  ppp\        P                  ! RP	                  V\
        P                  R V 4       4      4      4       V F  pV! 4       x € K  	  R# u uppi 5i)z-Find and instantiate all plugins in a module.c                 ó~   € \         P                  ! V 4      ;'       d!    \        V \        4      ;'       d	    V \        J# r+   )ÚinspectÚisclassÚ
issubclassr   )Útargets   &r   Ú	is_pluginÚ.PluginManager._find_plugins.<locals>.is_pluginT   s;   € ô —’ Ó'÷ )ð )Ü˜v¤vÓ.÷)ð )à¤&Ð(ðr   zPlugins in {}: {}c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir+   )Ústr)Ú.0Úplugins   & r   Ú	<genexpr>Ú.PluginManager._find_plugins.<locals>.<genexpr>a   s   é € Ð"L¹^°6¤3 v§; ;»^ùs   ‚N)r0   Ú
getmembersr   r   r   r    r!   )r   Úmoduler4   ÚnameÚmemberÚplugin_classesÚplugin_classs   &&     r   Ú_find_pluginsÚPluginManager._find_pluginsQ   s   é € ò	ô (/×'9Ò'9¸&Ô'Lô
Ù'L‘|�t‹FÑ'Lð 	ñ 
ô 	�ŠØ×&Ñ&ØœŸ
™
Ñ"L¹^Ó"LÓLóô	
ó
 +ˆLÙ“.Ô ó +ùó
ùs   ‚B	ŸB¬AB	c           
     ój  € \         P                  ! RP                  V4      4       \        P                  P                  \        P                  P                  V4      4      w  r#V\        P                  9   d   \        P                  V,          # \        VR4      ;_uu_ 4       p \        P                  ! W$VRR\        P                  34      pVuuRRR4       #   \         d9   p\         P                  ! RP                  Y&4      4        Rp?RRR4       R# Rp?ii ; i  + '       g   i     R# ; i)zLoad a module from a filename.zLoading module from file {}Úrz.pyNzFailed to load plugin '{}' ({}))r   r   r   r   r#   ÚsplitextÚbasenameÚsysÚmodulesÚopenÚimpÚload_moduleÚ	PY_SOURCEÚ	ExceptionÚwarning)r   r%   Úmodule_nameÚignoreÚfpr=   r'   s   &&     r   Ú_load_moduleÚPluginManager._load_moduleg   sæ   € ä�ŠÐ3×:Ñ:¸8ÓDÔEô& !Ÿg™g×.Ñ.¬r¯w©w×/?Ñ/?ÀÓ/IÓJÑˆØœ#Ÿ+™+Ô%Ü—;‘;˜{Õ+Ð+Ü�(˜C× Ô  BðÜŸšØ X°°s¼C¿M¹MÐ/Jó�ð ÷ !Ò øô
 ô Ü—’Ø5×<Ñ<Ø#óôó
 ÷ !Ñ ûð
ú÷ !× Ð ús6   Â$D!Â&)CÃD!ÃDÃ&%DÄD!ÄDÄD!Ä!D2	Nc                óZ  € Vf   . pV P                   f¨   . V n         \        V P                  4      p\        V4      p\	        V4       Fq  w  rVVe
   V! WeV4       V P                  V4      pV P                  V4       F9  pVP                  V P                  4       V P                   P                  V4       K;  	  Ks  	  V P                    Uu. uF/  pVP                  V8X  g   WP                  9   g
   VR8X  g   K-  VNK1  	  p	p\        P                  ! RP                  W4      4       V	# u upi )aý  Return all plugins that have been found.

Loaded plugins are cached, so they will only be loaded once.

`condition` is matched against each plugin to determine whether it
will be returned or not.  A `condition` of the string '*' matches all
plugins.  The default condition matches all default plugins, since by
default, plugins have a condition of the empty list.

If `condition` matches the plugin's condition exactly, the plugin is
returned.  The plugin's condition can also be a sequence, and if
`condition` is in that sequence, the plugin is returned.

Note that even though loaded plugins are cached, calling
`get_plugin()` with different a `condition` can return a different set
of plugins.

If `callback` is specified, it is called after each plugin has
been found, with the following arguments: filename, index of
filename in list of files to be examined (starting with 0), and
total number of files to be examined. The purpose of this is to
allow the callback to inform the user in case things take a long
time.
Ú*z#plugins for condition '{}' are '{}')r   r   r,   ÚlenÚ	enumeraterS   rB   Úset_applicationr   ÚappendÚ	conditionr   r   r   )
r   r[   ÚcallbackÚ	filenamesÚtotalÚir%   r=   r9   Úpluginss
   &&&       r   Úget_pluginsÚPluginManager.get_pluginsŽ   s  € ð6 ÒØˆIð �=‰=Ò ØˆDŒMÜ˜T×.Ñ.Ó/ˆIÜ˜	“NˆEÜ(¨Ö3‘�ØÒ'Ù˜X¨%Ô0Ø×*Ñ*¨8Ó4�Ø"×0Ñ0°Ö8�FØ×*Ñ*¨4¯9©9Ô5Ø—M‘M×(Ñ(¨Ö0ó 9ñ	  4ð Ÿ-š-ó
á'�à× Ñ  IÔ-Ø× 0Ñ 0Ô0Ø Ñ#÷ ˆFÙ'ð 	ð 
ô 	�ŠØ1×8Ñ8¸ÓLô	
ð ˆùò
s   Ã
*D(Ã9D()r   r   r   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r(   Úpropertyr,   rB   rS   ra   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   "   s=   ø‡ € ñò	ò6ð0 ñó ðò!ò,%÷N:ò :r   )r   Ú__metaclass__Ú__all__r   rK   rH   r   r0   r   Újanitor.plugincore.pluginr   r    r7   Úbytesr	   r   © r   r   Ú<module>rq      sK   ðð  €ØÐ
€ó 
Û 
Û 
Û Û Û å ,ð 	€Ø˜%“<‰C S€	÷fó fr   