From 9d9e7a4f2417bf7b72d79f542a9160a9ee937726 Mon Sep 17 00:00:00 2001 From: RusAnon Date: Mon, 3 May 2010 18:28:14 +1100 Subject: [PATCH] Translation exports, creature fix --- dfhack/python/pydfhack/creature.py | 2 +- dfhack/python/pydfhack/translation.py | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/dfhack/python/pydfhack/creature.py b/dfhack/python/pydfhack/creature.py index 3234d563f..676b10d40 100644 --- a/dfhack/python/pydfhack/creature.py +++ b/dfhack/python/pydfhack/creature.py @@ -10,7 +10,7 @@ class Creature(NeedsStart, _CreatureManager): api = None cls = _CreatureManager def __init__(self, api, *args, **kwds): - cls.__init__(self, args, kwds) + self.cls.__init__(self, args, kwds) self.api = api @suspend diff --git a/dfhack/python/pydfhack/translation.py b/dfhack/python/pydfhack/translation.py index 0179e9db0..6f7116217 100644 --- a/dfhack/python/pydfhack/translation.py +++ b/dfhack/python/pydfhack/translation.py @@ -3,23 +3,18 @@ Python class for DF_Hack::Translation """ from ._pydfhack import _TranslationManager -class Translation(_TranslationManager): +from .mixins import NeedsStart +from .decorators import suspend + +class Translation(NeedsStart, _TranslationManager): api = None - started = False + cls = _TranslationManager def __init__(self, api, *args, **kwds): - _TranslationManager.__init__(self, args, kwds) + self.cls.__init__(self, args, kwds) self.api = api - def prepare(self): - """ - Enforce Suspend/Start - """ - if self.api.prepare(): - if not self.started: - self.started = self.Start() - return self.started - else: - return False - - + def get_dictionaries(self): + return self.dictionaries + def Translate_Name(self, *args, **kw): + return self.cls.Translate_Name(self, *args, **kw)