ó
    Ù^íh  ã                  ó<   • S r SSKJr  SSKJrJrJrJr  SS jrS r	g)	zhCode for converting notebooks to and from the v2 format.

Authors:

* Brian Granger
* Jonathan Frederic
é    )Úannotationsé   )Únew_code_cellÚnew_notebookÚnew_text_cellÚnew_worksheetc                ó¬  • US:X  aÁ  [        5       n[        5       nU R                   H€  nUR                  S:X  a)  [	        UR                  S5      UR                  S5      S9nO)UR                  S:X  a  [        SUR                  S5      S9nUR                  R                  W5        M‚     UR                  R                  U5        U$ [        SU-  5      e)	zÌConvert a notebook to the v2 format.

Parameters
----------
nb : NotebookNode
    The Python representation of the notebook to convert.
from_version : int
    The version of the notebook to convert from.
r   ÚcodeÚprompt_number)Úinputr   ÚtextÚmarkdown)Úsourcez(Cannot convert a notebook from v%s to v2)
r   r   ÚcellsÚ	cell_typer   Úgetr   ÚappendÚ
worksheetsÚ
ValueError)ÚnbÚfrom_versionÚnewnbÚwsÚcellÚnewcells         ÚM/home/james-whalen/.local/lib/python3.13/site-packages/nbformat/v2/convert.pyÚupgrader      s´   € ð qÓÜ“ˆÜ‹_ˆØ—H”HˆDØ~‰~ Ó'Ü'ØŸ(™( 6Ó*¸$¿(¹(À?Ó:Sñ‘ð —‘ 6Ó)Ü'¨
¸4¿8¹8ÀFÓ;KÑLØH‰HO‰O˜GÖ$ñ ð 	×Ñ×Ñ Ô#Øˆä
Ð?À,ÑNÓ
OÐOó    c                ó   • Sn[        U5      e)z€Convert a v2 notebook to v1.

Parameters
----------
nb : NotebookNode
    The Python representation of the notebook to convert.
z2Downgrade from notebook v2 to v1 is not supported.)Ú	Exception)r   Úmsgs     r   Ú	downgrader"   7   s   € ð ?€CÜ
C‹.Ðr   N)r   )
Ú__doc__Ú
__future__r   Únbbaser   r   r   r   r   r"   © r   r   Ú<module>r'      s    ðñõ$ #ç MÓ MôPó6	r   