Current Path : /usr/share/fail2ban/client/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/share/fail2ban/client/configparserinc.pyc |
łň E˛óSc @ sc d Z d Z d Z d d k Z d d k Z d d k l Z e i d Z d e f d YZ d S( s Yaroslav Halhenkos% Copyright (c) 2007 Yaroslav Halchenkot GPLi˙˙˙˙N( t SafeConfigParsers fail2ban.client.configt SafeConfigParserWithIncludesc B s5 e Z d Z d Z g d Z e e Z 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 INCLUDESc C sK t } t } | i | t i i | } d g f d g f g } | i | i j oĐ xÍ | D]Á \ } } | | i | i j o | i | i | } x | i d D]o } t i i | o | } n t i i | | } | | j o q n | | g } | | i | | 7} q Wqc qc Wn | d d | g | d d S( s Given 1 config resource returns list of included files (recursively) with the original one as well Simple loops are taken care about t beforet afters i i ( R R t readt ost patht dirnamet SECTION_NAMEt sectionst optionst gett splitt isabst joint getIncludes( t resourcet seent SCPWIt parsert resourceDirt newFilest option_namet option_listt newResourcest newResourcet rt s( ( s- /usr/share/fail2ban/client/configparserinc.pyR A s( &c C sh g } t | t p | g } n x! | D] } | t i | 7} q* Wt i d | t i | | S( Ns Reading files: %s( t isinstancet listR R t logSyst debugR R ( t selft filenamest fileNamesFullt filename( ( s- /usr/share/fail2ban/client/configparserinc.pyR d s ( t __name__t __module__t __doc__R R t staticmethodR ( ( ( s- /usr/share/fail2ban/client/configparserinc.pyR ! s ( t __author__t __copyright__t __license__t loggingR t ConfigParserR t getLoggerR R ( ( ( s- /usr/share/fail2ban/client/configparserinc.pys <module> s