From f2a30895b781767cb3e536d525ca4910cfe6e5ff Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 10 Mar 2007 05:49:37 +0000 Subject: [PATCH] =?utf8?q?Arreglar=20gettext=20en=20tester.=20La=20funci?= =?utf8?q?=C3=B3n=20=5F()=20llama=20por=20default=20a=20un=20gettext=20laz?= =?utf8?q?y=20de=20TG=20si=20no=20se=20est=C3=A1=20en=20medio=20de=20un=20?= =?utf8?q?request,=20para=20que=20se=20resuelva=20luego=20en=20"tiempo=20d?= =?utf8?q?e=20request"=20con=20la=20info=20de=20lenguaje=20del=20browser.?= =?utf8?q?=20Esto=20en=20el=20tester=20no=20es=20necesario=20y=20hace=20qu?= =?utf8?q?e=20se=20rompa,=20as=C3=AD=20que=20se=20usa=20el=20plain=5Fgette?= =?utf8?q?xt()=20de=20TG.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sercom/tester.py | 2 +- testtester.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sercom/tester.py b/sercom/tester.py index 7638fc8..24f68d7 100644 --- a/sercom/tester.py +++ b/sercom/tester.py @@ -20,7 +20,7 @@ class ExecutionFailure(Error, RuntimeError): pass class RsyncError(Error, EnvironmentError): pass -error_interno = u'\n**Error interno al preparar la entrega.**' +error_interno = _(u'\n**Error interno al preparar la entrega.**') def unzip(bytes, dst): # {{{ log.debug(_(u'Intentando descomprimir en %s') % dst) diff --git a/testtester.py b/testtester.py index 4e7f951..b7b7fd4 100644 --- a/testtester.py +++ b/testtester.py @@ -1,21 +1,26 @@ #!/usr/bin/python # vim: set et sw=4 sts=4 encoding=utf-8 foldmethod=marker : +#{{{ TG config/hacks import turbogears import turbogears.database turbogears.update_config(configfile="dev.cfg", modulename="sercom.config") +import turbogears.i18n +__builtins__._ = turbogears.i18n.plain_gettext # Nada de gettext lazy +#}}} + from sercom.tester import * from sercom import model from Queue import Queue +from os.path import join -queue = Queue() +q = Queue() -queue.put(1) -#queue.put(5) -queue.put(None) +q.put(1) +#q.put(5) +q.put(None) -tester = Tester(name='pepe', path='var', home=os.path.join('home', 'sercom'), - queue=queue) +tester = Tester(name='pepe', path='var', home=join('home', 'sercom'), queue=q) tester.run() -- 2.43.0