+
    üÐj  ã                   óR   € R t ^ RIt^ RIHt ^ RIHtHtHt ^ RIH	t	  ! R R4      t
R# )z\
Facilities for helping test code which interacts with Python's module system
to load code.
N)Ú
ModuleType)ÚIterableÚListÚTuple)ÚFilePathc                   ó^   a € ] tR t^t o RtV 3R lR ltV 3R lR ltR
V 3R lR lltRtV t	R	# )ÚTwistedModulesMixinz}
A mixin for C{twisted.trial.unittest.SynchronousTestCase} providing useful
methods for manipulating Python's module system.
c                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )é   ÚsysPathÚreturnN)r   Ústr)ÚformatÚ__classdict__s   "€ÚE/usr/lib/python3/dist-packages/twisted/python/test/modules_helpers.pyÚ__annotate__Ú TwistedModulesMixin.__annotate__   s   ø€ ÷ 
ñ 
¡d©3¥ið 
°Dñ 
ó    c                ó�   a€ \         P                  R,          oR V3R llpV P                  V4       V\         P                  R&   R# )zG
Replace sys.path, for the duration of the test, with the given value.
ºNNNc                ó   € V ^8„  d   QhRR/# ©r
   r   N© )r   s   "r   r   Ú8TwistedModulesMixin.replaceSysPath.<locals>.__annotate__   s   € ÷ 	*ñ 	* ñ 	*r   c                  ó.   <€ S \         P                  R &   R# )r   N)ÚsysÚpath)ÚoriginalSysPaths   €r   ÚcleanUpSysPathÚ:TwistedModulesMixin.replaceSysPath.<locals>.cleanUpSysPath   s   ø€ Ø)ŒC�H‰H�Q‹Kr   N)r   r   Ú
addCleanup)Úselfr   r   r   s   && @r   ÚreplaceSysPathÚ"TwistedModulesMixin.replaceSysPath   s7   ø€ ô Ÿ(™( 1�+ˆ÷	*ð 	*ð 	�‰˜Ô'ØŒ�‰�‹r   c                óJ   <€ V ^8„  d   QhRS[ S[S[S[3,          ,          RR/# )r
   Ú
sysModulesr   N)r   r   r   r   )r   r   s   "€r   r   r   "   s*   ø€ ÷ 'ñ '©H±U¹3Á
¸?Õ5KÕ,Lð 'ÐQUñ 'r   c                óò   a€ \         P                  P                  4       oR V3R llpV P                  V4       \         P                  P	                  4        \         P                  P                  V4       R# )zJ
Replace sys.modules, for the duration of the test, with the given value.
c                ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   Ú;TwistedModulesMixin.replaceSysModules.<locals>.__annotate__(   s   € ÷ 	3ñ 	3 4ñ 	3r   c                  ó‚   <€ \         P                  P                  4        \         P                  P                  S 4       R # )N)r   ÚmodulesÚclearÚupdate)ÚoriginalSysModuless   €r   ÚcleanUpSysModulesÚ@TwistedModulesMixin.replaceSysModules.<locals>.cleanUpSysModules(   s&   ø€ Ü�K‰K×ÑÔÜ�K‰K×ÑÐ1Ö2r   N)r   r*   Úcopyr    r+   r,   )r!   r%   r.   r-   s   && @r   ÚreplaceSysModulesÚ%TwistedModulesMixin.replaceSysModules"   sS   ø€ ô !Ÿ[™[×-Ñ-Ó/Ð÷	3ð 	3ð 	�‰Ð)Ô*Ü�‰×ÑÔÜ�‰×Ñ˜:Ö&r   c                ó6   <€ V ^8„  d   QhRS[ RS[S[ ,          /# )r
   Úpkgnamer   )r   r   )r   r   s   "€r   r   r   0   s    ø€ ÷ 	ñ 	©sð 	ÉÑQTÍñ 	r   c                óº   € \        V P                  4       4      pVP                  R4      pVP                  4        VP                  R4      P	                  R4       V# )zq
Generate a L{FilePath} with one package, named C{pkgname}, on it, and
return the L{FilePath} of the path entry.
Útest_packagez__init__.pyr   )r   ÚmktempÚchildÚmakedirsÚ
setContent)r!   r4   ÚentryÚpkgs   &&  r   ÚpathEntryWithOnePackageÚ+TwistedModulesMixin.pathEntryWithOnePackage0   sG   € ô
 ˜Ÿ™›Ó'ˆØ�k‰k˜.Ó)ˆØ�‰ŒØ�	‰	�-Ó ×+Ñ+¨CÔ0Øˆr   r   N)r6   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r"   r1   r=   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s-   ø‡ € ñ÷

ð 
÷'ð '÷	÷ 	ð 	r   r   )rC   r   Útypesr   Útypingr   r   r   Útwisted.python.filepathr   r   r   r   r   Ú<module>rI      s%   ðñó
 Ý ß (Ñ (å ,÷)ó )r   