o
    Rŀg                     @   sF   d Z zddlZ[W n ey   ddlmZ eddw dddZdS )	zCBio.Graphics offers several graphical outputs, all using ReportLab.    NMissingPythonDependencyErrorzPlease install ReportLab if you want to use Bio.Graphics. You can find ReportLab at http://www.reportlab.com/software/opensource/H   c                 C   s   ddl m} ddl m} ddl m} zddl m} W n ty%   d}Y nw ||||||||||d
}z||  }	W n ttfyO   t	dd	
| dw |	du r^dd
lm}
 |
d|	|krk|	j| |||dS |	| |S )a:  Standardize output to files (PRIVATE).

    Writes the provided drawing out to a file in a prescribed format.

      - drawing - suitable ReportLab drawing object.
      - output_file - a handle to write to, or a filename to write to.
      - format - String indicating output format, one of PS, PDF, SVG,
        or provided the ReportLab renderPM module is installed,
        one of the bitmap formats JPG, BMP, GIF, PNG, TIFF or TIFF.
        The format can be given in any case.
      - dpi - Resolution (dots per inch) for bitmap formats.

    No return value.
    r   )	renderPDF)renderPS)	renderSVG)renderPMN)
PSEPSPDFSVGJPGBMPGIFPNGTIFFTIFzOutput format should be one of z, r   z*Please install ReportLab's renderPM module)dpi)reportlab.graphicsr   r   r   r   ImportErrorupperKeyErrorAttributeError
ValueErrorjoinBior   
drawToFile)drawingoutput_fileformatr   r   r   r   r   
formatdict
drawmethodr    r"   I/var/www/html/myenv/lib/python3.10/site-packages/Bio/Graphics/__init__.py_write   sD   r$   )r   )__doc__	reportlabrr   r   r   r$   r"   r"   r"   r#   <module>   s   