import sys
import re
-import string
import commands
import warnings
mapping = { "<screen>" : "<pre>", "</screen>" : "</pre>",
"<para>" : "<p>", "</para>" : "</p>" ,
"<function>" : "<link>", "</function>" : "</link>" }
- for str in mapping:
- text = string.replace(text, str, mapping[str])
+ for m in mapping:
+ text = text.replace(m, mapping[m])
return text
def html(text):
return section2html(paramdef2html(text))
def cdata1(text):
- return string.replace(text, "&", "&")
+ return text.replace("&", "&")
def cdata31(text):
- return string.replace(string.replace(text, "<","<"), ">",">")
+ text = text.replace("<","<")
+ return text.replace(">",">")
def cdata3(text):
return cdata31(cdata1(text))
def cdata43(text):
- return string.replace(text,"\"", """)
+ return text.replace("\"", """)
def cdata41(text):
return cdata43(cdata31(text))
def cdata4(text):
from zzipdoc.match import Match
-import string
class dbk2htm_conversion:
mapping = { "<screen>" : "<pre>", "</screen>" : "</pre>",
pass
def section2html(self, text):
for str in self.mapping:
- text = string.replace(text, str, self.mapping[str])
+ text = text.replace(str, self.mapping[str])
return text
def paramdef2html(self, text):
s = Match()