forked from distok/cutthecord
		
	branding: have counters by branch
This commit is contained in:
		
							parent
							
								
									bbd4d43990
								
							
						
					
					
						commit
						993ad39c2d
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -6,9 +6,9 @@ fname = sys.argv[1]
 | 
			
		|||
persistdir = "/home/ave/distokrepos/versionlogs/"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def counterup():
 | 
			
		||||
def counterup(branch="base"):
 | 
			
		||||
    # HACKY
 | 
			
		||||
    cfname = persistdir + fname.split("/")[-1].replace(".patch", "")
 | 
			
		||||
    cfname = persistdir + fname.split("/")[-1].replace(".patch", "") + branch
 | 
			
		||||
    if os.path.isfile(cfname):
 | 
			
		||||
        with open(cfname, 'r') as file:
 | 
			
		||||
            countdata = file.read()
 | 
			
		||||
| 
						 | 
				
			
			@ -27,8 +27,6 @@ def counterup():
 | 
			
		|||
with open(fname, 'r') as file:
 | 
			
		||||
    filedata = file.read()
 | 
			
		||||
 | 
			
		||||
buildnum = str(counterup())
 | 
			
		||||
 | 
			
		||||
name = "CutTheCord"
 | 
			
		||||
branch = "base"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -36,6 +34,8 @@ if "customtheme" in sys.argv:
 | 
			
		|||
    branch = "themed"
 | 
			
		||||
    # name += " Themed"
 | 
			
		||||
 | 
			
		||||
buildnum = str(counterup(branch))
 | 
			
		||||
 | 
			
		||||
# Replace the target string
 | 
			
		||||
filedata = filedata.replace("CTCBRANCH", branch)\
 | 
			
		||||
    .replace("CTCBUILD", buildnum)\
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue