Continue conversion

This commit is contained in:
Gergely Polonkai 2015-11-03 16:04:54 +01:00
parent be18004bec
commit d7ab7280f4

View File

@ -1,12 +1,13 @@
from os import listdir
class ResourceFile(object):
from .buffer import Buffer
def __init__(fileName, buf=None):
class ResourceFile(object):
def __init__(self, fileName, buf=None):
# Ooooh, what does this button do?
# name(fileName)
if buf:
if buf is not None:
buffer = buf
ownBuffer = False
else:
@ -31,10 +32,6 @@ class ResourceFile(object):
raise Exception("Incompatible version of resource file '" + name + "'")
except IOError:
raise Exception("Invalid resource file '" + name + "'")
# How to reproduce this?
# int readed = stream.gcount();
except IOError:
raise Exception("Error loading resource file '" + name + "'")
@ -50,6 +47,8 @@ class ResourcesCollection:
try:
for name in listdir(directory):
if not name.startswith('.') and name.endswith('.res'):
self.__files.append(ResourceFile(directory + '/' + name, self.__buffer));
self.__files.append(
ResourceFile(directory + '/' + name,
buf=self.__buffer))
except OSError:
pass