ó
    Ö›‘h‡Š  ã                   ó‚  • S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	  SSK
Jr  SSKJrJrJrJrJrJr  SSKJr  SSKJr  SS	KJrJrJr  SS
KJrJr  \4rSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,\" \" SSSS5      SSS5        Sr-0 q.0 q/S r0S r1S  r2S! r3S" r4S8S# jr5S$ r6S% r7 " S& S'5      r8\	" \5       " S( S)5      5       r9\	" \5       " S* S+5      5       r: " S, S-5      r; " S. S/5      r< " S0 S1\=5      r> " S2 S35      r? " S4 S55      r@\@" 5       rA\AR…                  5         \?" 5       SS4S6 jrC\?" 5       SS4S7 jrDg)9aM  
S-expression-based persistence of python objects.

It does something very much like L{Pickle<pickle>}; however, pickle's main goal
seems to be efficiency (both in space and time); jelly's main goals are
security, human readability, and portability to other environments.

This is how Jelly converts various objects to s-expressions.

Boolean::
    True --> ['boolean', 'true']

Integer::
    1 --> 1

List::
    [1, 2] --> ['list', 1, 2]

String::
    "hello" --> "hello"

Float::
    2.3 --> 2.3

Dictionary::
    {'a': 1, 'b': 'c'} --> ['dictionary', ['b', 'c'], ['a', 1]]

Module::
    UserString --> ['module', 'UserString']

Class::
    UserString.UserString --> ['class', ['module', 'UserString'], 'UserString']

Function::
    string.join --> ['function', 'join', ['module', 'string']]

Instance: s is an instance of UserString.UserString, with a __dict__
{'data': 'hello'}::
    ["UserString.UserString", ['dictionary', ['data', 'hello']]]

Class Method: UserString.UserString.center::
    ['method', 'center', ['None'], ['class', ['module', 'UserString'],
     'UserString']]

Instance Method: s.center, where s is an instance of UserString.UserString::
    ['method', 'center', ['instance', ['reference', 1, ['class',
    ['module', 'UserString'], 'UserString']], ['dictionary', ['data', 'd']]],
    ['dereference', 1]]

The Python 2.x C{sets.Set} and C{sets.ImmutableSet} classes are
serialized to the same thing as the builtin C{set} and C{frozenset}
classes.  (This is only relevant if you are communicating with a
version of jelly running on an older version of Python.)

@author: Glyph Lefkowitz

é    N)Úreduce)Úimplementer)ÚVersion)ÚNotKnownÚ
_ContainerÚ_DereferenceÚ_DictKeyAndValueÚ_InstanceMethodÚ_Tuple)ÚnativeString)ÚdeprecatedModuleAttribute)ÚnamedAnyÚnamedObjectÚqual)Ú
IJellyableÚIUnjellyableó   Noneó   classó   moduleó   functions   dereferences
   persistents	   references
   dictionarys   listó   sets   tuples   instanceó	   frozensetÚTwistedé   z'instance_atom is unused within Twisted.ztwisted.spread.jellyÚinstance_atoms   unpersistablec                 óP   • [        U [        5      (       a  U R                  U 5      $ g)a}  
Given an object, if that object is a type, return a new, blank instance
of that type which has not had C{__init__} called on it.  If the object
is not a type, return L{None}.

@param cls: The type (or class) to create an instance of.
@type cls: L{type} or something else that cannot be
    instantiated.

@return: a new blank instance or L{None} if C{cls} is not a class or type.
N)Ú
isinstanceÚtypeÚ__new__)Úclss    ÚXC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/spread/jelly.pyÚ_createBlankr"   �   s%   € ô �#”t×ÑØ�{‰{˜3ÓÐð ó    c                 óT   ^• [        U 5      mU4S jn[        TSU5      nU" U5        T$ )zÜ
Make a new instance of a class without calling its __init__ method.

@param state: A C{dict} used to update C{inst.__dict__} either directly or
    via C{__setstate__}, if available.

@return: A new instance of C{cls}.
c                 óR   >• [        U [        5      (       a  U =(       d    0 Tl        g g ©N)r   ÚdictÚ__dict__)ÚstateÚinstances    €r!   ÚdefaultSetterÚ#_newInstance.<locals>.defaultSetterœ   s!   ø€ Ü�eœT×"Ñ"Ø %§¨ˆHÕð #r#   Ú__setstate__)r"   Úgetattr)r    r)   r+   Úsetterr*   s       @r!   Ú_newInstancer0   ‘   s0   ø€ ô ˜CÓ €Hõ,ô �X˜~¨}Ó=€FÙ
ˆ5„MØ€Or#   c                 ó–   • [        U [        5      nU(       a  [        U 5      n [        U [        5      (       d  U R	                  S5      n U $ )Núutf-8)r   r   r   ÚbytesÚencode)Ú
classnamepÚisObjects     r!   Ú_maybeClassr7   ¥   s>   € Ü˜*¤dÓ+€HæÜ˜*Ó%ˆ
ä�j¤%×(Ñ(Ø×&Ñ& wÓ/ˆ
àÐr#   c                 óV   • [        U 5      n U[        U '   [        R                  U 5        g)aH  
Set which local class will represent a remote type.

If you have written a Copyable class that you expect your client to be
receiving, write a local "copy" class to represent it, then call::

    jellier.setUnjellyableForClass('module.package.Class', MyCopier).

Call this at the module level immediately after its class
definition. MyCopier should be a subclass of RemoteCopy.

The classname may be a special tag returned by
'Copyable.getTypeToCopyFor' rather than an actual classname.

This call is also for cached classes, since there will be no
overlap.  The rules are the same.
N)r7   ÚunjellyableRegistryÚglobalSecurityÚ
allowTypes)Ú	classnameÚunjellyables     r!   ÚsetUnjellyableForClassr>   ±   s'   € ô( ˜IÓ&€IØ%0Ô˜	Ñ"Ü×Ñ˜iÕ(r#   c                 óV   • [        U 5      n U[        U '   [        R                  U 5        g)a…  
Set the factory to construct a remote instance of a type::

  jellier.setUnjellyableFactoryForClass('module.package.Class', MyFactory)

Call this at the module level immediately after its class definition.
C{copyFactory} should return an instance or subclass of
L{RemoteCopy<pb.RemoteCopy>}.

Similar to L{setUnjellyableForClass} except it uses a factory instead
of creating an instance.
N)r7   ÚunjellyableFactoryRegistryr:   r;   )r<   ÚcopyFactorys     r!   ÚsetUnjellyableFactoryForClassrB   Ê   s'   € ô ˜IÓ&€IØ,7Ô˜yÑ)Ü×Ñ˜iÕ(r#   c                 óà   • Uc  U R                   nU(       a  SU-  n[        U 5       H3  n[        X5      n [        XA5      nU(       a  [	        U U 3U5        M3  M5     g! [
         a     ME  f = f)aˆ  
Set all classes in a module derived from C{baseClass} as copiers for
a corresponding remote class.

When you have a hierarchy of Copyable (or Cacheable) classes on one
side, and a mirror structure of Copied (or RemoteCache) classes on the
other, use this to setUnjellyableForClass all your Copieds for the
Copyables.

Each copyTag (the "classname" argument to getTypeToCopyFor, and
what the Copyable's getTypeToCopyFor returns) is formed from
adding a prefix to the Copied's class name.  The prefix defaults
to module.__name__.  If you wish the copy tag to consist of solely
the classname, pass the empty string ''.

@param module: a module object from which to pull the Copied classes.
    (passing sys.modules[__name__] might be useful)

@param baseClass: the base class from which all your Copied classes derive.

@param prefix: the string prefixed to classnames to form the
    unjellyableRegistry.
Nz%s.)Ú__name__Údirr.   Ú
issubclassr>   Ú	TypeError)ÚmoduleÚ	baseClassÚprefixÚnameÚloadedÚyess         r!   ÚsetUnjellyableForClassTreerN   Þ   sw   € ð0 �~Ø—‘ˆæØ˜‘ˆä�F–ˆÜ˜Ó&ˆð	BÜ˜VÓ/ˆCö Ü&¨&¨°$°Ð'8¸&ÖAñ ò øô ó 	 Úð	 ús   ¶AÁ
A-Á,A-c                 ó*  • [        U S5      (       a  U R                  5       nOU R                  nUR                  U 5      nUR	                  [        U R                  5      R                  S5      UR                  U5      /5        UR                  X5      $ )zE
Utility method to default to 'normal' state rules in serialization.
Ú__getstate__r2   )
ÚhasattrrP   r(   ÚprepareÚextendr   Ú	__class__r4   ÚjellyÚpreserve)ÚinstÚjellierr)   Úsxps       r!   ÚgetInstanceStaterZ     su   € ô ˆt�^×$Ñ$Ø×!Ñ!Ó#‰à—‘ˆØ
�/‰/˜$Ó
€CØ‡J�J”�T—^‘^Ó$×+Ñ+¨GÓ4°g·m±mÀEÓ6JÐKÔLØ×Ñ˜DÓ&Ð&r#   c                 ó‚   • UR                  US   5      n[        U S5      (       a  U R                  U5        U $ X0l        U $ )zG
Utility method to default to 'normal' state rules in unserialization.
é   r-   )ÚunjellyrQ   r-   r(   )rW   Ú	unjellierÚ	jellyListr)   s       r!   ÚsetInstanceStater`     sF   € ð ×Ñ˜i¨™lÓ+€EÜˆt�^×$Ñ$Ø×Ñ˜%Ô ð €Kð ŒØ€Kr#   c                   ó,   • \ rS rSrSrS rS\4S jrSrg)ÚUnpersistablei   zX
This is an instance of a class that comes back when something couldn't be
unpersisted.
c                 ó   • Xl         g)zI
Initialize an unpersistable object with a descriptive C{reason} string.
N©Úreason)Úselfre   s     r!   Ú__init__ÚUnpersistable.__init__&  s	   € ð �r#   Úreturnc                 ó2   • S[        U R                  5      -  $ )NzUnpersistable(%s))Úreprre   ©rf   s    r!   Ú__repr__ÚUnpersistable.__repr__,  s   € Ø"¤T¨$¯+©+Ó%6Ñ6Ð6r#   rd   N)	rD   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rg   Ústrrm   Ú__static_attributes__© r#   r!   rb   rb      s   † ñò
ð7˜#÷ 7r#   rb   c                   ó$   • \ rS rSrSrS rS rSrg)Ú	Jellyablei0  zW
Inherit from me to Jelly yourself directly with the `getStateFor'
convenience method.
c                 ó   • U R                   $ r&   ©r(   )rf   rX   s     r!   ÚgetStateForÚJellyable.getStateFor7  s   € Ø�}‰}Ðr#   c                 óì   • UR                  U 5      nUR                  [        U R                  5      R	                  S5      UR                  U R                  U5      5      /5        UR                  X5      $ )z8
@see: L{twisted.spread.interfaces.IJellyable.jellyFor}
r2   )rR   rS   r   rT   r4   rU   rz   rV   )rf   rX   rY   s      r!   ÚjellyForÚJellyable.jellyFor:  sd   € ð �o‰o˜dÓ#ˆØ�
‰
ä�T—^‘^Ó$×+Ñ+¨GÓ4Ø—‘˜d×.Ñ.¨wÓ7Ó8ðô	
ð ×Ñ Ó*Ð*r#   ru   N)rD   ro   rp   rq   rr   rz   r}   rt   ru   r#   r!   rw   rw   0  s   † ñò
õ+r#   rw   c                   ó$   • \ rS rSrSrS rS rSrg)ÚUnjellyableiH  zZ
Inherit from me to Unjelly yourself directly with the
C{setStateFor} convenience method.
c                 ó   • X l         g r&   ry   )rf   r^   r)   s      r!   ÚsetStateForÚUnjellyable.setStateForO  s   € Ø�r#   c                 óP   • UR                  US   5      nU R                  X5        U $ )zu
Perform the inverse operation of L{Jellyable.jellyFor}.

@see: L{twisted.spread.interfaces.IUnjellyable.unjellyFor}
r\   )r]   r‚   )rf   r^   r_   r)   s       r!   Ú
unjellyForÚUnjellyable.unjellyForR  s+   € ð ×!Ñ! )¨A¡,Ó/ˆØ×Ñ˜Ô*Øˆr#   ry   N)rD   ro   rp   rq   rr   r‚   r…   rt   ru   r#   r!   r€   r€   H  s   † ñò
õr#   r€   c                   óR   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSS jrSrg)Ú_Jellieri]  z;
(Internal) This class manages state for a call to jelly()
c                 ó`   • Xl         0 U l        0 U l        0 U l        SU l        X l        X0l        g)z
Initialize.
r\   N)ÚtasterÚ	preservedÚcookedÚcookerÚ_ref_idÚpersistentStoreÚinvoker)rf   rŠ   r�   r�   s       r!   rg   Ú_Jellier.__init__b  s2   € ð ŒàˆŒð ˆŒØˆŒØˆŒØ.ÔØ�r#   c                 óô   • U R                   [        U5         n[        R                  " U5      nU R                  nU R                  S-   U l        [        XC/USS& [
        U/U R                  [        U5      '   U$ )aW  
(internal) Backreference an object.

Notes on this method for the hapless future maintainer: If I've already
gone through the prepare/preserve cycle on the specified object (it is
being referenced after the serializer is "done with" it, e.g. this
reference is NOT circular), the copy-in-place of aList is relevant,
since the list being modified is the actual, pre-existing jelly
expression that was returned for that object. If not, it's technically
superfluous, since the value in self.preserved didn't need to be set,
but the invariant that self.preserved[id(object)] is a list is
convenient because that means we don't have to test and create it or
not create it here, creating fewer code-paths.  that's why
self.preserved is always set to a list.

Sorry that this code is so hard to follow, but Python objects are
tricky to persist correctly. -glyph
r\   N)r‹   ÚidÚcopyrŽ   Úreference_atomÚdereference_atomrŒ   )rf   ÚobjectÚaListÚnewListÚrefids        r!   Ú_cookÚ_Jellier._cookq  si   € ð& —‘œr &›zÑ*ˆÜ—)’)˜EÓ"ˆà—‘ˆØ—|‘| aÑ'ˆŒô # EÐ3ˆ‰aˆÜ#3°UÐ";ˆ�‰”B�v“JÑØˆr#   c                 ód   • / U R                   [        U5      '   XR                  [        U5      '   / $ )a  
(internal) Create a list for persisting an object to.  This will allow
backreferences to be made internal to the object. (circular
references).

The reason this needs to happen is that we don't generate an ID for
every object, so we won't necessarily know which ID the object will
have in the future.  When it is 'cooked' ( see _cook ), it will be
assigned an ID, and the temporary placeholder list created here will be
modified in-place to create an expression that gives this object an ID:
[reference id# [object-jelly]].
)r‹   r“   r�   )rf   r—   s     r!   rR   Ú_Jellier.prepare�  s-   € ð &(ˆ�‰”r˜&“zÑ"ð #)�‰”B�v“JÑØˆ	r#   c                 óÎ   • [        U5      U R                  ;   a4  X R                  [        U5         S'   U R                  [        U5         nU$ X R                  [        U5      '   U$ )zA
(internal) Mark an object's persistent list for later referral.
é   )r“   rŒ   r‹   )rf   r—   Úsexps      r!   rV   Ú_Jellier.preserve§  sY   € ô
 ˆf‹:˜Ÿ™Ó$à,0�N‰Nœ2˜f›:Ñ& qÑ)à—>‘>¤" V£*Ñ-ˆDð ˆð *.�N‰Nœ2˜f›:Ñ&Øˆr#   c                 ó´   • [        U5      nX R                  ;   a  U R                  U   $ X R                  ;   a   U R                  U5        U R                  U   $ g r&   )r“   rŒ   r‹   r›   )rf   ÚobjÚobjIds      r!   Ú_checkMutableÚ_Jellier._checkMutableµ  sM   € Ü�3“ˆØ—K‘KÓØ—;‘;˜uÑ%Ð%Ø—N‘NÓ"Ø�J‰J�sŒOØ—;‘;˜uÑ%Ð%ð #r#   c           
      ó  • [        U[        5      (       a+  U R                  U5      nU(       a  U$ UR                  U 5      $ [	        U5      nU R
                  R                  [        U5      R                  S5      5      (       GaY  U[        [        [        4;   a  U$ [        U[        R                  5      (       aR  UR                  nUR                  nUR                   nSUR"                  U R%                  U5      U R%                  U5      /$ U[&        L a  SUR                  S5      /$ [        U[	        S 5      5      (       a  S/$ [        U[        R(                  5      (       a  SUR*                  S-   UR,                  -   /$ [        U[        R.                  5      (       a  SUR"                  /$ U[0        L a  S	U=(       a    S
=(       d    S/$ U[2        R2                  L a¥  UR4                  (       a  [7        S5      eSSR9                  UR:                  UR<                  UR>                  UR@                  URB                  URD                  URF                  4 Vs/ s H  n['        U5      PM     sn5      R                  S5      /$ U[2        RH                  L a„  UR4                  (       a  [7        S5      eSSR9                  UR@                  URB                  URD                  URF                  4 Vs/ s H  n['        U5      PM     sn5      R                  S5      /$ U[2        RJ                  L a]  SSR9                  UR:                  UR<                  UR>                  4 Vs/ s H  n['        U5      PM     sn5      R                  S5      /$ U[2        RL                  L a]  SSR9                  URN                  URP                  URR                  4 Vs/ s H  n['        U5      PM     sn5      R                  S5      /$ [U        U[        5      (       a  S[        U5      R                  S5      /$ U[V        RX                  L a  U R[                  U5      $ U R                  U5      nU(       a  U$ U R]                  U5      nU[^        L a'  URa                  U Rc                  [d        U5      5        GOU[f        L a'  URa                  U Rc                  [h        U5      5        GOïU[j        ;   aa  URm                  [n        5        URq                  5        H6  u  pšURm                  U R%                  U	5      U R%                  U
5      /5        M8     GO„U[r        L a'  URa                  U Rc                  [t        U5      5        GOTU[v        L a'  URa                  U Rc                  [x        U5      5        GO$[        UR                   5      R                  S5      nS nU Rz                  (       a  U R{                  X5      nUb'  URm                  [|        5        URm                  U5        O²U R
                  R                  UR                   5      (       a`  URm                  U5        [�        US5      (       a  URƒ                  5       nOUR„                  nURm                  U R%                  U5      5        O(U R‡                  S[        UR                   5      -  U5        U R‰                  X5      $ [‹        SU SU 35      es  snf s  snf s  snf s  snf )Nr2   s   methodó   unicodeúUTF-8r   r   Ú.r   ó   booleanó   trueó   falsez2Currently can't jelly datetime objects with tzinfoó   datetimeÚ ó   timeó   dateó	   timedeltar   rP   z$instance of class %s deemed insecurezType not allowed for object: )Fr   rw   r¦   r}   r   rŠ   ÚisTypeAllowedr   r4   r3   ÚintÚfloatÚtypesÚ
MethodTypeÚ__self__Ú__func__rT   rD   rU   rs   ÚFunctionTypero   rp   Ú
ModuleTypeÚboolÚdatetimeÚtzinfoÚNotImplementedErrorÚjoinÚyearÚmonthÚdayÚhourÚminuteÚsecondÚmicrosecondÚtimeÚdateÚ	timedeltaÚdaysÚsecondsÚmicrosecondsrF   ÚdecimalÚDecimalÚjelly_decimalrR   ÚlistrS   Ú_jellyIterableÚ	list_atomÚtupleÚ
tuple_atomÚ	DictTypesÚappendÚdictionary_atomÚitemsÚsetÚset_atomÚ	frozensetÚfrozenset_atomr�   Úpersistent_atomÚisClassAllowedrQ   rP   r(   ÚunpersistablerV   ÚInsecureJelly)rf   r¤   ÚpreRefÚobjTypeÚaSelfÚaFuncÚaClassÚxrY   ÚkeyÚvalÚ	classNameÚ
persistentr)   s                 r!   rU   Ú_Jellier.jelly½  s¨  € Ü�cœ9×%Ñ%Ø×'Ñ'¨Ó,ˆFÞØ�Ø—<‘< Ó%Ð%Ü�s“)ˆØ�;‰;×$Ñ$¤T¨'£]×%9Ñ%9¸'Ó%B×CÒCàœ5¤#¤uÐ-Ó-Ø�
Ü˜C¤×!1Ñ!1×2Ñ2ØŸ™�ØŸ™�ØŸ™�àØ—N‘NØ—J‘J˜uÓ%Ø—J‘J˜vÓ&ð	ð ð œC’Ø" C§J¡J¨wÓ$7Ð8Ð8Ü˜C¤ d£×,Ñ,Ø�yÐ Ü˜C¤×!3Ñ!3×4Ñ4Ø# S§^¡^°cÑ%9¸C×<LÑ<LÑ%LÐMÐMÜ˜C¤×!1Ñ!1×2Ñ2Ø! 3§<¡<Ð0Ð0ØœD’Ø" C§O¨G×$?°xÐ@Ð@ØœH×-Ñ-Ò-Ø—:—:Ü-ØLóð ð  Ø—H‘Hð !$§¡Ø #§	¡	Ø #§¡Ø #§¡Ø #§
¡
Ø #§
¡
Ø #§¡ñ&óò& ô   žFñ&ñó÷ ‘f˜W“oðð ð" œHŸM™MÒ)Ø—:—:Ü-ØLóð ð Ø—H‘Hð '*§h¡h°·
±
¸C¿J¹JÈÏÉÑ%Xóâ%X ô   žFÙ%Xñó÷
 ‘f˜W“oðð ð œHŸM™MÒ)àØ—H‘H¨s¯x©x¸¿¹ÀCÇGÁGÑ.LÓMÒ.L¨œc !žfÑ.LÑMÓN×UÑUØóðð ð œH×.Ñ.Ò.à Ø—H‘HØ*-¯(©(°C·K±KÀ×AQÑAQÑ)RÓSÒ)R Aœ˜QžÑ)RÑSóç‘f˜W“oð	ð ô ˜G¤T×*Ñ*Ø ¤$ s£)×"2Ñ"2°7Ó";Ð<Ð<ØœGŸO™OÒ+Ø×)Ñ)¨#Ó.Ð.à×+Ñ+¨CÓ0�ÞØ!�Mà—l‘l 3Ó'�Øœd’?Ø—J‘J˜t×2Ñ2´9¸cÓBÖCØ¤Ò%Ø—J‘J˜t×2Ñ2´:¸sÓCÖDØ¤	Ó)Ø—J‘JœÔ/Ø$'§I¡I¦K™˜ØŸ
™
 D§J¡J¨s£O°T·Z±ZÀ³_Ð#EÖFó %0à¤’^Ø—J‘J˜t×2Ñ2´8¸SÓAÖBØ¤	Ò)Ø—J‘J˜t×2Ñ2´>À3ÓGÖHä $ S§]¡]Ó 3× :Ñ :¸7Ó C�IØ!%�JØ×+×+Ø%)×%9Ñ%9¸#Ó%D˜
Ø!Ñ-ØŸ
™
¤?Ô3ØŸ
™
 :Õ.ØŸ™×3Ñ3°C·M±M×BÑBØŸ
™
 9Ô-Ü" 3¨×7Ñ7Ø$'×$4Ñ$4Ó$6™Eà$'§L¡L˜EØŸ
™
 4§:¡:¨eÓ#4Õ5à×*Ñ*ØBÜ" 3§=¡=Ó1ñ2àôð
 —}‘} SÓ.Ð.äÐ"?À¸yÈÈ#ÈÐ OÓPÐPùòoùò,ùò Nùò Ts   É[/
Ë2[4
Í"[9
Ï[>
c              #   óL   #   • Uv •  U H  nU R                  U5      v •  M     g7f)zÔ
Jelly an iterable object.

@param atom: the identifier atom of the object.
@type atom: C{str}

@param obj: any iterable object.
@type obj: C{iterable}

@return: a generator of jellied data.
@rtype: C{generator}
N)rU   )rf   Úatomr¤   Úitems       r!   rÓ   Ú_Jellier._jellyIterable=  s%   é € ð Š
ÛˆDØ—*‘*˜TÓ"Ô"ò ùs   ‚"$c                 ó^   • UR                  5       u  p#n[        S U5      nU(       a  U* nSXT/$ )z—
Jelly a decimal object.

@param d: a decimal object to serialize.
@type d: C{decimal.Decimal}

@return: jelly for the decimal object.
@rtype: C{list}
c                 ó   • U S-  U-   $ )Né
   ru   )ÚleftÚrights     r!   Ú<lambda>Ú(_Jellier.jelly_decimal.<locals>.<lambda>Y  s   € ¨4°"©9°uÒ+<r#   ó   decimal)Úas_tupler   )rf   ÚdÚsignÚgutsÚexponentÚvalues         r!   rÑ   Ú_Jellier.jelly_decimalN  s6   € ð  !Ÿz™z›|Ñˆ�HÜÑ<¸dÓCˆÞØ�FˆEØ˜EÐ,Ð,r#   Nc                 ó¨   • Uc  / nUR                  [        5        [        U[        5      (       a  UR	                  S5      nUR                  U5        U$ )z‰
(internal) Returns an sexp: (unpersistable "reason").  Utility method
for making note that a particular object could not be serialized.
r2   )rØ   Úunpersistable_atomr   rs   r4   )rf   re   rY   s      r!   rá   Ú_Jellier.unpersistable^  sG   € ð
 ‰;ØˆCØ�
‰
Ô%Ô&Ü�fœc×"Ñ"Ø—]‘] 7Ó+ˆFØ�
‰
�6ÔØˆ
r#   )rŽ   rŒ   r�   r�   r�   r‹   rŠ   r&   )rD   ro   rp   rq   rr   rg   r›   rR   rV   r¦   rU   rÓ   rÑ   rá   rt   ru   r#   r!   rˆ   rˆ   ]  s7   † ñòòò<ò0ò&ò~Qò@#ò"-÷ r#   rˆ   c                   óÂ   • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r Sr!g )!Ú
_Unjellieril  c                 óD   • Xl         X l        0 U l        / U l        X0l        g r&   )rŠ   ÚpersistentLoadÚ
referencesÚpostCallbacksr�   )rf   rŠ   r  r�   s       r!   rg   Ú_Unjellier.__init__m  s!   € ØŒØ,ÔØˆŒØˆÔØ�r#   c                 ó\   • U R                  U5      nU R                   H
  nU" 5         M     U$ r&   )r]   r	  )rf   r¤   ÚoÚms       r!   ÚunjellyFullÚ_Unjellier.unjellyFullt  s*   € Ø�L‰L˜ÓˆØ×#Ô#ˆAÙŽCñ $àˆr#   c                 ór   • [        US5      (       a%  U R                  R                  UR                  5        U$ )zÉ
If the given object has support for the C{postUnjelly} hook, set it up
to be called at the end of deserialization.

@param unjellied: an object that has already been unjellied.

@return: C{unjellied}
ÚpostUnjelly)rQ   r	  rØ   r  )rf   Ú	unjellieds     r!   Ú_maybePostUnjellyÚ_Unjellier._maybePostUnjellyz  s1   € ô �9˜m×,Ñ,Ø×Ñ×%Ñ% i×&;Ñ&;Ô<ØÐr#   c                 ó0  • [        U5      [        La  U$ US   nU R                  R                  U5      (       d  [	        U5      e[
        R                  U5      nUb-  [        [        U5      SU5      nU R                  U" X5      5      $ [        R                  U5      nUb)  U R                  U" U R                  US   5      5      5      $ [        U5      n[        U SU-  S 5      nUb  U" USS  5      $ UR                  S5      nSR                  US S 5      n	U R                  R                  U	5      (       d  [	        SU	 SU S	35      e[!        U5      n
U R                  R#                  U
5      (       d  [	        S
U-  5      eU R%                  X¡S   5      $ )Nr   r…   r\   z_unjelly_%sr«   éÿÿÿÿzModule z not allowed (in type z).zClass %s not allowed.)r   rÒ   rŠ   r´   râ   r9   Úgetr.   r"   r  r@   r]   r   ÚsplitrÁ   ÚisModuleAllowedr   rà   Ú_genericUnjelly)rf   r¤   ÚjelTypeBytesÚregClassÚmethodÚ
regFactoryÚjelTypeTextÚthunkÚ	nameSplitÚmodNameÚclzs              r!   r]   Ú_Unjellier.unjelly‡  s‡  € Ü�‹9œDÒ ØˆJØ˜1‘vˆØ�{‰{×(Ñ(¨×6Ñ6Ü Ó-Ð-Ü&×*Ñ*¨<Ó8ˆØÑÜœ\¨(Ó3°\À8ÓLˆFØ×)Ñ)©&°Ó*;Ó<Ð<Ü/×3Ñ3°LÓAˆ
ØÑ!Ø×)Ñ)©*°T·\±\À#ÀaÁ&Ó5IÓ*JÓKÐKä" <Ó0ˆÜ˜˜m¨kÑ9¸4Ó@ˆØÑÙ˜˜Q˜R˜“>Ð!à#×)Ñ)¨#Ó.ˆIØ—h‘h˜y¨¨"˜~Ó.ˆGØ—;‘;×.Ñ.¨w×7Ñ7Ü#Ø˜g˜YÐ&<¸[¸MÈÐLóð ô ˜kÓ*ˆCØ—;‘;×-Ñ-¨c×2Ñ2Ü#Ð$;¸kÑ$IÓJÐJØ×'Ñ'¨°©VÓ4Ð4r#   c                 óT   • U R                  [        XR                  U5      5      5      $ )a~  
Unjelly a type for which no specific unjellier is registered, but which
is nonetheless allowed.

@param cls: the class of the instance we are unjellying.
@type cls: L{type}

@param state: The jellied representation of the object's state; its
    C{__dict__} unless it has a C{__setstate__} that takes something
    else.
@type state: L{list}

@return: the new, unjellied instance.
)r  r0   r]   )rf   r    r)   s      r!   r  Ú_Unjellier._genericUnjelly¥  s#   € ð ×%Ñ%¤l°3¿¹ÀUÓ8KÓ&LÓMÐMr#   c                 ó   • g r&   ru   ©rf   Úexps     r!   Ú_unjelly_NoneÚ_Unjellier._unjelly_None¶  s   € Ør#   c                 ó    • [        US   S5      $ )Nr   rª   )rs   r(  s     r!   Ú_unjelly_unicodeÚ_Unjellier._unjelly_unicode¹  s   € Ü�3�q‘6˜7Ó#Ð#r#   c                 óª   • US   nUS   nUS:  a  SnOSn[         R                  " U5      R                  5       S   n[         R                  " XEU45      $ )z
Unjelly decimal objects.
r   r\   )rÏ   rÐ   rú   )rf   r)  rÿ   rþ   rü   rý   s         r!   Ú_unjelly_decimalÚ_Unjellier._unjelly_decimal¼  sW   € ð �A‘ˆØ�q‘6ˆØ�1‹9Ø‰DàˆDÜ�Š˜uÓ%×.Ñ.Ó0°Ñ3ˆÜ�Š ¨HÐ5Ó6Ð6r#   c                 ó(   • US   S;   d   eUS   S:H  $ )Nr   )r­   r®   r­   ru   r(  s     r!   Ú_unjelly_booleanÚ_Unjellier._unjelly_booleanÉ  s$   € Ø�1‰vÐ,Ó,Ð,Ð,Ø�1‰v˜Ñ Ð r#   c                 óf   • [         R                   " [        [        US   R                  5       5      6 $ ©Nr   )r¾   Úmaprµ   r  r(  s     r!   Ú_unjelly_datetimeÚ_Unjellier._unjelly_datetimeÍ  s$   € Ü× Ò ¤#¤c¨3¨q©6¯<©<«>Ó":Ð;Ð;r#   c                 óf   • [         R                  " [        [        US   R	                  5       5      6 $ r6  )r¾   rÊ   r7  rµ   r  r(  s     r!   Ú_unjelly_dateÚ_Unjellier._unjelly_dateÐ  ó"   € Ü�}Š}œc¤# s¨1¡v§|¡|£~Ó6Ð7Ð7r#   c                 óf   • [         R                  " [        [        US   R	                  5       5      6 $ r6  )r¾   rÉ   r7  rµ   r  r(  s     r!   Ú_unjelly_timeÚ_Unjellier._unjelly_timeÓ  r=  r#   c                 ót   • [        [        US   R                  5       5      u  p#n[        R                  " X#US9$ )Nr   )rÌ   rÍ   rÎ   )r7  rµ   r  r¾   rË   )rf   r)  rÌ   rÍ   rÎ   s        r!   Ú_unjelly_timedeltaÚ_Unjellier._unjelly_timedeltaÖ  s0   € Ü&)¬#¨s°1©v¯|©|«~Ó&>Ñ#ˆ�|Ü×!Ò! tÈ<ÑXÐXr#   c                 ó|   • U R                  U5      n[        U[        5      (       a  UR                  X5        XAU'   U$ r&   )r]   r   r   ÚaddDependant)rf   r¤   ÚlocÚjelr  s        r!   ÚunjellyIntoÚ_Unjellier.unjellyIntoÚ  s5   € Ø�L‰L˜ÓˆÜ�aœ×"Ñ"Ø�N‰N˜3Ô$ØˆC‰Øˆr#   c                 ó‚   • US   nU R                   R                  U5      nUb  U$ [        U5      nX@R                   U'   U$ r6  )r  r  r   )rf   Úlstrš   rè   Úders        r!   Ú_unjelly_dereferenceÚ_Unjellier._unjelly_dereferenceá  sD   € Ø�A‘ˆØ�O‰O×Ñ Ó&ˆØ‰=ØˆHÜ˜5Ó!ˆØ!$�‰˜ÑØˆ
r#   c                 ó  • US   nUS   nU R                  U5      nU R                  R                  U5      nUc  X@R                  U'   U$ [        U[        5      (       a!  UR                  U5        X@R                  U'   U$  S5       e)Nr   r\   z!Multiple references with same ID!)r]   r  r  r   r   ÚresolveDependants)rf   rK  rš   r)  r  Úrefs         r!   Ú_unjelly_referenceÚ_Unjellier._unjelly_referenceê  s‹   € Ø�A‘ˆØ�!‰fˆØ�L‰L˜ÓˆØ�o‰o×!Ñ! %Ó(ˆØ‰;Ø%&�O‰O˜EÑ"ð ˆô ˜œX×&Ñ&Ø×!Ñ! !Ô$Ø%&�O‰O˜EÑ"ð ˆð :Ð9Ó9�1r#   c           	      óâ   • [        [        [        U5      5      5      nSnU H.  n[        U R	                  X$X   5      [
        5      (       d  M,  SnM0     U(       a  [        U5      $ [        U5      $ )Nr\   r   )rÒ   ÚrangeÚlenr   rH  r   rÕ   r   )rf   rK  ÚlÚfinishedÚelems        r!   Ú_unjelly_tupleÚ_Unjellier._unjelly_tupleø  s\   € Ü””s˜3“x“Ó!ˆØˆÛˆDÜ˜$×*Ñ*¨1°C±IÓ>Ä×IÓIØ’ñ ö Ü˜“8ˆOä˜!“9Ðr#   c                 óz   • [        [        [        U5      5      5      nU H  nU R                  X#X   5        M     U$ r&   )rÒ   rU  rV  rH  )rf   rK  rW  rY  s       r!   Ú_unjelly_listÚ_Unjellier._unjelly_list  s5   € Ü””s˜3“x“Ó!ˆÛˆDØ×Ñ˜Q c¡iÖ0ñ àˆr#   c                 óà   • [        [        [        U5      5      5      nSnU H0  nU R                  X5X   5      n[	        U[
        5      (       d  M.  SnM2     U(       d  [        X25      $ U" U5      $ )z–
Helper method to unjelly set or frozenset.

@param lst: the content of the set.
@type lst: C{list}

@param containerType: the type of C{set} to use.
TF)rÒ   rU  rV  rH  r   r   r   )rf   rK  ÚcontainerTyperW  rX  rY  Údatas          r!   Ú_unjellySetOrFrozensetÚ!_Unjellier._unjellySetOrFrozenset	  sf   € ô ””s˜3“x“Ó!ˆØˆÛˆDØ×#Ñ# A¨S©YÓ7ˆDÜ˜$¤×)Ó)Ø ’ñ ö Ü˜aÓ/Ð/á  Ó#Ð#r#   c                 ó.   • U R                  U[        5      $ )z'
Unjelly set using the C{set} builtin.
)rb  rÛ   ©rf   rK  s     r!   Ú_unjelly_setÚ_Unjellier._unjelly_set  s   € ð ×*Ñ*¨3´Ó4Ð4r#   c                 ó.   • U R                  U[        5      $ )z3
Unjelly frozenset using the C{frozenset} builtin.
)rb  rÝ   re  s     r!   Ú_unjelly_frozensetÚ_Unjellier._unjelly_frozenset#  s   € ð ×*Ñ*¨3´	Ó:Ð:r#   c                 ó‚   • 0 nU H6  u  p4[        U5      nU R                  USU5        U R                  USU5        M8     U$ )Nr   r\   )r	   rH  )rf   rK  rû   ÚkÚvÚkvds         r!   Ú_unjelly_dictionaryÚ_Unjellier._unjelly_dictionary)  sH   € ØˆÛ‰DˆAÜ" 1Ó%ˆCØ×Ñ˜S ! QÔ'Ø×Ñ˜S ! QÖ'ñ ð ˆr#   c                 óØ   • [        US   5      n[        U5      [        :w  a  [        S5      eU R                  R                  U5      (       d  [        SU< 35      e[        U0 0 S5      nU$ )Nr   z5Attempted to unjelly a module with a non-string name.z"Attempted to unjelly module named rè   )r   r   rs   râ   rŠ   r  Ú
__import__)rf   ÚrestÚ
moduleNameÚmods       r!   Ú_unjelly_moduleÚ_Unjellier._unjelly_module1  sf   € Ü! $ q¡'Ó*ˆ
Ü�
ÓœsÓ"ÜÐ WÓXÐXØ�{‰{×*Ñ*¨:×6Ñ6ÜÐ"DÀZÁNÐ SÓTÐTÜ˜ R¨¨SÓ1ˆØˆ
r#   c                 ó¾  • [        US   5      nUR                  [        S5      5      n[        S5      R                  US S 5      nU R                  R	                  U5      (       d  [        SU-  5      e[        U5      n[        U5      nU[        La  [        SU< SU< 35      eU R                  R                  U5      (       d  [        S[        U5      -  5      eU$ )Nr   r«   r  zmodule %s not allowedzclass z, unjellied to something that isn't a class: zclass not allowed: %s)
r   r  rÁ   rŠ   r  râ   r   r   rà   r   )rf   rs  ÚcnameÚclistr"  Úklausrä   s          r!   Ú_unjelly_classÚ_Unjellier._unjelly_class:  sÇ   € Ü˜T !™WÓ%ˆØ—‘œL¨Ó-Ó.ˆÜ˜sÓ#×(Ñ(¨¨s°¨Ó4ˆØ�{‰{×*Ñ*¨7×3Ñ3ÜÐ 7¸'Ñ AÓBÐBÜ˜EÓ"ˆÜ�u“+ˆØœ$ÒÝãš%ð!óð ð �{‰{×)Ñ)¨%×0Ñ0ÜÐ 7¼$¸u»+Ñ EÓFÐFØˆr#   c                 ó  • [        US   5      nUR                  [        S5      5      n[        S5      R                  US S 5      nU R                  R	                  U5      (       d  [        SU-  5      e[        U5      nU$ )Nr   r«   r  zModule not allowed: %s)r   r  rÁ   rŠ   r  râ   r   )rf   rs  ÚfnameÚmodSplitr"  Úfunctions         r!   Ú_unjelly_functionÚ_Unjellier._unjelly_functionK  sr   € Ü˜T !™WÓ%ˆØ—;‘;œ|¨CÓ0Ó1ˆÜ˜sÓ#×(Ñ(¨°#°2¨Ó7ˆØ�{‰{×*Ñ*¨7×3Ñ3ÜÐ 8¸7Ñ BÓCÐCä˜E“?ˆØˆr#   c                 óh   • U R                   (       a  U R                  US   U 5      nU$ [        S5      $ )Nr   zPersistent callback not found)r  rb   )rf   rs  Úploads      r!   Ú_unjelly_persistentÚ_Unjellier._unjelly_persistentU  s2   € Ø××Ø×'Ñ'¨¨Q©°Ó6ˆEØˆLä Ð!@ÓAÐAr#   c                 óˆ   • [         R                  " S[        SSS9  U R                  US   5      nU R	                  X!S   5      $ )z±
(internal) Unjelly an instance.

Called to handle the deprecated I{instance} token.

@param rest: The s-expression representing the instance.

@return: The unjellied instance.
ztUnjelly support for the instance atom is deprecated since Twisted 15.0.0.  Upgrade peer for modern instance support.Ú r   )ÚcategoryÚfilenameÚlinenor\   )ÚwarningsÚwarn_explicitÚDeprecationWarningr]   r  )rf   rs  r#  s      r!   Ú_unjelly_instanceÚ_Unjellier._unjelly_instance\  sJ   € ô 	×ÒðIä'ØØò	
ð �l‰l˜4 ™7Ó#ˆØ×#Ñ# C¨a©Ó1Ð1r#   c                 ó$   • [        SUS    35      $ )NzUnpersistable data: r   )rb   )rf   rs  s     r!   Ú_unjelly_unpersistableÚ!_Unjellier._unjelly_unpersistableq  s   € ÜÐ3°D¸±G°9Ð=Ó>Ð>r#   c                 óŽ  • US   nU R                  US   5      nU R                  US   5      n[        U[        5      (       d  [        S5      eX$R                  ;   a_  Uc  [        XB5      nU$ [        U[        5      (       a  [        X#U5      nU$ [        R                  " UR                  U   U/U/S-  Q76 n U$ [        S5      e)z
(internal) Unjelly a method.
r   r\   r    z"Method found with non-class class.Fzinstance method changed)r]   r   r   râ   r(   r.   r   r
   r·   r¸   rG   )rf   rs  Úim_nameÚim_selfÚim_classÚims         r!   Ú_unjelly_methodÚ_Unjellier._unjelly_methodt  sÔ   € ð �q‘'ˆØ—,‘,˜t A™wÓ'ˆØ—<‘<  Q¡Ó(ˆÜ˜(¤D×)Ñ)ÜÐ DÓEÐEØ×'Ñ'Ó'Ø‰Ü˜XÓ/�ð ˆ	ô ˜G¤X×.Ñ.Ü$ W°xÓ@�ð ˆ	ô ×%Ò%Ø×%Ñ% gÑ.°ðØ<D¸:ÈÑ;Oò‘ð
 ˆ	ô Ð5Ó6Ð6r#   )r�   r  r	  r  rŠ   N)"rD   ro   rp   rq   rg   r  r  r]   r  r*  r-  r0  r3  r8  r;  r?  rB  rH  rM  rR  rZ  r]  rb  rf  ri  ro  rv  r|  r‚  r†  r�  r“  rš  rt   ru   r#   r!   r  r  l  s–   † òòòò5ò<Nò"ò$ò7ò!ò<ò8ò8òYòòòò	òò$ò(5ò;òòòò"òBò2ò*?õr#   r  c                   ó   • \ rS rSrSrSrg)râ   iŽ  z‘
This exception will be raised when a jelly is deemed `insecure'; e.g. it
contains a type, class, or module disallowed by the specified `taster'
ru   N)rD   ro   rp   rq   rr   rt   ru   r#   r!   râ   râ   Ž  s   † ôr#   râ   c                   ó*   • \ rS rSrSrS rS rS rSrg)ÚDummySecurityOptionsi•  zo
DummySecurityOptions() -> insecure security options
Dummy security options -- this class will allow anything.
c                 ó   • g)zx
DummySecurityOptions.isModuleAllowed(moduleName) -> boolean
returns 1 if a module by that name is allowed, 0 otherwise
r\   ru   ©rf   rt  s     r!   r  Ú$DummySecurityOptions.isModuleAllowed›  ó   € ð
 r#   c                 ó   • g)z›
DummySecurityOptions.isClassAllowed(class) -> boolean
Assumes the module has already been allowed.  Returns 1 if the given
class is allowed, 0 otherwise.
r\   ru   ©rf   Úklasss     r!   rà   Ú#DummySecurityOptions.isClassAllowed¢  s   € ð r#   c                 ó   • g)zn
DummySecurityOptions.isTypeAllowed(typeName) -> boolean
Returns 1 if the given type is allowed, 0 otherwise.
r\   ru   ©rf   ÚtypeNames     r!   r´   Ú"DummySecurityOptions.isTypeAllowedª  r¢  r#   ru   N)	rD   ro   rp   rq   rr   r  rà   r´   rt   ru   r#   r!   rž  rž  •  s   † ñò
òõr#   rž  c                   óP   • \ rS rSrSr/ SQrS rS rS rS r	S r
S	 rS
 rS rSrg)ÚSecurityOptionsi²  z>
This will by default disallow everything, except for 'none'.
)
Ú
dictionaryrÒ   rÕ   Ú	referenceÚdereferencerá   rì   Úlong_intÚlongr'   c                 óŽ   • 0 SS_SS_SS_SS_SS_SS_SS_S	S_S
S_SS_SS_SS_SS_SS_SS_SS_U l         0 U l        0 U l        g)z
SecurityOptions() initialize.
r   r\   s   boolr¬   s   strings   strs   ints   floatr¯   r±   r²   r³   s   NoneTyper©   rù   r   r   N)ÚallowedTypesÚallowedModulesÚallowedClassesrl   s    r!   rg   ÚSecurityOptions.__init__Ä  sÚ   € ð
Ø�Qð
à�Qð
ð ˜ð
ð �qð	
ð
 �Að
