관리-도구
편집 파일: ColorDelegator.cpython-35.pyc
��Yff) � @ s d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d Z d d � Z d d � Z e j e � e j � Z e j d e j � Z d d � Z Gd d � d e � Z d d � Z e d k r� d d l m Z e e � d S)� N)� TkVersion)� Delegator)�idleConfFc C s d | d j | � d S)z9Return a named group pattern matching list of alternates.z(?P<%s>�|�))�join)�nameZ alternates� r �;/opt/alt/python35/lib64/python3.5/idlelib/ColorDelegator.py�any s r c C s� d t d t j � d } d d � t t � D� } d t d | � d } t d d g � } d } | d } | d } | d } | d } t d | | | | g � } | d | d | d | d t d d g � S)Nz\b�KEYWORDc S s; g | ]1 } | j d � r | t j k r t | � � q S)�_)� startswith�keyword�kwlist�str)�.0r r r r � <listcomp> s zmake_pat.<locals>.<listcomp>z([^.'\"\\#]\b|^)�BUILTIN�COMMENTz#[^\n]*z4(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR|rb|rB|Rb|RB)?z'[^'\\\n]*(\\.[^'\\\n]*)*'?z"[^"\\\n]*(\\.[^"\\\n]*)*"?z''''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?z'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?�STRINGr �SYNCz\n)r r r �dir�builtins) �kwZbuiltinlist�builtin�commentZstringprefixZsqstringZdqstringZ sq3stringZ dq3string�stringr r r �make_pat s r z\s+(\w+)c C s� t j � } t j | d � } t j | d d d �} t j | d � } | j d | d d | d d | d | d d | d � t d k r� | j d | d � d S)z_Set color opitons of Text widget. Should be called whenever ColorDelegator is called. ZnormalZcursorZfgBgZfgZhilite� foreground� backgroundZinsertbackgroundZselectforegroundZselectbackgroundg !@ZinactiveselectbackgroundN)r �CurrentTheme�GetHighlight�configr )�text�themeZ normal_colorsZcursor_colorZ select_colorsr r r �color_config$ s r&