"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/tools/glusterfind/src/conf.py" (16 Sep 2020, 856 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "conf.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 
    3 # Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com/>
    4 # This file is part of GlusterFS.
    5 #
    6 # This file is licensed to you under your choice of the GNU Lesser
    7 # General Public License, version 3 or any later version (LGPLv3 or
    8 # later), or the GNU General Public License, version 2 (GPLv2), in all
    9 # cases as published by the Free Software Foundation.
   10 
   11 import os
   12 try:
   13     from ConfigParser import ConfigParser
   14 except ImportError:
   15     from configparser import ConfigParser
   16 
   17 config = ConfigParser()
   18 config.read(os.path.join(os.path.dirname(os.path.abspath(__file__)),
   19                          "tool.conf"))
   20 
   21 
   22 def list_change_detectors():
   23     return dict(config.items("change_detectors")).keys()
   24 
   25 
   26 def get_opt(opt):
   27     return config.get("vars", opt)
   28 
   29 
   30 def get_change_detector(opt):
   31     return config.get("change_detectors", opt)