#!/usr/bin/env python3
'''
This script gets values from conf/launcher.conf
'''

import os.path
import sys
import argparse

if len(sys.path) == 0:
    print("cannot get path of script")
    exit(1)

script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
top_dir = os.path.join(script_dir, "..")
lib_dir = os.path.join(script_dir, "lib")
sys.path.append(lib_dir)


import os_museum_launcher
os_museum_launcher.top_dir = top_dir
os_museum_launcher.script_dir = script_dir
from os_museum_launcher.config import init_config, get_config

parser = argparse.ArgumentParser(description="Prints keys from conf/launcher.conf. If the file/section/key don't exist, nothing is printed.")
parser.add_argument('section', nargs=1, help='The section to return.')
parser.add_argument('key', nargs=1, help='The key to return.')
args = parser.parse_args()

init_config()

value = get_config().get(args.section[0], args.key[0], fallback=None)
if value is not None:
    print(value)
