%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/fail2ban/client/ |
Current File : //lib/python2.7/site-packages/fail2ban/client/configparserinc.pyc |
� ��&dc @ s d Z d Z d Z d d l Z d d l Z d d l Z d d l m Z e j d k r� d d l m Z m Z m Z m Z m Z d e f d � � YZ n@ d d l m Z m Z m Z m Z e j e _ d � Z e e _ d � Z e e � Z d Z d g Z d e f d � � YZ d S( s0 Yaroslav Halchenko, Serg G. Brester (aka sebres)sH Copyright (c) 2007 Yaroslav Halchenko, 2015 Serg G. Brester (aka sebres)t GPLi����Ni ( t getLoggeri ( t ConfigParsert BasicInterpolationt InterpolationMissingOptionErrort NoOptionErrort NoSectionErrort BasicInterpolationWithNamec B s e Z d Z d � Z RS( s� Decorator to bring __name__ interpolation back. Original handling of __name__ was removed because of functional deficiencies: http://bugs.python.org/issue10489 commit v3.2a4-105-g61f2761 Author: Lukasz Langa <lukasz@langa.pl> Date: Sun Nov 21 13:41:35 2010 +0000 Issue #10489: removed broken `__name__` support from configparser But should be fine to reincarnate for our use case c O sm | ri t | k ri | j � } | | d <| j | | | | � t t | � j | | | | | | | | � Sd S( Nt __name__( R t copyt _map_section_optionst superR t _interpolate_some( t selft parsert optiont accumt restt sectiont mapt argst kwargs( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyR 6 s ( R t __module__t __doc__R ( ( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyR ( s ( t SafeConfigParserR R R c O s5 | j | | | | � | j | | | | | | | � S( N( R t _cp_interpolate_some( R R R R R R R R ( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyR F s c C sp g } xc | D][ } | j | � t j j | � d d } | | k r t j j | � r | j | � q q W| S( s, Expands config files with local extension. i s .local( t appendt ost patht splitextt isfile( t filenamest newFilenamest filenamet localname( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyt _expandConfFilesWithLocalL s i t SafeConfigParserWithIncludesc B s� e Z d Z d Z e j d � Z e j d � Z e j d � Z e j d k r] d d � Z n d d � Z e i d � Z d � Z e d � � Z d � Z g d � Z g d � Z d � Z d � Z e d � Z e d � Z d d � Z RS( s Class adds functionality to SafeConfigParser to handle included other configuration files (or may be urls, whatever in the future) File should have section [includes] and only 2 options implemented are 'files_before' and 'files_after' where files are listed 1 per line. Example: [INCLUDES] before = 1.conf 3.conf after = 1.conf It is a simple implementation, so just basic care is taken about recursion. Includes preserve right order, ie new files are inserted to the list of read configs before original, and their includes correspondingly so the list should follow the leaves of the tree. I wasn't sure what would be the right way to implement generic (aka c++ template) so we could base at any *configparser class... so I will leave it for the future t INCLUDESs ^([\w\-]+)/([^\s>]+)$s %\(([\w\-]+/([^\)]+))\)ss ^(\w+)(\?.+)$i i c O sI | j � } t � | d <d | d <t t | � j | | � | | _ d S( Nt interpolationt ;t inline_comment_prefixes( R R R R$ t __init__t _cfg_share( R t share_configR R ( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyR) � s c O s t j | | | � | | _ d S( N( R R) R* ( R R+ R R ( ( sC /usr/lib/python2.7/site-packages/fail2ban/client/configparserinc.pyR) � s c C s d } d | k r'