+
    üÐj1  ã                   óÐ  a € R t*0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t
 ^ RIHt ^ RIHtHt ^ RIHt / t] ^ k ]P&                  tR tR tR t]P                  ! ]P0                  ]4       R	 tR
 t]P                  ! ]P6                  ]4       R tR t]P                  ! ]P<                  ]4       R tR t R t!R t" ! R R4      t#/ s$] ^k / s%R t&R t'R t( ! R R4      t)R# )z(
Different styles of persisted objects.
N)ÚStringIO)ÚDict)ÚlogÚreflect)Ú_PYPYc                óh   € \         V P                  V P                  V P                  P                  33# )z3support function for copy_reg to pickle method refs)ÚunpickleMethodÚ__name__Ú__self__Ú	__class__)Úmethods   &Ú:/usr/lib/python3/dist-packages/twisted/persisted/styles.pyÚpickleMethodr      s-   € ô 	Ø	�‰˜&Ÿ/™/¨6¯?©?×+DÑ+DÐEðð ó    c                ó   € \        W4      pV# )a�  
Retrieve the function object implementing a method name given the class
it's on and a method name.

@param classObject: A class to retrieve the method's function from.
@type classObject: L{type}

@param methodName: The name of the method whose function to retrieve.
@type methodName: native L{str}

@return: the function object corresponding to the given method name.
@rtype: L{types.FunctionType}
)Úgetattr)ÚclassObjectÚ
methodNameÚmethodObjects   && r   Ú_methodFunctionr   "   s   € ô ˜;Ó3€LØÐr   c                ó(  € Vf   \        W 4      #  \        W 4      pRp\        P                  ! W1.VO5!  pV#   \         dO    \
        P                  ! RT RT4       Tf   Q R4       hTP                  TJ d   h \        YTP                  4      u # i ; i)a3  
Support function for copy_reg to unpickle method refs.

@param im_name: The name of the method.
@type im_name: native L{str}

@param im_self: The instance that the method was present on.
@type im_self: L{object}

@param im_class: The class where the method was declared.
@type im_class: L{type} or L{None}
ÚMethodznot on classz'No recourse: no instance to guess from.© )	r   r   ÚtypesÚ
MethodTypeÚAttributeErrorr   Úmsgr   r   )Úim_nameÚim_selfÚim_classÚmethodFunctionÚ
maybeClassÚbounds   &&&   r   r   r   4   s¡   € ð ‚Ü�xÓ)Ð)ðÜ(¨Ó;ˆð ˆ
Ü× Ò  ÐF¸:ÓFˆØˆøô ô CÜ�Š�˜' >°8Ô<ØÒ"ÐMÐ$MÓMÐ"ð ×Ñ Ó(ØÜ˜g°×0AÑ0AÓBÒBðCús   ‘8 ¸ABÂBc                ó®   € V P                   R8X  d   \        RV  24      h\        \        RP	                  V P
                  V P                  .4      .4      3# )aw  
Reduce, in the sense of L{pickle}'s C{object.__reduce__} special method, a
function object into its constituent parts.

@param f: The function to reduce.
@type f: L{types.FunctionType}

@return: a 2-tuple of a reference to L{_unpickleFunction} and a tuple of
    its arguments, a 1-tuple of the function's fully qualified name.
@rtype: 2-tuple of C{callable, native string}
z<lambda>zCannot pickle lambda function: Ú.)r	   Ú_UniversalPicklingErrorÚ_unpickleFunctionÚtupleÚjoinÚ
__module__Ú__qualname__)Úfs   &r   Ú_pickleFunctionr,   W   sL   € ð 	‡z�z�ZÔÜ%Ð(GÈÀsÐ&KÓLÐLÜœu c§h¡h°·±¸a¿n¹nÐ/MÓ&NÐ%OÓPÐQÐQr   c                ó   € ^ RI Hp V! V 4      # )aÕ  
Convert a function name into a function by importing it.

This is a synonym for L{twisted.python.reflect.namedAny}, but imported
locally to avoid circular imports, and also to provide a persistent name
that can be stored (and deprecated) independently of C{namedAny}.

@param fullyQualifiedName: The fully qualified name of a function.
@type fullyQualifiedName: native C{str}

@return: A function object imported from the given location.
@rtype: L{types.FunctionType}
)ÚnamedAny)Útwisted.python.reflectr.   )ÚfullyQualifiedNamer.   s   & r   r&   r&   h   s   € õ 0áÐ&Ó'Ð'r   c                ó(   € \         V P                  33# )z3support function for copy_reg to pickle module refs)ÚunpickleModuler	   )Úmodules   &r   ÚpickleModuler4   ~   s   € ä˜FŸO™OÐ-Ð-Ð-r   c                ó´   € V \         9   dA   \        P                  ! RV ,          4       \         V ,          p \        P                  ! V 4       \        V / / R4      # )z5support function for copy_reg to unpickle module refszModule has moved: %sÚx)Ú
oldModulesr   r   Ú
__import__)Únames   &r   r2   r2   ƒ   sB   € àŒzÔÜ�ŠÐ&¨Õ-Ô.Ü˜$ÕˆÜ�Š�ŒÜ�d˜B  CÓ(Ð(r   c                óP   €  \         V P                  4       V P                  4       33# )zÉ
Reduce the given cStringO.

This is only called on Python 2, because the cStringIO module only exists
on Python 2.

@param stringo: The string output to pickle.
@type stringo: C{cStringIO.OutputType}
)ÚunpickleStringOÚgetvalueÚtell)Ústringos   &r   ÚpickleStringOr?   �   s'   € ð CÜ˜W×-Ñ-Ó/°·±³Ð@Ð@Ð@r   c                ó^   € \        4       pVP                  V 4       VP                  V4       V# )a²  
Convert the output of L{pickleStringO} into an appropriate type for the
current python version.  This may be called on Python 3 and will convert a
cStringIO into an L{io.StringIO}.

