|
|
@ -8,7 +8,23 @@ import git
|
|
|
|
|
|
|
|
|
|
|
|
current_working_directory = os.path.dirname(__file__)
|
|
|
|
current_working_directory = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def gitconfig():
|
|
|
|
|
|
|
|
g = git.Repo.init(current_working_directory)
|
|
|
|
|
|
|
|
config_read = g.config_reader()
|
|
|
|
|
|
|
|
config_write = g.config_writer()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
username = config_read.get_value("user", "name")
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
config_write.set_value("user", "name", "Bazarr")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
email = config_read.get_value("user", "email")
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
config_write.set_value("user", "email", "bazarr@fake.email")
|
|
|
|
|
|
|
|
|
|
|
|
def check_and_apply_update():
|
|
|
|
def check_and_apply_update():
|
|
|
|
|
|
|
|
gitconfig()
|
|
|
|
g = git.cmd.Git(current_working_directory)
|
|
|
|
g = git.cmd.Git(current_working_directory)
|
|
|
|
result = g.pull('origin', branch)
|
|
|
|
result = g.pull('origin', branch)
|
|
|
|
if result.startswith('Already'):
|
|
|
|
if result.startswith('Already'):
|
|
|
|