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/"
 | 
					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)\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue