app.py
def load_properties(filepath, sep="=", comment_char="#"):
    """
    Read the file passed as parameter as a properties file.
    """
    logging.info("Started loading config.properties.")
    props = {}
    with open(filepath, "rt") as f:
        for line in f:
            l = line.strip()
            if l and not l.startswith(comment_char):
                key_value = l.split(sep)
                key = key_value[0].strip()
                value = sep.join(key_value[1:]).strip().strip('"')
                props[key] = value
    logging.info("Properties loaded.")
    logging.info(props)
    return props

    Read the file passed as parameter as a properties file.
    
Read the file passed as parameter as a properties file.
Read the file passed as parameter as a properties file .
def load_properties(filepath, sep="=", comment_char="#"):
    logging.info("Started loading config.properties.")
    props = {}
    with open(filepath, "rt") as f:
        for line in f:
            l = line.strip()
            if l and not l.startswith(comment_char):
                key_value = l.split(sep)
                key = key_value[0].strip()
                value = sep.join(key_value[1:]).strip().strip('"')
                props[key] = value
    logging.info("Properties loaded.")
    logging.info(props)
    return props
def load_properties ( filepath , sep = "=" , comment_char = "#" ) : logging . info ( "Started loading config.properties." ) props = { } with open ( filepath , "rt" ) as f : for line in f : l = line . strip ( ) if l and not l . startswith ( comment_char ) : key_value = l . split ( sep ) key = key_value [ 0 ] . strip ( ) value = sep . join ( key_value [ 1 : ] ) . strip ( ) . strip ( '"' ) props [ key ] = value logging . info ( "Properties loaded." ) logging . info ( props ) return props
Read the file passed as parameter as a properties file.
Read the file passed as parameter as a properties file .
"""
    Read the file passed as parameter as a properties file.
    """
filepath
sep
comment_char