workwork
This commit is contained in:
parent
1dfc4601d7
commit
8806876046
@ -95,3 +95,13 @@ class Formatter(object):
|
||||
if c.type == INT_ARG or c.type == STRING_ARG or c.type == FLOAT_ARG or c.type == DOUBLE_ARG:
|
||||
no = c.data
|
||||
args[no - 1] = c.type
|
||||
|
||||
self.__commands = commands
|
||||
|
||||
def getMessage(self):
|
||||
ret = ''
|
||||
|
||||
for command in self.__commands:
|
||||
ret += command['data']
|
||||
|
||||
return repr(ret)
|
||||
|
@ -82,11 +82,15 @@ def loadResources(selfPath):
|
||||
resources = ResourcesCollection(dirs)
|
||||
msg.load(resources)
|
||||
|
||||
return resources
|
||||
|
||||
def main(script, *args):
|
||||
ensureDirExists(os.environ["HOME"] + "/.einstein")
|
||||
|
||||
loadResources(sys.argv[0])
|
||||
resources = loadResources(sys.argv[0])
|
||||
initScreen()
|
||||
initAudio()
|
||||
# menu()
|
||||
# getStorage().flush()
|
||||
|
||||
resources.dump()
|
||||
|
@ -60,6 +60,8 @@ class Messages(object):
|
||||
"message": Formatter(data, msgOffset),
|
||||
}
|
||||
|
||||
print("{}: {}".format(name, self.__messages[name]['message'].getMessage()))
|
||||
|
||||
offset += sz + 4
|
||||
|
||||
|
||||
|
@ -216,4 +216,10 @@ class ResourcesCollection:
|
||||
for resource in self.__groups[group]:
|
||||
func(resource)
|
||||
|
||||
def dump(self):
|
||||
for name, resource in self.__resources.items():
|
||||
for variant in resource.variants:
|
||||
with open('resources/' + name, 'wb') as f:
|
||||
f.write(variant.getData())
|
||||
|
||||
resources = None
|
||||
|
Loading…
Reference in New Issue
Block a user