File Viewer

Download
a

�<�e��@sHddlmmZddlmZddlmZddlmZGdd�d�Z	dS)�N)�Frame)�TEMPLATE)�Pathc@s0eZdZed�dd�Zed�dd�Zdd�Zd	S)
�Designer)�output_pathcCs*||_t�||�|_|j��|_d|_dS)Nr)r�	endpointsZFiles�
figma_fileZget_file�	file_data�frameCounter)�self�token�file_keyr�r�F/Users/pranavzagade/PycharmProjects/LuciaVision/tkdesigner/designer.py�__init__	szDesigner.__init__)�returnc	Csvg}|jddddD]V}zt||j|j|j�}WntyPtd��Yn0|�|�t��|jd7_q|S)zReturn main code.
        Zdocument�childrenrz)Frame not found in figma file or is empty�)	r	rrrr
�	Exception�append�to_coder)rZframes�f�framerrrrszDesigner.to_codecCsd|��}tt|��D]J}|dkr<|j�d�j||dd�q|j�d|�d��j||dd�qdS)z<Write code and assets to the specified directories.
        rzgui.pyzUTF-8)�encodingZguiz.pyN)r�range�lenr�joinpath�
write_text)r�code�indexrrr�designs
zDesigner.designN)�__name__�
__module__�__qualname__rr�strrr rrrrrsr)
Ztkdesigner.figma.endpointsZfigmarZtkdesigner.figma.framerZtkdesigner.templater�pathlibrrrrrr�<module>s