@param val: The content of the file.
@type val: L{bytes}

@param sek: The seek position of the file.
@type sek: L{int}

@return: a file-like object which you can write bytes to.
@rtype: C{cStringIO.OutputType} on Python 2, L{io.StringIO} on Python 3.
)Ú
_cStringIOÚwriteÚseek©ÚvalÚsekr6   s   && r   r;   r;   �   s&   € ô 	‹€AØ‡G�GˆC„LØ‡F�Fˆ3„KØ€Hr   c                óN   € \         V P                  4       V P                  4       33# )a1  
Reduce the given cStringI.

This is only called on Python 2, because the cStringIO module only exists
on Python 2.

@param stringi: The string input to pickle.
@type stringi: C{cStringIO.InputType}

@return: a 2-tuple of (C{unpickleStringI}, (bytes, pointer))
@rtype: 2-tuple of (function, (bytes, int))
)ÚunpickleStringIr<   r=   )Ústringis   &r   ÚpickleStringIrJ   ²   s#   € ô ˜W×-Ñ-Ó/°·±³Ð@Ð@Ð@r   c                ó>   € \        V 4      pVP                  V4       V# )a³  
Convert the output of L{pickleStringI} into an appropriate type for the
current Python version.

This may be called on Python 3 and will convert a cStringIO into an
L{io.StringIO}.

@param val: The content of the file.
@type val: L{bytes}

@param sek: The seek position of the file.
@type sek: L{int}

@return: a file-like object which you can read bytes from.
@rtype: C{cStringIO.OutputType} on Python 2, L{io.StringIO} on Python 3.
)rA   rC   rD   s   && r   rH   rH   Â   s   € ô" 	�3‹€AØ‡F�Fˆ3„KØ€Hr   c                   ó6   a € ] tR t^Øt o RtR tR tR tRtV t	R# )Ú	Ephemeralz\
This type of object is never persisted; if possible, even references to it
are eliminated.
c                ó   € \         R3# )z]
Serialize any subclass of L{Ephemeral} in a way which replaces it with
L{Ephemeral} itself.
r   )rM   )Úselfs   &r   Ú
__reduce__ÚEphemeral.__reduce__Þ   s   € ô
 ˜2ˆÐr   c                óè   € \         P                  ! R V ,          4       \        '       gI   ^ RIp\	        VRR4      '       d2   VP                  V 4       F  p\         P                  ! RV 24       K  	  R# )z!WARNING: serializing ephemeral %sNÚget_referrersz referred to by )r   r   r   Úgcr   rS   )rO   rT   Úrs   &  r   Ú__getstate__ÚEphemeral.__getstate__å   sW   € Ü�ŠÐ3°dÕ:Ô;ß‹uÛä�r˜?¨D×1Ò1Ø×)Ñ)¨$Ö/�AÜ—G’GÐ.¨q¨cÐ2Ö3ñ 0ár   c                ój   € \         P                  ! R V P                  ,          4       \        V n        R# )z#WARNING: unserializing ephemeral %sN)r   r   r   rM   ©rO   Ústates   &&r   Ú__setstate__ÚEphemeral.__setstate__ï   s   € Ü�ŠÐ5¸¿¹ÕFÔGÜ"ˆŽr   )r   N)
