forked from distok/cutthecord
branding: change app name
This commit is contained in:
parent
0bc36a0738
commit
eb1f1ff8ac
4 changed files with 46 additions and 2 deletions
27
patches/branding/addpatch.py
Normal file
27
patches/branding/addpatch.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/env python3
|
||||
import sys
|
||||
import time
|
||||
|
||||
fname = sys.argv[1]
|
||||
|
||||
# Read in the file
|
||||
with open(fname, 'r') as file:
|
||||
filedata = file.read()
|
||||
|
||||
timestamp = str(time.time()).split(".")[0]
|
||||
|
||||
name = "CutTheCord"
|
||||
branch = "base"
|
||||
|
||||
if "customtheme" in sys.argv:
|
||||
branch = "themed"
|
||||
name += " Themed"
|
||||
|
||||
# Replace the target string
|
||||
filedata = filedata.replace("CTCBRANCH", branch)\
|
||||
.replace("CTCTIMESTAMP", timestamp)\
|
||||
.replace("CTCNAME", name)
|
||||
|
||||
# Write the file out again
|
||||
with open(fname.replace(".patch", "-custom.patch"), 'w') as file:
|
||||
file.write(filedata)
|
Loading…
Add table
Add a link
Reference in a new issue