comparison pytouhou/resource/loader.py @ 615:d1f0bb0b7a17

Don’t inherit explicitely from object, we are not on Python 2.7 anymore. :)
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 28 Mar 2015 21:40:51 +0100
parents e15672733c93
children d18c0bf11138
comparison
equal deleted inserted replaced
614:2cf518129725 615:d1f0bb0b7a17
31 31
32 logger = get_logger(__name__) 32 logger = get_logger(__name__)
33 33
34 34
35 35
36 class Directory(object): 36 class Directory:
37 def __init__(self, path): 37 def __init__(self, path):
38 self.path = path 38 self.path = path
39 39
40 40
41 def __enter__(self): 41 def __enter__(self):
57 def get_file(self, name): 57 def get_file(self, name):
58 return open(os.path.join(self.path, str(name)), 'rb') 58 return open(os.path.join(self.path, str(name)), 'rb')
59 59
60 60
61 61
62 class ArchiveDescription(object): 62 class ArchiveDescription:
63 _formats = {b'PBG3': PBG3} 63 _formats = {b'PBG3': PBG3}
64 64
65 def __init__(self, path, format_class, file_list=None): 65 def __init__(self, path, format_class, file_list=None):
66 self.path = path 66 self.path = path
67 self.format_class = format_class 67 self.format_class = format_class
91 file_list = instance.list_files() 91 file_list = instance.list_files()
92 return cls(path, format_class, file_list) 92 return cls(path, format_class, file_list)
93 93
94 94
95 95
96 class Loader(object): 96 class Loader:
97 def __init__(self, game_dir=None): 97 def __init__(self, game_dir=None):
98 self.exe_files = [] 98 self.exe_files = []
99 self.game_dir = game_dir 99 self.game_dir = game_dir
100 self.known_files = {} 100 self.known_files = {}
101 self.instanced_anms = {} # Cache for the textures. 101 self.instanced_anms = {} # Cache for the textures.