r	   r)   r*   Ú__firstlineno__Ú__doc__rP   rV   r[   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   rM   rM   Ø   s   ø‡ € ñò
ò÷#ð #r   rM   c                  ól   € \        \        P                  4       4       F  p \        V 4       K  	  / s/ sR # ©N)ÚlistÚversionedsToUpgradeÚvaluesÚrequireUpgradeÚupgraded)Ú	versioneds    r   Ú	doUpgraderk   ø   s.   € äÔ-×4Ñ4Ó6Ö7ˆ	Ü�yÖ!ñ 8àÐØ‚Hr   c                ó‚   € \        V 4      pV\        9   d)   V\        9  d   ^\        V&   V P                  4        V # R# R# )z?Require that a Versioned instance be upgraded completely first.N)Úidrf   ri   ÚversionUpgrade)ÚobjÚobjIDs   & r   rh   rh      s=   € äˆs‹G€EØÔ#Ô#¨´XÔ(=ØŒ�‰Ø×ÑÔØˆ
ñ )>Ñ#r   c                óÀ   € V \         .p\        P                  ! V 4       F4  pW!9  g   K  \        V\         4      '       g   K#  VP	                  V4       K6  	  VR,          # )z�
Get all of the parent classes of C{c}, not including C{c} itself, which are
strict subclasses of L{Versioned}.

@param c: a class
@returns: list of classes
:é   NN)Ú	VersionedÚinspectÚgetmroÚ
issubclassÚappend)ÚcÚlÚbs   &  r   Ú_aybabtur{   	  sG   € ð 
ŒIˆ€AÜ�^Š^˜AÖˆØŽ:œ* Q¬	×2Ô2Ø�H‰H�QŽKñ ð ˆR�5€Lr   c                   óB   a € ] tR tRt o Rt^ tRtR tR	R ltR t	Rt
V tR# )
rs   i  az  
This type of object is persisted with versioning information.

I have a single class attribute, the int persistenceVersion.  After I am
unserialized (and styles.doUpgrade() is called), self.upgradeToVersionX()
will be called for each version upgrade I must undergo.

For example, if I serialize an instance of a Foo(Versioned) at version 4
and then unserialize it when the code is at version 9, the calls::

  self.upgradeToVersion5()
  self.upgradeToVersion6()
  self.upgradeToVersion7()
  self.upgradeToVersion8()
  self.upgradeToVersion9()

will be made.  If any of these methods are undefined, a warning message
will be printed.
c                ó6   € V \         \        V 4      &   Wn        R # rd   )rf   rm   Ú__dict__rY   s   &&r   r[   ÚVersioned.__setstate__3  s   € Ø(,ÔœB˜t›HÑ%ØŽr   Nc                óº  € \         P                   ! T;'       g    V P                  4      p\        V P                  4      pVP	                  4        VP                  V P                  4       V Fj  pRVP                  9   d   VP                   F  pWR9   g   K  W% K  	  RVP                  9   g   KD  VP                  V\        P                  ! V4       R2&   Kl  	  V# )z8Get state, adding a version number to it on its way out.ÚpersistenceForgetsÚpersistenceVersionz.persistenceVersion)
Úcopyr~   r{   r   Úreverserw   r�   r‚   r   Úqual)rO   ÚdictÚdctÚbasesÚbaseÚslots   &&    r   rV   ÚVersioned.__getstate__7  s²   € ä�iŠi˜×-Ð- §¡Ó.ˆÜ˜Ÿ™Ó(ˆØ�‰ŒØ�‰�T—^‘^Ô$ÛˆDØ# t§}¡}Ô4Ø ×3Ô3�DØ–{ØšIñ 4ð $ t§}¡}Ö4ð ×+Ñ+ð Ü—|’| DÓ)Ð*Ð*=Ð>óñ ð ˆ
r   c                óª  € \        V P                  4      pVP                  4        VP                  V P                  4       RV P                  9   d”   V P                  R,          pV P                  R ^ pRpV F7  pRVP                  9  d   K  VP
                  V8”  g   K)  TpVP
                  pK9  	  V'       d+   VV P                  R\        P                  ! V4      ,          &   V EFg  p\        VP                  9  d   RVP                  9  d   K,  VP
                  pR\        P                  ! V4      ,          pV P                  P                  V4      ;'       g    ^ pV'       d   V P                  V W†8:  g   Q R4       hW†8  g   K¤  V^,           pVP                  P                  RV,          R4      p	V	'       dl   \        P                  ! R\        P                  ! V4      : R\        P                  ! V P                  4      : R\        V 4      : R	V: 24       V	! V 4       K§  \        P                  ! R
