관리-도구
편집 파일: rewriter.cpython-37.pyc
B �M!Vd � @ s, d dl mZ d dlmZ G dd� de�ZdS )� )�util)�opsc @ s� e Zd ZdZe�� ZdZdd� Zdd� Z dd� Z d d � Zdd� Ze� ej�d d� �Ze� ej�dd� �Ze� ej�dd� �Zdd� Zdd� Zdd� ZdS )�RewriteraP A helper object that allows easy 'rewriting' of ops streams. The :class:`.Rewriter` object is intended to be passed along to the :paramref:`.EnvironmentContext.configure.process_revision_directives` parameter in an ``env.py`` script. Once constructed, any number of "rewrites" functions can be associated with it, which will be given the opportunity to modify the structure without having to have explicit knowledge of the overall structure. The function is passed the :class:`.MigrationContext` object and ``revision`` tuple that are passed to the :paramref:`.Environment Context.configure.process_revision_directives` function normally, and the third argument is an individual directive of the type noted in the decorator. The function has the choice of returning a single op directive, which normally can be the directive that was actually passed, or a new directive to replace it, or a list of zero or more directives to replace it. .. seealso:: :ref:`autogen_rewriter` - usage example .. versionadded:: 0.8 Nc C s t �� | _d S )N)r � Dispatcher�dispatch)�self� r �N/opt/alt/python37/lib/python3.7/site-packages/alembic/autogenerate/rewriter.py�__init__% s zRewriter.__init__c C s&