1 # Copyright (c) 2004 Danilo Segan <danilo@kvota.net>.
\r
3 # This file is part of xml2po.
\r
5 # xml2po is free software; you can redistribute it and/or modify
\r
6 # it under the terms of the GNU General Public License as published by
\r
7 # the Free Software Foundation; either version 2 of the License, or
\r
8 # (at your option) any later version.
\r
10 # xml2po is distributed in the hope that it will be useful,
\r
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 # GNU General Public License for more details.
\r
15 # You should have received a copy of the GNU General Public License
\r
16 # along with xml2po; if not, write to the Free Software Foundation, Inc.,
\r
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 # Abstract class; use it only to construct other special-handling classes
\r
24 """Abstract class for special handling of document types."""
\r
25 def getIgnoredTags(self):
\r
26 "Returns array of tags to be ignored."
\r
29 def getFinalTags(self):
\r
30 "Returns array of tags to be considered 'final'."
\r
33 def getSpacePreserveTags(self):
\r
34 "Returns array of tags in which spaces are to be preserved."
\r
37 def preProcessXml(self, doc, msg):
\r
38 "Preprocess a document and perhaps adds some messages."
\r
41 def postProcessXmlTranslation(self, doc, language, translators):
\r
42 """Sets a language and translators in "doc" tree.
\r
44 "translators" is a string consisted of translator credits.
\r
45 "language" is a simple string.
\r
46 "doc" is a libxml2.xmlDoc instance."""
\r
49 def getStringForTranslators(self):
\r
50 """Returns None or a string to be added to PO files.
\r
52 Common example is 'translator-credits'."""
\r
55 def getCommentForTranslators(self):
\r
56 """Returns a comment to be added next to string for crediting translators.
\r
58 It should explain the format of the string provided by getStringForTranslators()."""
\r