P                  WX4      4       KÎ  	  R# )z (internal) Do a version upgrade.r‚   Nz%s.persistenceVersionz"Sorry, can't go backwards in time.zupgradeToVersion%sz
Upgrading z (of z @ z) to version z(Warning: cannot upgrade {} to version {})r{   r   r„   rw   r~   r‚   r   r…   rs   Ú	__bases__Úgetr   r   rm   Úformat)
rO   rˆ   ÚpverÚhighestVersionÚhighestBaser‰   ÚcurrentVersÚpverNameÚpersistVersr   s
   &         r   rn   ÚVersioned.versionUpgradeH  sÐ  € ä˜Ÿ™Ó(ˆð 	�‰ŒØ�‰�T—^‘^Ô$à 4§=¡=Ô0ð —=‘=Ð!5Õ6ˆDØ—‘Ð2Ð3ØˆNØˆKÛ�Ø'¨t¯}©}Ô<ÙØ×*Ñ*¨^Ö;Ø"&�KØ%)×%<Ñ%<’Nñ ÷ ð ð —‘Ø+¬g¯lªl¸;Ó.GÕGñô ˆDô  §¡Ô/Ø(°·±Ô=áØ×1Ñ1ˆKØ.´·²¸dÓ1CÕCˆHØŸ-™-×+Ñ+¨HÓ5×:Ð:¸ˆKßØ—M‘M (Ð+ØÔ-ÐSÐ/SÓSÐ-ØÖ+Ø)¨A�o�ØŸ™×*Ñ*Ð+?À+Õ+MÈtÓT�ßÜ—G“Gô $ŸLšL¨Ö.Ü#ŸLšL¨¯©Ö8Ü˜tžHÚ'ðôñ ˜4–Lä—G’GØB×IÑIØ óöó9 r   )r~   r   rd   )r	   r)   r*   r]   r^   r‚   r�   r[   rV   rn   r_   r`   ra   s   @r   rs   rs     s,   ø‡ € ñð( ÐØÐòô÷"?ð ?r   rs   c                ó¸   € V ^8„  d   Qh/ ^ \         9   d%   \        \        \        P                  3,          ;R&   ^\         9   d   \        \
        R3,          ;R&   # )rr   r7   rs   rf   )Ú__conditional_annotations__r   Ústrr   Ú
ModuleTypeÚint)r�   s   "r   Ú__annotate__rœ      sL   € ÷ ñ ÷ -Ò ,ŒD””e×&Ñ&Ð&Õ'Ñ ,ñ÷^ 1Ò 0”Tœ#˜{Ð*Õ+Ñ 0ò_r   )+r˜   r^   rƒ   ÚcopyregÚcopy_regrt   Úpickler   Úior   rA   Útypingr   Útwisted.pythonr   r   Útwisted.python.compatr   r7   ÚPicklingErrorr%   r   r   r   r   r,   r&   ÚFunctionTyper4   r2   rš   r?   r;   rJ   rH   rM   rf   ri   rk   rh   r{   rs   rœ   )r˜   s   @r   Ú<module>r¦      sð   øðö
ó Û Û Û Û Ý %Ý ç 'Ý 'à*,€
Ó ,ð !×.Ñ.Ð òòò$ð@ 	‡‚�× Ñ  ,Ô /òRò"(ð& 	‡‚�×"Ñ" OÔ 4ò.ò
)ð 	‡‚�× Ñ  ,Ô /òAòò*Aò ÷,#ñ #ð8 /1Ð Ó 0Ø€òòò÷$ló lr   