public.py
def parse_ini(source):
    """Parse configurations from .ini file."""
    config = SimpleNamespace(source=source)
    ini = configparser.ConfigParser()
    ini.read(pathlib.Path(__file__).with_suffix('.ini'))
    try:
        config.description = ini.get(source, 'description').strip()
    except configparser.NoOptionError:
        config.description = None
    try:
        config.gdfile = ini.get(source, 'path')
    except configparser.NoSectionError:
        logger.error("ERROR: configuration not found for source %s", source)
        sys.exit()
    try:
        config.encoding = ini.get(source, 'encoding')
    except configparser.NoOptionError:
        config.encoding = None
    try:
        _dc = ini.get(source, 'drop_columns')
        config.drop_columns = list(
            filter(None, [x.strip() for x in _dc.splitlines()]))
    except configparser.NoOptionError:
        config.drop_columns = []
    config.recast_query = ini.get(source, 'recast_query')
    return config
Parse configurations from .ini file.
Parse configurations from .ini file.
Parse configurations from . ini file .
def parse_ini(source):
    config = SimpleNamespace(source=source)
    ini = configparser.ConfigParser()
    ini.read(pathlib.Path(__file__).with_suffix('.ini'))
    try:
        config.description = ini.get(source, 'description').strip()
    except configparser.NoOptionError:
        config.description = None
    try:
        config.gdfile = ini.get(source, 'path')
    except configparser.NoSectionError:
        logger.error("ERROR: configuration not found for source %s", source)
        sys.exit()
    try:
        config.encoding = ini.get(source, 'encoding')
    except configparser.NoOptionError:
        config.encoding = None
    try:
        _dc = ini.get(source, 'drop_columns')
        config.drop_columns = list(
            filter(None, [x.strip() for x in _dc.splitlines()]))
    except configparser.NoOptionError:
        config.drop_columns = []
    config.recast_query = ini.get(source, 'recast_query')
    return config
def parse_ini ( source ) : config = SimpleNamespace ( source = source ) ini = configparser . ConfigParser ( ) ini . read ( pathlib . Path ( __file__ ) . with_suffix ( '.ini' ) ) try : config . description = ini . get ( source , 'description' ) . strip ( ) except configparser . NoOptionError : config . description = None try : config . gdfile = ini . get ( source , 'path' ) except configparser . NoSectionError : logger . error ( "ERROR: configuration not found for source %s" , source ) sys . exit ( ) try : config . encoding = ini . get ( source , 'encoding' ) except configparser . NoOptionError : config . encoding = None try : _dc = ini . get ( source , 'drop_columns' ) config . drop_columns = list ( filter ( None , [ x . strip ( ) for x in _dc . splitlines ( ) ] ) ) except configparser . NoOptionError : config . drop_columns = [ ] config . recast_query = ini . get ( source , 'recast_query' ) return config
Parse configurations from .ini file.
Parse configurations from . ini file .
"""Parse configurations from .ini file."""
source