From 0cb82eb577b37a030b16b5aec5a4e41bc52d3285 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Mon, 15 Apr 2024 09:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eget=5Fgit=5Fusername=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v3/database_tools_2.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/工具v3/database_tools_2.py b/工具v3/database_tools_2.py index 90634ea0..8728caa4 100644 --- a/工具v3/database_tools_2.py +++ b/工具v3/database_tools_2.py @@ -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