
    Ib3                     0    d dl Z d dlZd dlZd dlZd Zd Zy)    Nc                      dddddgS )z&Metadata for notebook bundlerextensiontarball_bundlerz notebook.bundler.tarball_bundlerzNotebook Tarball (tar.gz)download)namemodule_namelabelgroup r
       B/usr/lib/python3/dist-packages/notebook/bundler/tarball_bundler.py_jupyter_bundlerextension_pathsr      s     "9-	 	 	r   c                 n   |d   }t        j                  |d         j                  d      }t        j                  j                  |      d   }| d}t        j                  |      }t        |      |_	        t        j                         5 }t        j                  |d|      5 }|j                  |t        j                  |             ddd       | j                  |       | j                  d	d
       | j!                  |j#                                ddd       y# 1 sw Y   TxY w# 1 sw Y   yxY w)a  Create a compressed tarball containing the notebook document.

    Parameters
    ----------
    handler : tornado.web.RequestHandler
        Handler that serviced the bundle request
    model : dict
        Notebook model from the configured ContentManager
    r   contentzutf-8r   z.tar.gzzw:gz)fileobjNzContent-Typezapplication/gzip)nbformatwritesencodeospathsplitexttarfileTarInfolensizeioBytesIOopenaddfileset_attachment_header
set_headerfinishgetvalue)	handlermodelnotebook_filenamenotebook_contentnotebook_nametar_filenameinfo
tar_buffertars	            r   bundler,      s    fuY'78??HGG$$%67:M#_G,L??,-D$%DI	 .\\,
C 	<sKKbjj)9:;	< 	%%l3>+=> 	z**,-. .	< 	<. .s%   D+&&DA
D+D(	$D++D4)r   r   r   r   r   r,   r
   r   r   <module>r-      s    
 	  .r   