
    d1                     |    d Z ddlmZ dZ	 d Zd Zd Zd Zd Zd	 Z	d
 Z
d Zd Zd Zd Zd Zd Zd Zd Zd ZdS )aS  Support for undoing and redoing actions.

Functions:

* undo(file, operation, *args)
* redo(file, operation, *args)
* move_to_shadow(file, path)
* move_from_shadow(file, path)
* attr_to_shadow(file, path, name)
* attr_from_shadow(file, path, name)

Misc variables:

`__docformat__`
    The format of documentation strings in this module.

   )
split_pathreStructuredTextc                 |   |dk    rt          | |d                    d S |dk    rt          | |d                    d S |dk    rt          | |d         |d                    d S |dk    rt          | |d         |d                    d S |dk    rt	          | |d         |d                    d S t          d|z            )	NCREATE    REMOVEMOVEr   ADDATTRDELATTRzWthe requested unknown operation %r can not be undone; please report this to the authors)undo_createundo_remove	undo_moveundo_add_attrundo_del_attrNotImplementedErrorfile_	operationargss      /lib/python3.11/site-packages/tables/undoredo.pyundor          HE47#####	h		E47#####	f		%a$q'*****	i		eT!Wd1g.....	i		eT!Wd1g.....! #,.7#8 9 9 	9    c                 |   |dk    rt          | |d                    d S |dk    rt          | |d                    d S |dk    rt          | |d         |d                    d S |dk    rt          | |d         |d                    d S |dk    rt	          | |d         |d                    d S t          d|z            )	Nr   r   r   r	   r   r
   r   zWthe requested unknown operation %r can not be redone; please report this to the authors)redo_createredo_remove	redo_moveredo_add_attrredo_del_attrr   r   s      r   redor    +   r   r   c                     |                      |          }|                                 \  }}|                    ||           d S N)	_get_node_shadow_name_g_move)r   pathnodeshparentshnames        r   move_to_shadowr*   <   sC    ??4  D++--XvLL6"""""r   c                     |                                  \  }}|                    |          }t          |          \  }}|                     |          }|                    ||           d S r"   )r$   _f_get_childr   r#   r%   )r   r&   r(   r)   r'   pnamenameparents           r   move_from_shadowr0   C   sg    ++--Xv  ((Dt$$MUD__U##FLLr   c                 &    t          | |           d S r"   r*   r   r&   s     r   r   r   L       5$r   c                 &    t          | |           d S r"   r0   r3   s     r   r   r   P       UD!!!!!r   c                 &    t          | |           d S r"   r6   r3   s     r   r   r   T   r7   r   c                 &    t          | |           d S r"   r2   r3   s     r   r   r   X   r4   r   c                     t          |          \  }}|                     |          }|                     |          }|                    ||           d S r"   r   r#   r%   )r   origpathdestpath	origpnameorignamer'   
origparents          r   r   r   \   P    &x00Y??8$$D++JLLX&&&&&r   c                     t          |          \  }}|                     |          }|                     |          }|                    ||           d S r"   r;   )r   r<   r=   	destpnamedestnamer'   
destparents          r   r   r   d   rA   r   c                     |                      |          }|j        }t          ||          }|                                 \  }}|j        }||vr|                    ||           |                    |           d S r"   )r#   _v_attrsgetattrr$   _g__setattr_g__delattr)	r   r&   r.   r'   attrsvaluer(   r)   shattrss	            r   attr_to_shadowrN   l   s    ??4  DMEE4  E++--XvG WFE***	dr   c                     |                                  \  }}|j        }t          ||          }|                     |          }|j                            ||           d S r"   )r$   rG   rH   r#   rI   )r   r&   r.   r(   r)   rM   rL   r'   s           r   attr_from_shadowrP   |   s^    ++--XvGGV$$E??4  DMdE*****r   c                 (    t          | ||           d S r"   rN   r   r&   r.   s      r   r   r          5$%%%%%r   c                 (    t          | ||           d S r"   rP   rS   s      r   r   r          UD$'''''r   c                 (    t          | ||           d S r"   rV   rS   s      r   r   r      rW   r   c                 (    t          | ||           d S r"   rR   rS   s      r   r   r      rT   r   N)__doc__r&   r   __docformat__r   r    r*   r0   r   r   r   r   r   r   rN   rP   r   r   r   r    r   r   <module>r]      s'   $       # 99 9 9"9 9 9"# # #       " " "" " "     ' ' '' ' '   + + +& & &( ( (( ( (& & & & &r   