aboutsummaryrefslogtreecommitdiffstats
path: root/preprocessor.py
diff options
context:
space:
mode:
authoriimarckus <iimarckus@gmail.com>2013-12-09 21:23:19 -0800
committeriimarckus <iimarckus@gmail.com>2013-12-09 21:23:19 -0800
commitf17320d7a835709da4c991e0e67300d001ffc53c (patch)
tree9dc5044efa04fd16baf25c0ca0c43a68409dee61 /preprocessor.py
parentIshiharaTeam (diff)
parentmakefile: find -delete isnt portable (diff)
downloadpokeyellow-f17320d7a835709da4c991e0e67300d001ffc53c.tar.gz
pokeyellow-f17320d7a835709da4c991e0e67300d001ffc53c.tar.xz
pokeyellow-f17320d7a835709da4c991e0e67300d001ffc53c.zip
Merge pull request #19 from yenatch/crystal-makefile
bring pokered into this century
Diffstat (limited to '')
-rw-r--r--preprocessor.py (renamed from textpre.py)32
1 files changed, 23 insertions, 9 deletions
diff --git a/textpre.py b/preprocessor.py
index 294e9ccb..cb9353af 100644
--- a/textpre.py
+++ b/preprocessor.py
@@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
import extras.pokemontools.preprocessor as preprocessor
+
import extras.pokemontools.configuration as configuration
+config = configuration.Config()
import sys
+from extras.pokemontools.crystal import (
+ callchannel,
+ loopchannel,
+)
+
chars = {
"ガ": 0x05,
"ギ": 0x06,
@@ -260,14 +267,21 @@ chars = {
"9": 0xFF,
}
-preprocessor.chars = chars
+def load_pokered_macros():
+ macros = [callchannel, loopchannel]
+ return macros
-from extras.pokemontools.crystal import (
- callchannel,
- loopchannel,
-)
+def setup_processor():
+ preprocessor.chars = chars
+ macros = load_pokered_macros()
+ processor = preprocessor.Preprocessor(config, macros)
+ return processor
-config = configuration.Config()
-macros = [callchannel, loopchannel]
-processor = preprocessor.Preprocessor(config, macros)
-processor.preprocess()
+def main():
+ processor = setup_processor()
+ output = processor.preprocess()
+ processor.update_globals()
+ return output
+
+if __name__ == '__main__':
+ main()