Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc49c6b8 authored by Jiyong Park's avatar Jiyong Park
Browse files

Leave a comment when removing a prop

post_process_prop.py doesn't simply drop a line when deleting a prop.
Instead, it makes the line as comment and leave a comment to clearly
mark that the prop was force removed. This is to aid the debugging.

Bug: 117892318
Test: m

Change-Id: I53c05800ff71d431a56dc370bcfe8bfc95c03bfc
parent bb26c6f2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -108,7 +108,10 @@ class PropList:
      self.props[index].value = value

  def delete(self, name):
    self.props = [p for p in self.props if p.name != name]
    index = next((i for i,p in enumerate(self.props) if p.name == name), -1)
    if index != -1:
      new_comment = "# removed by post_process_props.py\n#" + str(self.props[index])
      self.props[index] = Prop.from_line(new_comment)

  def write(self, filename):
    with open(filename, 'w+') as f: