新增get_git_username功能

This commit is contained in:
wangweiye7840 2024-04-15 09:00:00 +08:00
parent ca58acf66b
commit 0cb82eb577
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,12 @@ BuildFullScheme = {
}
}
def get_git_username():
command = "git config --global user.name"
stream = os.popen(command)
username = stream.read().strip()
return username
def connect(hostname,port,username,pwd,db):
mydb = mysql.connector.connect(host = hostname, port = port, user = username, password = pwd, database = db)
return mydb