# Path: clonedigger/logilab/common/compat.py
# class set(_baseset):
#     """mutable set"""
#     def add(self, value):
#         self._data[value] = 1
# 
#     def remove(self, element):
#         """removes <element> from set"""
#         del self._data[element]
# 
#     def pop(self):
#         """pops an arbitrary element from set"""
#         return self._data.popitem()[0]
# 
#     def __hash__(self):
#         """mutable et cannot be hashed."""
#         raise TypeError("set objects are not hashable")
# 
# Path: clonedigger/logilab/common/optik_ext.py
#         NO_DEFAULT = []
#     HAS_MX_DATETIME = True
#     HAS_MX_DATETIME = False
# OPTPARSE_FORMAT_DEFAULT = sys.version_info >= (2, 4)
#     TYPES = BaseOption.TYPES + ('regexp', 'csv', 'yn', 'named', 'password',
#                                 'multiple_choice', 'file', 'font', 'color')
#     TYPE_CHECKER = copy(BaseOption.TYPE_CHECKER)
# def check_regexp(option, opt, value):
# def check_csv(option, opt, value):
# def check_yn(option, opt, value):
# def check_named(option, opt, value):
# def check_password(option, opt, value):
# def check_file(option, opt, value):
# def check_date(option, opt, value):
# def check_color(option, opt, value):
#     def _check_choice(self):
#     def process(self, opt, value, values, parser):
#     def __init__(self, option_class=Option, *args, **kwargs):
#     def __init__ (self,
#                   indent_increment=0,
#                   max_help_position=24,
#                   width=79,
#                   short_first=0):
#     def format_heading(self, heading):
#     def format_description(self, description):
#     def format_option(self, option):
#     def format_head(self, optparser, pkginfo, section=1):
#     def format_title(self, pgm, section):
#     def format_short_description(self, pgm, short_desc):
#     def format_synopsis(self, pgm):
#     def format_long_description(self, pgm, long_desc):
#     def format_tail(self, pkginfo):
# def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout):
# class Option(BaseOption):
# class OptionParser(BaseParser):
# class ManHelpFormatter(HelpFormatter):


from future import standard_library
from builtins import input
from builtins import str
from builtins import range
from builtins import *
from builtins import object
from os.path import exists
from copy import copy
from configparser import ConfigParser, NoOptionError, NoSectionError
from clonedigger.logilab.common.compat import set
from clonedigger.logilab.common.textutils import normalize_text, unquote
from clonedigger.logilab.common.optik_ext import OptionParser, OptionGroup, Values, \
     OptionValueError, OptionError, HelpFormatter, generate_manpage, check_date, \
     check_yn, check_csv, check_file, check_color, check_named, check_password,\
     NO_DEFAULT, OPTPARSE_FORMAT_DEFAULT
    from getpass import getpass
import os
import sys
import re
    for optname, optdict, value in options:
        help = optdict.get('help')
        print(':%s:' % optname, file=stream)
        if help:
            print(normalize_text(help, line_len=79, indent='  '), file=stream)
        if value:
            print('  Default: %s' % format_option_value(optdict, value), file=stream)


class OptionsManagerMixIn(object):
    """MixIn to handle a configuration from both a configuration file and
    command line options
    """
    
    def __init__(self, usage, config_file=None, version=None, quiet=0):
        self.config_file = config_file
        self.reset_parsers(usage, version=version)
        # list of registered options providers
        self.options_providers = []
        # dictionary assocating option name to checker
        self._all_options = {}
        self._short_options = {}
        self._nocallback_options = {}
        # verbosity
        self.quiet = quiet

    def reset_parsers(self, usage='', version=None):
        # configuration file parser
        self._config_parser = ConfigParser()
        # command line parser

# Path: clonedigger/logilab/common/compat.py
# class set(_baseset):
#     """mutable set"""
#     def add(self, value):
#         self._data[value] = 1
# 
#     def remove(self, element):
#         """removes <element> from set"""
#         del self._data[element]
# 
#     def pop(self):
#         """pops an arbitrary element from set"""
#         return self._data.popitem()[0]
# 
#     def __hash__(self):
#         """mutable et cannot be hashed."""
#         raise TypeError("set objects are not hashable")
# 
# Path: clonedigger/logilab/common/optik_ext.py
#         NO_DEFAULT = []
#     HAS_MX_DATETIME = True
#     HAS_MX_DATETIME = False
# OPTPARSE_FORMAT_DEFAULT = sys.version_info >= (2, 4)
#     TYPES = BaseOption.TYPES + ('regexp', 'csv', 'yn', 'named', 'password',
#                                 'multiple_choice', 'file', 'font', 'color')
#     TYPE_CHECKER = copy(BaseOption.TYPE_CHECKER)
# def check_regexp(option, opt, value):
# def check_csv(option, opt, value):
# def check_yn(option, opt, value):
# def check_named(option, opt, value):
# def check_password(option, opt, value):
# def check_file(option, opt, value):
# def check_date(option, opt, value):
# def check_color(option, opt, value):
#     def _check_choice(self):
#     def process(self, opt, value, values, parser):
#     def __init__(self, option_class=Option, *args, **kwargs):
#     def __init__ (self,
#                   indent_increment=0,
#                   max_help_position=24,
#                   width=79,
#                   short_first=0):
#     def format_heading(self, heading):
#     def format_description(self, description):
#     def format_option(self, option):
#     def format_head(self, optparser, pkginfo, section=1):
#     def format_title(self, pgm, section):
#     def format_short_description(self, pgm, short_desc):
#     def format_synopsis(self, pgm):
#     def format_long_description(self, pgm, long_desc):
#     def format_tail(self, pkginfo):
# def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout):
# class Option(BaseOption):
# class OptionParser(BaseParser):
# class ManHelpFormatter(HelpFormatter):


# Path: clonedigger/logilab/common/configuration.py
from future import standard_library
from builtins import input
from builtins import str
from builtins import range
from builtins import *
from builtins import object
from os.path import exists
from copy import copy
from configparser import ConfigParser, NoOptionError, NoSectionError
from clonedigger.logilab.common.compat import set
from clonedigger.logilab.common.textutils import normalize_text, unquote
from clonedigger.logilab.common.optik_ext import OptionParser, OptionGroup, Values, \
     OptionValueError, OptionError, HelpFormatter, generate_manpage, check_date, \
     check_yn, check_csv, check_file, check_color, check_named, check_password,\
     NO_DEFAULT, OPTPARSE_FORMAT_DEFAULT
    from getpass import getpass
import os
import sys
import re

    for optname, optdict, value in options:
        help = optdict.get('help')
        print(':%s:' % optname, file=stream)
        if help:
            print(normalize_text(help, line_len=79, indent='  '), file=stream)
        if value:
            print('  Default: %s' % format_option_value(optdict, value), file=stream)


class OptionsManagerMixIn(object):
    """MixIn to handle a configuration from both a configuration file and
    command line options
    """
    
    def __init__(self, usage, config_file=None, version=None, quiet=0):
        self.config_file = config_file
        self.reset_parsers(usage, version=version)
        # list of registered options providers
        self.options_providers = []
        # dictionary assocating option name to checker
        self._all_options = {}
        self._short_options = {}
        self._nocallback_options = {}
        # verbosity
        self.quiet = quiet

    def reset_parsers(self, usage='', version=None):
        # configuration file parser
        self._config_parser = ConfigParser()
        # command line parser

        self._optik_parser = OptionParser(usage=usage, version=version)