branding: have counters by branch

This commit is contained in:
ave 2019-01-25 16:23:07 +03:00
parent bbd4d43990
commit 993ad39c2d
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B

View file

@ -6,9 +6,9 @@ fname = sys.argv[1]
persistdir = "/home/ave/distokrepos/versionlogs/" persistdir = "/home/ave/distokrepos/versionlogs/"
def counterup(): def counterup(branch="base"):
# HACKY # HACKY
cfname = persistdir + fname.split("/")[-1].replace(".patch", "") cfname = persistdir + fname.split("/")[-1].replace(".patch", "") + branch
if os.path.isfile(cfname): if os.path.isfile(cfname):
with open(cfname, 'r') as file: with open(cfname, 'r') as file:
countdata = file.read() countdata = file.read()
@ -27,8 +27,6 @@ def counterup():
with open(fname, 'r') as file: with open(fname, 'r') as file:
filedata = file.read() filedata = file.read()
buildnum = str(counterup())
name = "CutTheCord" name = "CutTheCord"
branch = "base" branch = "base"
@ -36,6 +34,8 @@ if "customtheme" in sys.argv:
branch = "themed" branch = "themed"
# name += " Themed" # name += " Themed"
buildnum = str(counterup(branch))
# Replace the target string # Replace the target string
filedata = filedata.replace("CTCBRANCH", branch)\ filedata = filedata.replace("CTCBRANCH", branch)\
.replace("CTCBUILD", buildnum)\ .replace("CTCBUILD", buildnum)\