changeset 305:5492472963b0

Minor cleanup
author Thibaut Girka <thib@sitedethib.com>
date Tue, 13 Mar 2012 18:45:43 +0100
parents f3099ebf4f61
children 52d791bb7c32
files pytouhou/formats/exe.py pytouhou/formats/msg.py pytouhou/formats/score.py pytouhou/formats/t6rp.py pytouhou/game/game.py pytouhou/games/eosd.py
diffstat 6 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/formats/exe.py
+++ b/pytouhou/formats/exe.py
@@ -138,12 +138,8 @@ class SHT(object):
         pe_file = PEFile(file)
         data_section = [section for section in pe_file.sections
                             if section.Name.startswith('.data')][0]
-        text_section = [section for section in pe_file.sections
-                            if section.Name.startswith('.text')][0]
         data_va = pe_file.image_base + data_section.VirtualAddress
         data_size = data_section.SizeOfRawData
-        text_va = pe_file.image_base + text_section.VirtualAddress
-        text_size = text_section.SizeOfRawData
 
         possible_character_records = list(cls.find_character_defs(pe_file))
         if not possible_character_records:
--- a/pytouhou/formats/msg.py
+++ b/pytouhou/formats/msg.py
@@ -13,7 +13,6 @@
 ##
 
 from struct import pack, unpack, calcsize
-from pytouhou.utils.helpers import read_string
 
 from pytouhou.utils.helpers import get_logger
 
--- a/pytouhou/formats/score.py
+++ b/pytouhou/formats/score.py
@@ -13,7 +13,7 @@
 ##
 
 
-from struct import pack, unpack, calcsize, Struct
+from struct import pack, unpack, Struct
 from collections import namedtuple
 from io import BytesIO
 
--- a/pytouhou/formats/t6rp.py
+++ b/pytouhou/formats/t6rp.py
@@ -23,10 +23,7 @@ replay file is sufficient to unfold a fu
 from struct import unpack
 from io import BytesIO
 
-from pytouhou.utils.random import Random
-from pytouhou.utils.helpers import read_string
-
-from pytouhou.utils.helpers import get_logger
+from pytouhou.utils.helpers import read_string, get_logger
 
 logger = get_logger(__name__)
 
--- a/pytouhou/game/game.py
+++ b/pytouhou/game/game.py
@@ -12,8 +12,6 @@
 ## GNU General Public License for more details.
 ##
 
-from itertools import chain
-
 from pytouhou.utils.random import Random
 
 from pytouhou.vm.eclrunner import ECLMainRunner
--- a/pytouhou/games/eosd.py
+++ b/pytouhou/games/eosd.py
@@ -23,8 +23,6 @@ from pytouhou.game.orb import Orb
 from pytouhou.game.effect import Effect
 from pytouhou.game.text import Text
 
-from math import pi
-
 
 SQ2 = 2. ** 0.5 / 2.