Commits

Michał Górny committed 09bdc1e

Support the simpler case of flag adding.

Comments (0)

Files changed (1)

lib/flaggie/makeconf.py

 		def flags(self):
 			return self._token.flags
 
+		def append(self, flag):
+			assert(not isinstance(self._token, MakeConf.MakeConfFile.UnquotedWord))
+
+			if not isinstance(flag, self.MakeConfFlag):
+				flag = self.MakeConfFlag(flag)
+				self.flags.append(self.Whitespace(' '))
+
+			self.flags.append(flag)
+			self.modified = True
+			return flag
+
 		def __iter__(self):
 			""" Iterate over all flags in the entry. """
 			for f in reversed(self.flags):