summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-04-22 20:33:42 -0500
committerBryan Bishop <kanzure@gmail.com>2012-04-22 20:33:42 -0500
commit6f486c6faa3d65713c0735e0440af94016f30be5 (patch)
treec582c345b624f0bc30bc1f2483939320525ff430
parentbd721559efc5e3a1cf96456aefd253bd71d5827d (diff)
split up insertion and dumping in Asm
original-commit-id: 3869d5a30f22635637fa83775a50e117ba47ccf2
-rw-r--r--crystal.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/crystal.py b/crystal.py
index 81e996f..6d7d96a 100644
--- a/crystal.py
+++ b/crystal.py
@@ -4621,7 +4621,8 @@ class Asm:
incbins[index] = new_object
#insert these incbins into self.parts
gindex = self.parts.index(object)
- self.parts = self.parts[:gindex] + incbins + self.parts[gindex+1:]
+ self.parts = self.parts[:gindex] + incbins + self.parts[gindex:]
+ self.parts.remove(object)
found = True
break
#insert before the current object
@@ -4656,6 +4657,8 @@ class Asm:
count += 1
def insert_and_dump(self, limit=100, filename="output.txt"):
self.insert_all(limit=limit)
+ self.dump(filename=filename)
+ def dump(self, filename="output.txt"):
fh = open(filename, "w")
newlines_before_next_obj_requested = 0
newlines_before_next_obj_given = 0