ð �Að
ð �að
ð ˜ð
ð �Qð
ð �Qð
ð ˜!ð
ð ˜ð
ð ˜ð
ð ˜ð
ð �Að
ð  ˜!ð!
ˆÔð$ !ˆÔØ ˆÕr#   c                 ó6   • U R                   " U R                  6   g)zb
Allow all `basic' types.  (Dictionary and list.  Int, string, and float
are implicitly allowed.)
N)r;   Ú
basicTypesrl   s    r!   ÚallowBasicTypesÚSecurityOptions.allowBasicTypesß  s   € ð
 	�Š˜Ÿ™Ò)r#   c                 óÀ   • U HX  n[        U[        5      (       a  UR                  S5      n[        U[        5      (       d  [	        U5      nSU R
                  U'   MZ     g)zO
SecurityOptions.allowTypes(typeString): Allow a particular type, by its
name.
r2   r\   N)r   rs   r4   r3   r   r³  )rf   r·   Útyps      r!   r;   ÚSecurityOptions.allowTypesæ  sO   € ó
 ˆCÜ˜#œs×#Ñ#Ø—j‘j Ó)�Ü˜c¤5×)Ñ)Ü˜3“i�Ø%&ˆD×Ñ˜cÓ"ò r#   c                 óæ   • U R                  5         U R                  SSSS5        U HG  nU R                  [        U5      5        U R                  UR                  5        SU R
                  U'   MI     g)zÛ
SecurityOptions.allowInstances(klass, klass, ...): allow instances
of the specified classes

This will also allow the 'instance', 'class' (renamed 'classobj' in
Python 2.3), and 'module' types, as well as basic types.
r*   ÚclassÚclassobjrH   r\   N)r¹  r;   r   ÚallowModulesro   rµ  )rf   Úclassesr¥  s      r!   ÚallowInstancesOfÚ SecurityOptions.allowInstancesOfò  s`   € ð 	×ÑÔØ�‰˜
 G¨Z¸ÔBÛˆEØ�O‰OœD ›KÔ(Ø×Ñ˜e×.Ñ.Ô/Ø)*ˆD×Ñ Ó&ò r#   c                 óÒ   • U Ha  n[        U5      [        R                  :X  a  UR                  n[	        U[
        5      (       d  UR                  S5      nSU R                  U'   Mc     g)zs
SecurityOptions.allowModules(module, module, ...): allow modules by
name. This will also allow the 'module' type.
r2   r\   N)r   r·   r¼   rD   r   r3   r4   r´  )rf   ÚmodulesrH   s      r!   rÁ  ÚSecurityOptions.allowModules  sT   € ó
 ˆFÜ�F‹|œu×/Ñ/Ó/ØŸ™�ä˜f¤e×,Ñ,ØŸ™ wÓ/�à*+ˆD×Ñ Ó'ò r#   c                 ój   • [        U[        5      (       d  UR                  S5      nXR                  ;   $ )zs
SecurityOptions.isModuleAllowed(moduleName) -> boolean
returns 1 if a module by that name is allowed, 0 otherwise
r2   )r   r3   r4   r´  r   s     r!   r  ÚSecurityOptions.isModuleAllowed  s0   € ô
 ˜*¤e×,Ñ,Ø#×*Ñ*¨7Ó3ˆJà×0Ñ0Ñ0Ð0r#   c                 ó   • XR                   ;   $ )z–
SecurityOptions.isClassAllowed(class) -> boolean
Assumes the module has already been allowed.  Returns 1 if the given
class is allowed, 0 otherwise.
)rµ  r¤  s     r!   rà   ÚSecurityOptions.isClassAllowed  s   € ð ×+Ñ+Ñ+Ð+r#   c                 ó‚   • [        U[        5      (       d  UR                  S5      nXR                  ;   =(       d    SU;   $ )zi
SecurityOptions.isTypeAllowed(typeName) -> boolean
Returns 1 if the given type is allowed, 0 otherwise.
r2   ó   .)r   r3   r4   r³  r¨  s     r!   r´   ÚSecurityOptions.isTypeAllowed!  s8   € ô
 ˜(¤E×*Ñ*Ø—‘ wÓ/ˆHà×,Ñ,Ñ,×@°¸Ñ0@Ð@r#   )rµ  r´  r³  N)rD   ro   rp   rq   rr   r¸  rg   r¹  r;   rÃ  rÁ  r  rà   r´   rt   ru   r#   r!   r¬  r¬  ²  s7   † ñò€Jò!ò6*ò
'ò+ò,ò1ò,õAr#   r¬  c                 ó8   • [        XU5      R                  U 5      $ )zê
Serialize to s-expression.

Returns a list which is the serialized representation of an object.  An
optional 'taster' argument takes a SecurityOptions and will mark any
insecure objects as unpersistable rather than serializing them.
)rˆ   rU   )r—   rŠ   r�   r�   s       r!   rU   rU   0  s   € ô �F¨WÓ5×;Ñ;¸FÓCÐCr#   c                 ó8   • [        XU5      R                  U 5      $ )a<  
Unserialize from s-expression.

Takes a list that was the result from a call to jelly() and unserializes
an arbitrary object from it.  The optional 'taster' argument, an instance
of SecurityOptions, will cause an InsecureJelly exception to be raised if a
disallowed type, module, or class attempted to unserialize.
)r  r  )r¡   rŠ   r  r�   s       r!   r]   r]   ;  s   € ô �f¨gÓ6×BÑBÀ4ÓHÐHr#   r&   )Err   r”   r¾   rÏ   r·   r�  Ú	functoolsr   Úzope.interfacer   Úincrementalr   Útwisted.persisted.crefutilr   r   r   r	   r
   r   Útwisted.python.compatr   Útwisted.python.deprecater   Útwisted.python.reflectr   r   r   Útwisted.spread.interfacesr   r   r'   r×   Ú	None_atomÚ
class_atomÚmodule_atomÚfunction_atomr–   rß   r•   rÙ   rÔ   rÜ   rÖ   r   rÞ   r  r9   r@   r"   r0   r7   r>   rB   rN   rZ   r`   rb   rw   r€   rˆ   r  Ú	Exceptionrâ   rž  r¬  r:   r¹  rU   r]   ru   r#   r!   Ú<module>rÞ     s¯  ðñ
8ót Û Û ó Û Ý å &å ÷÷ õ /Ý >ß >Ñ >ß >àˆG€	à€	à€
Ø€Ø€ð "Ð Ø€Ø€ð  €Ø€	Ø€ð €
Ø€Ø€ñ ÙˆI�r˜1˜aÓ Ø-ØØô	ð &Ð ØÐ ØÐ ò ò ò(	ò)ò2)ô(&BòR
'ò	÷7ñ 7ñ  ˆZÓ÷+ð +ó ð+ñ. ˆ\Ó÷ð ó ð÷(Lñ L÷^\ñ \ôD	�Iô ÷ñ ÷:wAñ wAñt !Ó"€Ø × Ñ Ô  ñ .Ó/ÀÈtô Dñ .Ó/ÀÈdõ 	Ir#   