Format: application/x-python-code
1 o
2
3 ��h0 � @ s, d Z ddlZddlmZ G dd� de�ZdS )z>String dispatch class to match regexps and dispatch commands.
4 � N)�CommandChainDispatcherc @ sL e Zd ZdZdd� Zddd�Zddd�Zd d
5 � Zdd� Zd
6 d� Z dd� Z
7 dS )�StrDispatcha Dispatch (lookup) a set of strings / regexps for match.
8
9 Example:
10
11 >>> dis = StrDispatch()
12 >>> dis.add_s('hei',34, priority = 4)
13 >>> dis.add_s('hei',123, priority = 2)
14 >>> dis.add_re('h.i', 686)
15 >>> print(list(dis.flat_matches('hei')))
16 [123, 34, 686]
17 c C s i | _ i | _d S )N��strs�regexs��self� r �Oc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/strdispatch.py�__init__ s
18 zStrDispatch.__init__r c C �* | j �|t� �}|�||� || j |<