/usr/lib/python3/dist-packages/landscape/lib/__pycache__
NameSizeModeActions
amp.cpython-310.pyc217830644editdlrm
backoff.cpython-310.pyc21370644editdlrm
base64.cpython-310.pyc3330644editdlrm
bootstrap.cpython-310.pyc22770644editdlrm
bpickle.cpython-310.pyc66580644editdlrm
cli.cpython-310.pyc5810644editdlrm
cloud.cpython-310.pyc18610644editdlrm
compat.cpython-310.pyc6060644editdlrm
config.cpython-310.pyc102180644editdlrm
disk.cpython-310.pyc40800644editdlrm
encoding.cpython-310.pyc7590644editdlrm
fd.cpython-310.pyc9510644editdlrm
fetch.cpython-310.pyc72350644editdlrm
format.cpython-310.pyc8920644editdlrm
fs.cpython-310.pyc35930644editdlrm
gpg.cpython-310.pyc21700644editdlrm
hashlib.cpython-310.pyc4080644editdlrm
jiffies.cpython-310.pyc13520644editdlrm
juju.cpython-310.pyc8070644editdlrm
lock.cpython-310.pyc10650644editdlrm
log.cpython-310.pyc6710644editdlrm
logging.cpython-310.pyc23660644editdlrm
message.cpython-310.pyc21270644editdlrm
monitor.cpython-310.pyc72000644editdlrm
network.cpython-310.pyc90150644editdlrm
os_release.cpython-310.pyc12490644editdlrm
persist.cpython-310.pyc177870644editdlrm
plugin.cpython-310.pyc25650644editdlrm
process.cpython-310.pyc43830644editdlrm
reactor.cpython-310.pyc101080644editdlrm
schema.cpython-310.pyc71550644editdlrm
scriptcontent.cpython-310.pyc6740644editdlrm
sequenceranges.cpython-310.pyc49200644editdlrm
store.cpython-310.pyc12200644editdlrm
sysstats.cpython-310.pyc77650644editdlrm
tag.cpython-310.pyc8790644editdlrm
testing.cpython-310.pyc261940644editdlrm
timestamp.cpython-310.pyc4360644editdlrm
twisted_util.cpython-310.pyc47360644editdlrm
user.cpython-310.pyc9080644editdlrm
versioning.cpython-310.pyc16480644editdlrm
vm_info.cpython-310.pyc28240644editdlrm
warning.cpython-310.pyc6150644editdlrm
__init__.cpython-310.pyc3520644editdlrm
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/schema.cpython-310.pyc (7155B)
o ¶žâc9ã@sÜdZddlmZmZmZGdd„deƒZGdd„deƒZGdd„deƒZ Gd d „d eƒZ Gd d „d eƒZ Gd d„deƒZ Gdd„deƒZ Gdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZdS)z"A schema system. Yes. Another one!é)Ú iteritemsÚunicodeÚlongc@seZdZdZdS)Ú InvalidErrorz&Raised when invalid input is received.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__©r r ú6/usr/lib/python3/dist-packages/landscape/lib/schema.pyrsrc@ó eZdZdZdd„Zdd„ZdS)ÚConstantz1Something that must be equal to a constant value.cCó ||_dS©N)Úvalue©Úselfrr r r Ú__init__ ó zConstant.__init__cCsVt|jtƒrt|tƒrz| ¡}Wn tyYnw||jkr)td||jfƒ‚|S)Nz%r != %r)Ú isinstancerÚstrÚbytesÚdecodeÚUnicodeDecodeErrorrrr r r Úcoerces  ÿ zConstant.coerceN©rrrr rrr r r r r s r c@r )ÚAnyzsSomething which must apply to any of a number of different schemas. @param schemas: Other schema objects. cGrr)Úschemas)rrr r r r rz Any.__init__c Cs@|jD]}z| |¡WStyYqwtd||jfƒ‚)zˆ The result of the first schema which doesn't raise L{InvalidError} from its C{coerce} method will be returned. z!%r did not match any schema in %s)rrr)rrÚschemar r r r#s  ÿÿz Any.coerceNrr r r r ró rc@óeZdZdZdd„ZdS)ÚBoolz!Something that must be a C{bool}.cCst|tƒs td|fƒ‚|S)Nz%r is not a bool)rÚboolrrr r r r3s z Bool.coerceN©rrrr rr r r r r!1ó r!c@r )ÚIntz,Something that must be an C{int} or C{long}.cCs t|ttfƒstd|fƒ‚|S)Nz%r isn't an int or long)rÚintrrrr r r r;sz Int.coerceNr#r r r r r%9r$r%c@r )ÚFloatz7Something that must be an C{int}, C{long}, or C{float}.cCs"t|tttfƒstd|fƒ‚|S)Nz%r isn't a float)rr&rÚfloatrrr r r rCsz Float.coerceNr#r r r r r'Ar$r'c@r )ÚBytesziA binary string. If the value is a Python3 str (unicode), it will be automatically encoded. cCs,t|tƒr|St|tƒr| ¡Std|ƒ‚)Nz%r isn't a bytestring)rrrÚencoderrr r r rOs   z Bytes.coerceNr#r r r r r)Is r)c@s"eZdZdZddd„Zdd„ZdS) ÚUnicodez³Something that must be a C{unicode}. If the value is a C{str}, it will automatically be decoded. @param encoding: The encoding to automatically decode C{str}s with. úutf-8cCrr)Úencoding)rr-r r r rarzUnicode.__init__c Csdt|tƒr$z| |j¡}Wnty#}z td|t|ƒfƒ‚d}~wwt|tƒs0td|fƒ‚|S)Nz%r can't be decoded: %sz%r isn't a unicode)rrrr-rrrr)rrÚer r r rds €ÿ zUnicode.coerceN)r,rr r r r r+Ys  r+c@r )ÚListznSomething which must be a C{list}. @param schema: The schema that all values of the list must match. cCrr©r©rrr r r rtrz List.__init__c Csvt|tƒs td|fƒ‚t|ƒ}t|ƒD]$\}}z |j |¡||<Wqty8}z td||j|fƒ‚d}~ww|S)Nz%r is not a listz%r could not coerce with %s: %s)rÚlistrÚ enumeraterr)rrÚnew_listÚiÚsubvaluer.r r r rws  ÿÿ€ÿz List.coerceNrr r r r r/orr/c@r )ÚTuplez¤Something which must be a fixed-length tuple. @param schema: A sequence of schemas, which will be applied to each value in the tuple respectively. cGrrr0r1r r r rŒrzTuple.__init__cCsxt|tƒs td|fƒ‚t|ƒt|jƒkr#tdt|jƒt|ƒ|fƒ‚g}t|j|ƒD] \}}| | |¡¡q+t|ƒS)Nz%r is not a tuplezNeed %s items, got %s in %r)rÚtuplerÚlenrÚzipÚappendr)rrÚ new_valuerr r r rs ÿz Tuple.coerceNrr r r r r7…s r7c@s"eZdZdZddd„Zdd„ZdS)ÚKeyDictzéSomething which must be a C{dict} with defined keys. The keys must be constant and the values must match a per-key schema. @param schema: A dict mapping keys to schemas that the values of those keys must match. NcCs |durg}t|ƒ|_||_dSr)ÚsetÚoptionalr)rrr?r r r r£s  zKeyDict.__init__c CsÒi}t|tƒstd|fƒ‚t|ƒD]7\}}||jvr$td||jfƒ‚z |j| |¡||<WqtyI}z td|||j||fƒ‚d}~wwt| ¡ƒ}t|j ¡ƒ|j}||}|rgtd|fƒ‚|S)Nú%r is not a dict.z%r is not a valid key as per %rz7Value of %r key of dict %r could not coerce with %s: %szMissing keys %s) rÚdictrrrrr>Úkeysr?) rrÚnew_dictÚkÚvr.Únew_keysÚ required_keysÚmissingr r r r©s0  ÿÿÿ€ÿ zKeyDict.coercerrr r r r r=›s  r=c@r )ÚDictz°Something which must be a C{dict} with arbitrary keys. @param key_schema: The schema that keys must match. @param value_schema: The schema that values must match. cCs||_||_dSr)Ú key_schemaÚ value_schema)rrJrKr r r rÆs z Dict.__init__cCsJt|tƒs td|fƒ‚i}| ¡D]\}}|j |¡||j |¡<q|S)Nr@)rrArÚitemsrKrrJ)rrrCrDrEr r r rÊs z Dict.coerceNrr r r r rI¿s rIN)r Útwisted.python.compatrrrÚ ExceptionrÚobjectr rr!r%r'r)r+r/r7r=rIr r r r Ús$