diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 17:00:51 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 17:00:51 -0600 |
commit | f22bbdd722bad8e2700b5801b45d935b631de6c8 (patch) | |
tree | aafbb0892c60e780383bf1a525fb64963b1ae057 /extras/comparator.py | |
parent | 0ee57e94db13be9654c8bd1bbcb2b7bb2aa4e929 (diff) |
remove a duplication of load_rom and load_asm
Diffstat (limited to 'extras/comparator.py')
-rw-r--r-- | extras/comparator.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/extras/comparator.py b/extras/comparator.py index 2abf5cdb6..6d981e493 100644 --- a/extras/comparator.py +++ b/extras/comparator.py @@ -7,6 +7,8 @@ from crystal import ( get_label_from_line, get_address_from_line_comment, AsmSection, + direct_load_rom, + direct_load_asm, ) from romstr import ( @@ -17,22 +19,12 @@ from romstr import ( def load_rom(path): """ Loads a ROM file into an abbreviated RomStr object. """ - - fh = open(path, "r") - x = RomStr(fh.read()) - fh.close() - - return x + return direct_load_rom(filename=path) def load_asm(path): """ Loads source ASM into an abbreviated AsmList object. """ - - fh = open(path, "r") - x = AsmList(fh.read().split("\n")) - fh.close() - - return x + return direct_load_asm(filename=path) def findall_iter(sub, string): # url: http://stackoverflow.com/a/3874760/687783 |