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 | 4089cf486d83d78fddaab98316952e1bbeaafd47 (patch) | |
tree | f2721b81775a3e450e1a301a4679c9d6159c22b3 /comparator.py | |
parent | 43546fd07ac588be694c697873a642c5a2cc8c1d (diff) | |
parent | 1e893fae740cd9f82ead9adcb6f5c1ccb1c6090b (diff) |
Merge https://github.com/kanzure/pokecrystal
Conflicts:
constants.asm
extras/crystal.py
main.asm
original-commit-id: 7df002c3e20f1b728b1d29a877c3731d4867f502
Diffstat (limited to 'comparator.py')
-rw-r--r-- | comparator.py | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/comparator.py b/comparator.py index 690fa52..6d981e4 100644 --- a/comparator.py +++ b/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 |