So if I have a git config file something like this.
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
I want to read the text between in quotes. I tried using
repo_config = Repo(projects_dir+"/"+repo+".git")
color=repo_config.config_reader().get_value("color")
I can read the fields inside it like current,local,remote but I want to read the quoted text corresponding to color, how do I go about it
configs = """
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
"""
file_name = 'test-config.txt'
with open(file_name,'w') as file:
file.write(configs)
with open(file_name,'r') as file:
file_txt = file.read()
print(file_txt.split('"')[1])
import configparser
config = configparser.ConfigParser()
config.read(file_name)
print(config.sections()[0].split(' ')[-1].replace('"',''))
## method 01
branch
## method 02
branch