Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: localeTools.py

Issue 29420565: Noissue - Remove some dead code (Closed) Base URL: https://hg.adblockplus.org/buildtools
Patch Set: Created April 24, 2017, 9:43 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | packagerSafari.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: localeTools.py
===================================================================
--- a/localeTools.py
+++ b/localeTools.py
@@ -196,37 +196,16 @@ def readFile(path):
def generateStringEntry(key, value, path):
if path.endswith('.dtd'):
return '<!ENTITY %s "%s">\n' % (escapeEntity(key), escapeEntity(value))
else:
return '%s=%s\n' % (escapeProperty(key), escapeProperty(value))
-def appendToFile(path, key, value):
- fileHandle = codecs.open(path, 'ab', encoding='utf-8')
- fileHandle.write(generateStringEntry(key, value, path))
- fileHandle.close()
-
-
-def removeFromFile(path, key):
- fileHandle = codecs.open(path, 'rb', encoding='utf-8')
- data = fileHandle.read()
- fileHandle.close()
-
- if path.endswith('.dtd'):
- data = re.sub(r'<!ENTITY\s+%s\s+"[^"]*">\s*' % key, '', data, re.S)
- else:
- data = re.sub(r'(^|\n)%s=[^\n]*\n' % key, r'\1', data, re.S)
-
- fileHandle = codecs.open(path, 'wb', encoding='utf-8')
- fileHandle.write(data)
- fileHandle.close()
-
-
def toJSON(path):
fileHandle = codecs.open(path, 'rb', encoding='utf-8')
data = fileHandle.read()
fileHandle.close()
if path.endswith('.dtd'):
it = parseDTDString(data, path)
elif path.endswith('.properties'):
« no previous file with comments | « no previous file | packagerSafari.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld