Forgot to add append method

This commit is contained in:
Ian Southam 2014-11-27 15:23:48 +01:00 committed by wilderrodrigues
parent ec09f04b88
commit d89c1e28ab
1 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,12 @@ class CsFile:
token = string.split('=')[0] + '='
self.search(token, string)
def append(self, string, where=-1):
if where == -1:
self.new_config.append("%s\n" % string)
else:
self.new_config.insert(where, "%s\n" % string)
def add(self, string, where=-1):
for index, line in enumerate(self.new_config):
if line.strip() == string: