From 0120fe0a657eae524c33c126acf1344de6260f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Tue, 26 Oct 2010 09:31:41 +0400 Subject: [PATCH] Bugfix format patch. --- pym/format/patch.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pym/format/patch.py b/pym/format/patch.py index 91dbde4..de73890 100644 --- a/pym/format/patch.py +++ b/pym/format/patch.py @@ -76,6 +76,12 @@ class patch(_error): if node.tagName == "reg": if node.firstChild: reText = node.firstChild.nodeValue + if reText is None: + textNode = node.toxml().encode("UTF8") + self.setError(\ + _("Incorrect text template")+ ": \n" +\ + "%s" %textNode) + return False else: self.setError(\ _("Incorrect text template ''")) @@ -91,11 +97,16 @@ class patch(_error): self.setError(\ _("Incorrect text template '%s'")\ %reText) - return False elif node.tagName == "text" and regex: if node.firstChild: text = node.firstChild.nodeValue + if text is None: + textNode = node.toxml().encode("UTF8") + self.setError(\ + _("Incorrect text template")+ ": \n" +\ + "%s" %textNode) + return False else: text = "" dataList.append((regex, text))