
    Eh;
                    >    S r SSKJr  SSKJr  SSKJr  SSKJr  S r	g)	z.API for converting notebooks between versions.    )annotations   )versions)get_version)ValidationErrorc                   [        U 5      u  p#X!:X  a  U $ U[        ;   ar  X:  a  US-   n[        U   R                  nOUS-
  n[        U   R                  n U" U 5      nUR	                  SS5      U:X  a  SX$4-  n[        U5      e [        Xa5      $ [        SU-  5      e! [         a  nSU SU SU 3n[        U5      SeSnAff = f)	a  Convert a notebook node object to a specific version.  Assumes that
all the versions starting from 1 to the latest major X are implemented.
In other words, there should never be a case where v1 v2 v3 v5 exist without
a v4.  Also assumes that all conversions can be made in one step increments
between major versions and ignores minor revisions.

Parameters
----------
nb : NotebookNode
to_version : int
    Major revision to convert the notebook to.  Can either be an upgrade or
    a downgrade.

Raises
------
ValueError
    Notebook failed to convert.
ValueError
    The version specified is invalid or doesn't exist.
ValidationError
    Conversion failed due to missing expected attributes.
r   nbformatz+Failed to convert notebook from v%d to v%d.z-Notebook could not be converted from version z to version z because it's missing a key: NzACannot convert notebook to v%d because that version doesn't exist)	r   r   upgrade	downgradeget
ValueErrorAttributeErrorr   convert)	nb
to_versionversionversion_minorstep_versionconvert_function	convertedmsges	            eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\nbformat/converter.pyr   r      s   2  +2W 	 X "Q;L'5=="Q;L'0::	1(,I}}Z+w6CwF]] o% 7 y--
KzZ   	1A',WcVd  eB  CD  BE  FC!#&D0	1s   /B 
C)C  CN)
__doc__
__future__r    r   readerr   	validatorr   r        r   <module>r!      s    4 #   &9r    