diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-02-02 20:18:34 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-02-02 20:18:34 +0000 |
commit | cf9b9d397472cfbbdbf0db47975fc67020860c28 (patch) | |
tree | 5dd7fc87bc78fa2cbf12b0ab6c9f902afc2d1d2d /src/lib | |
parent | cd0f3c4da901ab9cecc0ff1cb73382df425e2c7b (diff) | |
download | bcfg2-cf9b9d397472cfbbdbf0db47975fc67020860c28.tar.gz bcfg2-cf9b9d397472cfbbdbf0db47975fc67020860c28.tar.bz2 bcfg2-cf9b9d397472cfbbdbf0db47975fc67020860c28.zip |
Fix unicode error messages
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5057 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/TCheetah.py | 5 | ||||
-rw-r--r-- | src/lib/Server/Plugins/TGenshi.py | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/Server/Plugins/TCheetah.py b/src/lib/Server/Plugins/TCheetah.py index 9806e5787..9065b5ceb 100644 --- a/src/lib/Server/Plugins/TCheetah.py +++ b/src/lib/Server/Plugins/TCheetah.py @@ -14,6 +14,7 @@ class TemplateFile: self.specific = specific self.encoding = encoding self.template = None + self.searchlist = dict() def handle_event(self, event): '''Handle all fs events for this template''' @@ -22,7 +23,8 @@ class TemplateFile: try: s = {'useStackFrames': False} self.template = Cheetah.Template.Template(open(self.name).read(), - compilerSettings=s) + compilerSettings=s, + searchList=self.searchlist) except Cheetah.Parser.ParseError, perror: logger.error("Cheetah parse error for file %s" % (self.name)) logger.error(perror.report()) @@ -40,7 +42,6 @@ class TemplateFile: if type(self.template) == unicode: entry.text = self.template else : - logger.debug("Override encoding of template to %s" % self.encoding) entry.text = unicode(str(self.template), self.encoding) except: (a, b, c) = sys.exc_info() diff --git a/src/lib/Server/Plugins/TGenshi.py b/src/lib/Server/Plugins/TGenshi.py index 40e65b877..3743517a9 100644 --- a/src/lib/Server/Plugins/TGenshi.py +++ b/src/lib/Server/Plugins/TGenshi.py @@ -72,16 +72,12 @@ class TemplateFile: if type(textdata) == unicode: entry.text = textdata else: - if self.encoding != 'ascii': - logger.debug("Override encoding of %s TGenshi template to %s" % (self.name, self.encoding)) entry.text = unicode(textdata, self.encoding) else: xmldata = stream.render('xml') if type(xmldata) == unicode: entry.text = xmldata else: - if self.encoding != 'ascii': - logger.debug("Override encoding of %s TGenshi template to %s" % (self.name, self.encoding)) entry.text = unicode(xmldata, self.encoding) except TemplateError, terror: logger.error('Genshi template error: %s' % terror) |