@@ -102,7 +102,7 @@ def read_byte(self):
102
102
103
103
def read_short (self , endian = LITTLE_ENDIAN ):
104
104
#if self.bytes_left() < 2:
105
- # raise EOFError("Cannot read short; only {} bytes left in buffer".format(self.left))
105
+ # raise EOFError("Cannot read short; only {0 } bytes left in buffer".format(self.left))
106
106
107
107
if self .bit_shift == 0 :
108
108
return struct .unpack (endian + 'H' , self .read (2 ))[0 ]
@@ -119,7 +119,7 @@ def read_short(self, endian=LITTLE_ENDIAN):
119
119
120
120
def read_int (self , endian = LITTLE_ENDIAN ):
121
121
#if self.bytes_left() < 4:
122
- # raise EOFError("Cannot read int; only {} bytes left in buffer".format(self.left))
122
+ # raise EOFError("Cannot read int; only {0 } bytes left in buffer".format(self.left))
123
123
124
124
if self .bit_shift == 0 :
125
125
return struct .unpack (endian + 'I' , self .read (4 ))[0 ]
@@ -136,7 +136,7 @@ def read_int(self, endian=LITTLE_ENDIAN):
136
136
137
137
def read_bits (self , bits ):
138
138
#if self.bytes_left()*8 < bits-(8-self.bit_shift):
139
- # raise EOFError("Cannot read {} bits. only {} bits left in buffer.".format(bits, (self.length-self.tell()+1)*8-self.bit_shift))
139
+ # raise EOFError("Cannot read {0 } bits. only {1 } bits left in buffer.".format(bits, (self.length-self.tell()+1)*8-self.bit_shift))
140
140
bit_shift = self .bit_shift
141
141
if bit_shift != 0 :
142
142
bits_left = 8 - bit_shift
@@ -188,7 +188,7 @@ def read_bits(self, bits):
188
188
189
189
def read_bytes (self , bytes ):
190
190
#if self.bytes_left() < bytes:
191
- # raise EOFError("Cannot read {} bytes. only {} bytes left in buffer.".format(bytes, self.length-self.tell()))
191
+ # raise EOFError("Cannot read {0 } bytes. only {1 } bytes left in buffer.".format(bytes, self.length-self.tell()))
192
192
193
193
if self .bit_shift == 0 :
194
194
return self .read (bytes )
@@ -470,7 +470,7 @@ def extract_data_file(data_file, archive):
470
470
471
471
except Exception as e :
472
472
trace = sys .exc_info ()[2 ]
473
- raise exceptions .MPQError ("Unable to extract file: {}" .format (data_file ),e ), None , trace
473
+ raise exceptions .MPQError ("Unable to extract file: {0 }" .format (data_file ),e ), None , trace
474
474
475
475
def read_header (replay_file ):
476
476
# Extract useful header information from the MPQ files. This information
@@ -481,7 +481,7 @@ def read_header(replay_file):
481
481
482
482
# Sanity check that the input is in fact an MPQ file
483
483
if data .length == 0 or data .read (4 ) != "MPQ\x1b " :
484
- msg = "File '{}' is not an MPQ file" ;
484
+ msg = "File '{0 }' is not an MPQ file" ;
485
485
raise exceptions .FileError (msg .format (getattr (replay_file , 'name' , '<NOT AVAILABLE>' )))
486
486
487
487
max_data_size = data .read_int (LITTLE_ENDIAN )
0 commit comments