Skip to content

Commit

Permalink
Merge pull request #12 from renpy/master
Browse files Browse the repository at this point in the history
Keep going to latest
  • Loading branch information
Lee Yunseok committed Jan 1, 2019
2 parents 6accdd3 + ee64a7b commit e04d204
Show file tree
Hide file tree
Showing 60 changed files with 1,274 additions and 132 deletions.
4 changes: 2 additions & 2 deletions launcher/game/EasyDialogsWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,14 +996,14 @@ def DlgProc(hwnd, uMsg, wParam, lParam):
if item[0] == '"':
while item[-1] != '"':
if not tmplist:
raise RuntimeError, "Unterminated quoted argument"
raise RuntimeError("Unterminated quoted argument")
item = item + ' ' + tmplist[0]
del tmplist[0]
item = item[1:-1]
if item[0] == "'":
while item[-1] != "'":
if not tmplist:
raise RuntimeError, "Unterminated quoted argument"
raise RuntimeError("Unterminated quoted argument")
item = item + ' ' + tmplist[0]
del tmplist[0]
item = item[1:-1]
Expand Down
2 changes: 1 addition & 1 deletion launcher/game/change_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def change_icons(oldexe, icofn):

alignment = pe.OPTIONAL_HEADER.SectionAlignment

# print "Alignment is", alignment
# print("Alignment is", alignment)

if len(rsrc) % alignment:
pad = alignment - (len(rsrc) % alignment)
Expand Down
14 changes: 7 additions & 7 deletions launcher/game/distribute.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,12 @@ init python in distribute:
if match(match_name, pattern):
break
else:
print >> self.log, match_name.encode("utf-8"), "doesn't match anything."
print(match_name.encode("utf-8"), "doesn't match anything.", file=self.log)

pattern = None
file_list = None

print >> self.log, match_name.encode("utf-8"), "matches", pattern, "(" + str(file_list) + ")."
print(match_name.encode("utf-8"), "matches", pattern, "(" + str(file_list) + ").", file=self.log)

if file_list is None:
return
Expand Down Expand Up @@ -1026,7 +1026,7 @@ init python in distribute:

cmd = [ renpy.fsencode(i.format(**kwargs)) for i in command ]

# print "\"" + "\" \"".join(cmd) + "\""
# print("\"" + "\" \"".join(cmd) + "\"")

try:
import sys, os
Expand Down Expand Up @@ -1396,13 +1396,13 @@ init python in distribute:

def dump(self):
for k, v in sorted(self.file_lists.items()):
print
print k + ":"
print()
print(k + ":")

v.sort()

for i in v:
print " ", i.name, "xbit" if i.executable else ""
print(" ", i.name, "xbit" if i.executable else "")

class GuiReporter(object):
"""
Expand Down Expand Up @@ -1441,7 +1441,7 @@ init python in distribute:
what = what.replace("[", "{")
what = what.replace("]", "}")
what = what.format(**kwargs)
print what
print(what)

def progress(self, what, done, total, **kwargs):
what = what.replace("[", "{")
Expand Down
48 changes: 24 additions & 24 deletions launcher/game/pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def __get_word_value_at_rva(self, rva):

try:
data = self.pe.get_data(self.rva_ptr, 2)
except PEFormatError, e:
except PEFormatError as e:
return False

if len(data)<2:
Expand Down Expand Up @@ -821,7 +821,7 @@ def dump(self, indentation=0):
if key == 'TimeDateStamp' or key == 'dwTimeStamp':
try:
val_str += ' [%s UTC]' % time.asctime(time.gmtime(val))
except exceptions.ValueError, e:
except exceptions.ValueError as e:
val_str += ' [INVALID TIME]'
else:
val_str = ''.join(filter(lambda c:c != '\0', str(val)))
Expand Down Expand Up @@ -890,7 +890,7 @@ def contains_rva(self, rva):
return self.VirtualAddress <= rva < self.VirtualAddress + size

def contains(self, rva):
#print "DEPRECATION WARNING: you should use contains_rva() instead of contains()"
#print("DEPRECATION WARNING: you should use contains_rva() instead of contains()")
return self.contains_rva(rva)


Expand Down Expand Up @@ -1373,7 +1373,7 @@ def __unpack_data__(self, format, data, file_offset):

try:
structure.__unpack__(data)
except PEFormatError, err:
except PEFormatError as err:
self.__warnings.append(
'Corrupt header "%s" at file offset %d. Exception: %s' % (
format[0], file_offset, str(err)) )
Expand Down Expand Up @@ -2115,7 +2115,7 @@ def parse_debug_directory(self, rva, size):
for idx in xrange(size/dbg_size):
try:
data = self.get_data(rva+dbg_size*idx, dbg_size)
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Invalid debug information. Can\'t read ' +
'data at RVA: 0x%x' % rva)
Expand Down Expand Up @@ -2169,7 +2169,7 @@ def parse_resources_directory(self, rva, size=0, base_rva = None, level = 0):
# If the RVA is invalid all would blow up. Some EXEs seem to be
# specially nasty and have an invalid RVA.
data = self.get_data(rva, Structure(self.__IMAGE_RESOURCE_DIRECTORY_format__).sizeof() )
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Invalid resources directory. Can\'t read ' +
'directory data at RVA: 0x%x' % rva)
Expand Down Expand Up @@ -2229,7 +2229,7 @@ def parse_resources_directory(self, rva, size=0, base_rva = None, level = 0):
entry_name = UnicodeStringWrapperPostProcessor(self, ustr_offset)
strings_to_postprocess.append(entry_name)

except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the resources directory, ' +
'attempting to read entry name. ' +
Expand Down Expand Up @@ -2330,7 +2330,7 @@ def parse_resource_data_entry(self, rva):
# If the RVA is invalid all would blow up. Some EXEs seem to be
# specially nasty and have an invalid RVA.
data = self.get_data(rva, Structure(self.__IMAGE_RESOURCE_DATA_ENTRY_format__).sizeof() )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing a resource directory data entry, ' +
'the RVA is invalid: 0x%x' % ( rva ) )
Expand Down Expand Up @@ -2409,7 +2409,7 @@ def parse_version_information(self, version_struct):
ustr_offset = version_struct.OffsetToData + versioninfo_struct.sizeof()
try:
versioninfo_string = self.get_string_u_at_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read VS_VERSION_INFO string. Can\'t ' +
Expand Down Expand Up @@ -2489,7 +2489,7 @@ def parse_version_information(self, version_struct):
stringfileinfo_offset + versioninfo_struct.sizeof() )
try:
stringfileinfo_string = self.get_string_u_at_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read StringFileInfo string. Can\'t ' +
Expand Down Expand Up @@ -2535,7 +2535,7 @@ def parse_version_information(self, version_struct):
stringtable_struct.sizeof() )
try:
stringtable_string = self.get_string_u_at_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read StringTable string. Can\'t ' +
Expand Down Expand Up @@ -2570,7 +2570,7 @@ def parse_version_information(self, version_struct):
try:
key = self.get_string_u_at_rva( ustr_offset )
key_offset = self.get_offset_from_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read StringTable Key string. Can\'t ' +
Expand All @@ -2586,7 +2586,7 @@ def parse_version_information(self, version_struct):
value = self.get_string_u_at_rva( ustr_offset,
max_length = string_struct.ValueLength )
value_offset = self.get_offset_from_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read StringTable Value string. ' +
Expand Down Expand Up @@ -2661,7 +2661,7 @@ def parse_version_information(self, version_struct):
var_struct.sizeof() )
try:
var_string = self.get_string_u_at_rva( ustr_offset )
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the version information, ' +
'attempting to read VarFileInfo Var string. ' +
Expand Down Expand Up @@ -2830,7 +2830,7 @@ def parse_delay_import_directory(self, rva, size):
# If the RVA is invalid all would blow up. Some PEs seem to be
# specially nasty and have an invalid RVA.
data = self.get_data( rva, Structure(self.__IMAGE_DELAY_IMPORT_DESCRIPTOR_format__).sizeof() )
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Error parsing the Delay import directory at RVA: 0x%x' % ( rva ) )
break
Expand All @@ -2852,7 +2852,7 @@ def parse_delay_import_directory(self, rva, size):
import_desc.pINT,
import_desc.pIAT,
None)
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Error parsing the Delay import directory. ' +
'Invalid import data at RVA: 0x%x' % ( rva ) )
Expand Down Expand Up @@ -2883,7 +2883,7 @@ def parse_import_directory(self, rva, size):
# If the RVA is invalid all would blow up. Some EXEs seem to be
# specially nasty and have an invalid RVA.
data = self.get_data(rva, Structure(self.__IMAGE_IMPORT_DESCRIPTOR_format__).sizeof() )
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Error parsing the Import directory at RVA: 0x%x' % ( rva ) )
break
Expand All @@ -2903,7 +2903,7 @@ def parse_import_directory(self, rva, size):
import_desc.OriginalFirstThunk,
import_desc.FirstThunk,
import_desc.ForwarderChain)
except PEFormatError, excp:
except PEFormatError as excp:
self.__warnings.append(
'Error parsing the Import directory. ' +
'Invalid Import data at RVA: 0x%x' % ( rva ) )
Expand Down Expand Up @@ -2936,7 +2936,7 @@ def parse_imports(self, original_first_thunk, first_thunk, forwarder_chain):
imported_symbols = []
imports_section = self.get_section_by_rva(first_thunk)
if not imports_section:
raise PEFormatError, 'Invalid/corrupt imports.'
raise PEFormatError('Invalid/corrupt imports.')


# Import Lookup Table. Contains ordinals or pointers to strings.
Expand Down Expand Up @@ -2991,7 +2991,7 @@ def parse_imports(self, original_first_thunk, first_thunk, forwarder_chain):
# Get the Hint
imp_hint = self.get_word_from_data(data, 0)
imp_name = self.get_string_at_rva(table[idx].AddressOfData+2)
except PEFormatError, e:
except PEFormatError as e:
pass

imp_address = first_thunk+self.OPTIONAL_HEADER.ImageBase+idx*4
Expand Down Expand Up @@ -3032,7 +3032,7 @@ def get_import_table(self, rva):

try:
data = self.get_data( rva, Structure(format).sizeof() )
except PEFormatError, e:
except PEFormatError as e:
self.__warnings.append(
'Error parsing the import table. ' +
'Invalid data at RVA: 0x%x' % ( rva ) )
Expand Down Expand Up @@ -3137,7 +3137,7 @@ def get_data(self, rva, length=None):
end = None
return self.header[rva:end]

raise PEFormatError, 'data at RVA can\'t be fetched. Corrupt header?'
raise PEFormatError('data at RVA can\'t be fetched. Corrupt header?')

return s.get_data(rva, length)

Expand All @@ -3160,7 +3160,7 @@ def get_offset_from_rva(self, rva):
s = self.get_section_by_rva(rva)
if not s:

raise PEFormatError, 'data at RVA can\'t be fetched. Corrupt header?'
raise PEFormatError('data at RVA can\'t be fetched. Corrupt header?')

return s.get_offset_from_rva(rva)

Expand Down Expand Up @@ -3207,7 +3207,7 @@ def get_string_u_at_rva(self, rva, max_length = 2**16):
# If the RVA is invalid all would blow up. Some EXEs seem to be
# specially nasty and have an invalid RVA.
self.get_data(rva, 2)
except PEFormatError, e:
except PEFormatError as e:
return None

#length = struct.unpack('<H', data)[0]
Expand Down
20 changes: 10 additions & 10 deletions launcher/game/tl/piglatin/common.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -297,43 +297,43 @@ translate piglatin strings:
old "Audio Filename:"
new "Udioaay Ilenamefay:"

# 00gui.rpy:370
# 00gui.rpy:371
old "Are you sure?"
new "Reaay ouyay uresay?"

# 00gui.rpy:371
# 00gui.rpy:372
old "Are you sure you want to delete this save?"
new "Reaay ouyay uresay ouyay antway otay eleteday histay avesay?"

# 00gui.rpy:372
# 00gui.rpy:373
old "Are you sure you want to overwrite your save?"
new "Reaay ouyay uresay ouyay antway otay overwriteay ouryay avesay?"

# 00gui.rpy:373
# 00gui.rpy:374
old "Loading will lose unsaved progress.\nAre you sure you want to do this?"
new "Oadinglay illway oselay unsaveday rogresspay.\nReaay ouyay uresay ouyay antway otay oday histay?"

# 00gui.rpy:374
# 00gui.rpy:375
old "Are you sure you want to quit?"
new "Reaay ouyay uresay ouyay antway otay uitqay?"

# 00gui.rpy:375
# 00gui.rpy:376
old "Are you sure you want to return to the main menu?\nThis will lose unsaved progress."
new "Reaay ouyay uresay ouyay antway otay eturnray otay hetay ainmay enumay?\nHistay illway oselay unsaveday rogresspay."

# 00gui.rpy:376
# 00gui.rpy:377
old "Are you sure you want to end the replay?"
new "Reaay ouyay uresay ouyay antway otay enday hetay eplayray?"

# 00gui.rpy:377
# 00gui.rpy:378
old "Are you sure you want to begin skipping?"
new "Reaay ouyay uresay ouyay antway otay eginbay kippingsay?"

# 00gui.rpy:378
# 00gui.rpy:379
old "Are you sure you want to skip to the next choice?"
new "Reaay ouyay uresay ouyay antway otay kipsay otay hetay extnay oicechay?"

# 00gui.rpy:379
# 00gui.rpy:380
old "Are you sure you want to skip unseen dialogue to the next choice?"
new "Reaay ouyay uresay ouyay antway otay kipsay unseenay ialogueday otay hetay extnay oicechay?"

Expand Down

0 comments on commit e04d204

Please sign in to comment.