1763 """Checks the modtime of files and generates language.doc.""" 1770 tim = os.path.getmtime(fTplName)
1778 if os.path.isfile(fDocName):
1791 pos = doctpl.find(
'/***')
1793 doctpl = doctpl[pos:]
1799 s = (
'Do not edit this file. It was generated by the %s script.\n' +\
1800 ' * Edit the %s and %s files instead.') % (
1802 tplDic[
'editnote'] = s
1810 ahref +=
'</code></a>' 1811 tplDic[
'translatorReportLink'] = ahref
1818 <table align="center" cellspacing="0" cellpadding="0" border="0"> 1819 <tr bgcolor="#000000"> 1821 <table cellspacing="1" cellpadding="2" border="0"> 1822 <tr bgcolor="#4040c0"> 1823 <td ><b><font size="+1" color="#ffffff"> Language </font></b></td> 1824 <td ><b><font size="+1" color="#ffffff"> Maintainer </font></b></td> 1825 <td ><b><font size="+1" color="#ffffff"> Contact address </font> 1826 <font size="-2" color="#ffffff">(replace the at and dot)</font></b></td> 1827 <td ><b><font size="+1" color="#ffffff"> Status </font></b></td> 1829 <!-- table content begin --> 1831 <!-- table content end --> 1839 htmlTableTpl = textwrap.dedent(htmlTableTpl)
1840 htmlTrTpl =
'\n <tr bgcolor="#ffffff">%s\n </tr>' 1841 htmlTdTpl =
'\n <td>%s</td>' 1842 htmlTdStatusColorTpl =
'\n <td bgcolor="%s">%s</td>' 1847 for name, obj
in self.
langLst:
1852 if obj.readableStatus.startswith(
'1.4'):
1857 lst = [ htmlTdStatusColorTpl % (bkcolor, obj.langReadable) ]
1865 if obj.status ==
'En':
1867 classId = obj.classId[:-2]
1870 mm =
'see the %s language' % lang
1878 name = maintainer[0]
1879 if name.startswith(
'--'):
1880 name =
'<span style="color: red; background-color: yellow">'\
1883 mm =
'<br/>'.join(lm)
1888 rexMark = re.compile(
'(?P<mark>\\[.*?\\])')
1891 address = maintainer[1]
1892 m = rexMark.search(address)
1894 address =
'<span style="color: brown">'\
1895 + m.group(
'mark') +
'</span>' 1897 ee =
'<br/>'.join(le)
1900 lst.append(htmlTdTpl % mm)
1901 lst.append(htmlTdTpl % ee)
1905 lst.append(htmlTdStatusColorTpl % (bgcolor, obj.readableStatus))
1908 trlst.append(htmlTrTpl % (
''.join(lst)))
1911 htmlTable = htmlTableTpl % (
''.join(trlst))
1914 latexTableTpl =
r''' 1917 \begin{longtable}{|l|l|l|l|} 1919 {\bf Language} & {\bf Maintainer} & {\bf Contact address} & {\bf Status} \\ 1927 latexTableTpl = textwrap.dedent(latexTableTpl)
1928 latexLineTpl =
'\n' +
r' %s & %s & {\tt\tiny %s} & %s \\' 1933 for name, obj
in self.
langLst:
1942 lang = obj.langReadable
1945 if obj.status ==
'En':
1947 classId = obj.classId[:-2]
1950 maintainer =
'see the %s language' % langNE
1955 maintainer = maintainers[0][0]
1956 email = maintainers[0][1]
1958 status = obj.readableStatus
1963 trlst.append(
'\n \\hline')
1964 s = latexLineTpl % (lang, maintainer, email, status)
1965 s = s.replace(
'_',
'\\_')
1972 for m
in maintainers[1:]:
1975 s = latexLineTpl % (lang, maintainer, email, status)
1976 s = s.replace(
'_',
'\\_')
1980 latexTable = latexTableTpl % (
''.join(trlst))
1983 tplDic[
'informationTable'] = htmlTable +
'\n' + latexTable
1986 f =
xopen(fDocName,
'w')
1987 f.write(doctpl % tplDic)
def generateLanguageDoc(self)
def xopen(fname, mode='r', encoding='utf-8-sig')
def __loadMaintainers(self)
def getBgcolorByReadableStatus(self, readableStatus)