diff options
author | Sanky <gsanky@gmail.com> | 2013-02-02 23:13:32 +0100 |
---|---|---|
committer | Sanky <gsanky@gmail.com> | 2013-02-02 23:20:50 +0100 |
commit | 7df002c3e20f1b728b1d29a877c3731d4867f502 (patch) | |
tree | 14cf8cb4dc2a95f4137de1967679dd45df3c0db8 /extras/comparator.py | |
parent | 6b8d77ffb23443cac8ca8bc570c758f7b77fa109 (diff) | |
parent | 1bf1d6e3ea7b75445803ed8d01c49014adf2e114 (diff) |
Merge https://github.com/kanzure/pokecrystal
Conflicts:
constants.asm
extras/crystal.py
main.asm
Diffstat (limited to 'extras/comparator.py')
-rw-r--r-- | extras/comparator.py | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/extras/comparator.py b/extras/comparator.py index 690fa5236..6d981e493 100644 --- a/extras/comparator.py +++ b/extras/comparator.py @@ -1,34 +1,30 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- -# author: Bryan Bishop <kanzure@gmail.com> -# date: 2012-05-29 -# purpose: find shared functions between red/crystal - -from crystal import get_label_from_line, \ - get_address_from_line_comment, \ - AsmSection - -from romstr import RomStr, AsmList +""" +Finds shared functions between red/crystal. +""" + +from crystal import ( + get_label_from_line, + get_address_from_line_comment, + AsmSection, + direct_load_rom, + direct_load_asm, +) + +from romstr import ( + RomStr, + AsmList, +) 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 |