Mercurial > touhou
comparison pytouhou/formats/std.py @ 58:3da4de9decd0
Use logging module
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Tue, 23 Aug 2011 21:01:50 +0200 |
parents | ab826bc29aa2 |
children | ca571697ec83 |
comparison
equal
deleted
inserted
replaced
57:694f25881d0f | 58:3da4de9decd0 |
---|---|
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 | 15 |
16 from struct import pack, unpack | 16 from struct import pack, unpack |
17 from pytouhou.utils.helpers import read_string | 17 from pytouhou.utils.helpers import read_string, get_logger |
18 | 18 |
19 logger = get_logger(__name__) | |
19 | 20 |
20 | 21 |
21 class Object(object): | 22 class Object(object): |
22 def __init__(self): | 23 def __init__(self): |
23 self.header = (b'\x00') * 28 #TODO | 24 self.header = (b'\x00') * 28 #TODO |
106 args = tuple(unpack('<III', data)[:1]) | 107 args = tuple(unpack('<III', data)[:1]) |
107 elif message_type == 4: # StartInterpolatingFog | 108 elif message_type == 4: # StartInterpolatingFog |
108 args = tuple(unpack('<III', data)[:1]) | 109 args = tuple(unpack('<III', data)[:1]) |
109 else: | 110 else: |
110 args = (data,) | 111 args = (data,) |
111 print('Warning: unknown opcode %d' % message_type) #TODO | 112 logger.warn('unknown opcode %d (data: %r)', message_type, data) |
112 stage.script.append((frame, message_type, args)) | 113 stage.script.append((frame, message_type, args)) |
113 | 114 |
114 return stage | 115 return stage |
115 | 116 |