
     i                         d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lm	Z	 ddlm
Z
 dededej        fdZdS )a`  
Selection exporters
===================

Functions to write a :class:`MDAnalysis.core.groups.AtomGroup` selection
to a file so that it can be used in another programme.

:mod:`MDAnalysis.selections.vmd`
    VMD_ selections
:mod:`MDAnalysis.selections.pymol`
    PyMol_ selections
:mod:`MDAnalysis.selections.gromacs`
    Gromacs_ selections
:mod:`MDAnalysis.selections.charmm`
    CHARMM_ selections

The :class:`MDAnalysis.selections.base.SelectionWriterBase` base class and
helper functions are in :mod:`MDAnalysis.selections.base`, with the
exception of `:func:get_writer`:

.. autofunction:: get_writer
    N   )_SELECTION_WRITERS   )base)vmd)pymol)gromacs)charmm)jmolfilenamedefaultformatreturnc                 D   d}| r-t           j                            |           d         dd         }|p|}|                                                                }	 t
          |         S # t          $ r+ d| dt          j                     d}t          |          dw xY w)a  Return a SelectionWriter for `filename` or a `defaultformat`.

    Parameters
    ----------
    filename : str
       name of the output file; the extension is used to guess the file format
    defaultformat : str
       if `filename` does not have an extension, use `defaultformat` instead

    Returns
    -------
    SelectionWriterBase : `type`
        the writer *class* for the detected format

    Raises
    ------
    :exc:`NotImplementedError`
        for any format that is not defined
    Nr   zWriting as z is not implemented; only z will work.)	ospathsplitextstripupperr   KeyErrorkeysNotImplementedError)r   r   formaterrmsgs       h/srv/www/vhosts/g4struct/public_html/venv/lib/python3.11/site-packages/MDAnalysis/selections/__init__.py
get_writerr   ;   s    ( F 3!!(++A.qrr2$}F\\^^!!##F4!&)) 4 4 47& 7 7"'))7 7 7 	 "&))t34s   A* *5B)__doc__os.pathr    r   r   r   r   r	   r
   r   strSelectionWriterBaser        r   <module>r#      s   2 ,  ! ! ! ! ! !                                     4  4S  4T5M  4  4  4  4  4  4r"   