Merge commit '5bc60a0ef8'
This commit is contained in:
commit
c927ed5de3
1 changed files with 5 additions and 2 deletions
|
|
@ -26,15 +26,18 @@ def main(argv):
|
|||
print("Could not find file: {0}\n".format(filetoconvert))
|
||||
return 1
|
||||
|
||||
count = 0
|
||||
with open(filetoconvert, 'x') as f:
|
||||
with open(filecopy,'r') as c:
|
||||
fileread = c.read()
|
||||
print("Detected %s instances of %s pre-conversion"%(fileread.count(pattern),pattern))
|
||||
converted = fileread.replace(pattern, substitute)
|
||||
#print ("DEBUG: %s "%converted)
|
||||
print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute))
|
||||
count = converted.count(substitute)
|
||||
print("Confirmed %s instances of %s post-conversion"%(count,substitute))
|
||||
f.write(converted)
|
||||
|
||||
if count == 0:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue