Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
25908eb4
Commit
25908eb4
authored
Sep 13, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34 from pepr/master
Enhanced visualization of the TranslatorXxxx status.
parents
b07832a1
0f275314
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
126 deletions
+181
-126
language.doc
doc/language.doc
+102
-99
language.tpl
doc/language.tpl
+15
-12
translator.py
doc/translator.py
+64
-15
No files found.
doc/language.doc
View file @
25908eb4
This diff is collapsed.
Click to expand it.
doc/language.tpl
View file @
25908eb4
...
@@ -93,6 +93,7 @@ This file should now contain a \#define for your language code.
...
@@ -93,6 +93,7 @@ This file should now contain a \#define for your language code.
the \c HEADERS line.
the \c HEADERS line.
<li>
Edit
<code>
translator_xx.h
</code>
:
<li>
Edit
<code>
translator_xx.h
</code>
:
<ul>
<ul>
<li>
Use the UTF-8 capable editor and open the file using the UTF-8 mode.
<li>
Rename
<code>
TRANSLATOR_EN_H
</code>
to
<code>
TRANSLATOR_XX_H
</code>
<li>
Rename
<code>
TRANSLATOR_EN_H
</code>
to
<code>
TRANSLATOR_XX_H
</code>
twice (i.e. in the \c \#ifndef and \c \#define preprocessor commands at
twice (i.e. in the \c \#ifndef and \c \#define preprocessor commands at
the beginning of the file).
the beginning of the file).
...
@@ -100,18 +101,17 @@ This file should now contain a \#define for your language code.
...
@@ -100,18 +101,17 @@ This file should now contain a \#define for your language code.
<li>
In the member
<code>
idLanguage()
</code>
change "english" into the
<li>
In the member
<code>
idLanguage()
</code>
change "english" into the
name of your language (use lower case characters only). Depending
name of your language (use lower case characters only). Depending
on the language you may also wish to change the member functions
on the language you may also wish to change the member functions
latexLanguageSupportCommand()
, idLanguageCharset() and others
latexLanguageSupportCommand()
and other (you will recognize them when
(you will recognize them when
you start the work).
you start the work).
<li>
Edit all the strings that are returned by the member functions that
<li>
Edit all the strings that are returned by the member functions that
start with tr.
start with
\c
tr.
Try to match punctuation and capitals!
Try to match punctuation and capitals!
To enter special characters (with accents) you can:
To enter special characters (with accents) you can:
<ul>
<ul>
<li>
Enter them directly if your keyboard supports that and you are
<li>
Enter them directly if your keyboard supports that. Recall that
using a Latin-1 font. Doxygen will translate the
the text is expected to be saved using the UTF-8 encoding. Doxygen
characters to proper \f$\mbox{\LaTeX}\f$ and leave the
will translate the characters to proper \f$\mbox{\LaTeX}\f$ and
HTML and man output for what it is (which is fine, if
leaves the HTML and man output in UTF-8.
idLanguageCharset() is set correctly).
<li>
Use html codes like \
ä
for an a with an umlaut (i.e.
ä
).
<li>
Use html codes like \
ä
for an a with an umlaut (i.e.
ä
).
See the HTML specification for the codes.
See the HTML specification for the codes.
</ul>
</ul>
...
@@ -122,7 +122,8 @@ This file should now contain a \#define for your language code.
...
@@ -122,7 +122,8 @@ This file should now contain a \#define for your language code.
in the config file to generate output in your language.
in the config file to generate output in your language.
<li>
Send
<code>
translator_xx.h
</code>
to me so I can add it to doxygen.
<li>
Send
<code>
translator_xx.h
</code>
to me so I can add it to doxygen.
Send also your name and e-mail address to be included in the
Send also your name and e-mail address to be included in the
\c maintainers.txt list.
\c maintainers.txt list. You can also clone the Doxygen repository
at GitHub and make a PullRequest later.
</ol>
</ol>
...
@@ -299,9 +300,11 @@ end with <code>=0;</code>).
...
@@ -299,9 +300,11 @@ end with <code>=0;</code>).
If everything compiles fine, try to run \c translator.py, and have a
If everything compiles fine, try to run \c translator.py, and have a
look at the translator report (ASCII file) at the \c doxygen/doc
look at the translator report (ASCII file) at the \c doxygen/doc
directory. Even if your translator is marked as up-to-date, there
directory. Your translator is marked as up-to-date only if the script
still may be some remarks related to your source code. Namely, the
does not detect anything special. If the translator uses the \c Translator
obsolete methods--that are not used at all--may be listed in the
base class, there still may be some remarks related to your source code.
In the case, the translator is marked as
<em>
almost up-to-date
</em>
.
Namely, the obsolete methods--that are not used at all--may be listed in the
section for your language. Simply, remove their code (and run the \c
section for your language. Simply, remove their code (and run the \c
translator.py again). Also, you will be informed when you forgot to
translator.py again). Also, you will be informed when you forgot to
change the base class of your translator class to some newer adapter
change the base class of your translator class to some newer adapter
...
...
doc/translator.py
View file @
25908eb4
...
@@ -62,6 +62,8 @@
...
@@ -62,6 +62,8 @@
was prefixed by backslash (was LaTeX related error).
was prefixed by backslash (was LaTeX related error).
2013/02/19 - Better diagnostics when translator_xx.h is too crippled.
2013/02/19 - Better diagnostics when translator_xx.h is too crippled.
2013/06/25 - TranslatorDecoder checks removed after removing the class.
2013/06/25 - TranslatorDecoder checks removed after removing the class.
2013/09/04 - Coloured status in langhowto. *ALMOST up-to-date* category
of translators introduced.
"""
"""
from
__future__
import
generators
from
__future__
import
generators
...
@@ -1123,7 +1125,7 @@ class Transl:
...
@@ -1123,7 +1125,7 @@ class Transl:
if
not
self
.
missingMethods
:
if
not
self
.
missingMethods
:
self
.
note
=
'Change the base class to Translator.'
self
.
note
=
'Change the base class to Translator.'
self
.
status
=
''
self
.
status
=
''
self
.
readableStatus
=
'up-to-date'
self
.
readableStatus
=
'
almost
up-to-date'
elif
self
.
baseClassId
!=
'TranslatorEnglish'
:
elif
self
.
baseClassId
!=
'TranslatorEnglish'
:
# The translator uses some of the adapters.
# The translator uses some of the adapters.
# Look at the missing methods and check what adapter
# Look at the missing methods and check what adapter
...
@@ -1169,6 +1171,11 @@ class Transl:
...
@@ -1169,6 +1171,11 @@ class Transl:
if
not
self
.
note
and
self
.
status
==
''
and
self
.
obsoleteMethods
:
if
not
self
.
note
and
self
.
status
==
''
and
self
.
obsoleteMethods
:
self
.
note
=
'Remove the obsolete methods (never used).'
self
.
note
=
'Remove the obsolete methods (never used).'
# If there is at least some note but the status suggests it is
# otherwise up-to-date, mark is as ALMOST up-to-date.
if
self
.
note
and
self
.
status
==
''
:
self
.
readableStatus
=
'almost up-to-date'
def
report
(
self
,
fout
):
def
report
(
self
,
fout
):
"""Returns the report part for the source as a multiline string.
"""Returns the report part for the source as a multiline string.
...
@@ -1522,6 +1529,24 @@ class TrManager:
...
@@ -1522,6 +1529,24 @@ class TrManager:
return
lst
return
lst
def
getBgcolorByReadableStatus
(
self
,
readableStatus
):
if
readableStatus
==
'up-to-date'
:
color
=
'#ccffcc'
# green
elif
readableStatus
.
startswith
(
'almost'
):
color
=
'#ffffff'
# white
elif
readableStatus
.
startswith
(
'English'
):
color
=
'#ccffcc'
# green
elif
readableStatus
.
startswith
(
'1.8'
):
color
=
'#ffffcc'
# yellow
elif
readableStatus
.
startswith
(
'1.7'
):
color
=
'#ffcccc'
# pink
elif
readableStatus
.
startswith
(
'1.6'
):
color
=
'#ffcccc'
# pink
else
:
color
=
'#ff5555'
# red
return
color
def
generateTranslatorReport
(
self
):
def
generateTranslatorReport
(
self
):
"""Generates the translator report."""
"""Generates the translator report."""
...
@@ -1558,13 +1583,12 @@ class TrManager:
...
@@ -1558,13 +1583,12 @@ class TrManager:
# in the translator report.
# in the translator report.
fmail
=
open
(
'mailto.txt'
,
'w'
)
fmail
=
open
(
'mailto.txt'
,
'w'
)
# Write the list of
up-to-date
translator classes.
# Write the list of
"up-to-date"
translator classes.
if
self
.
upToDateIdLst
:
if
self
.
upToDateIdLst
:
s
=
'''The following translator classes are up-to-date (sorted
s
=
'''The following translator classes are up-to-date (sorted
alphabetically). This means that they derive from the
alphabetically). This means that they derive from the
Translator class and they implement all
%
d of the required
Translator class, they implement all
%
d of the required
methods. Anyway, there still may be some details listed even
methods, and even minor problems were not spotted by the script:'''
for them:'''
s
=
s
%
len
(
self
.
requiredMethodsDic
)
s
=
s
%
len
(
self
.
requiredMethodsDic
)
f
.
write
(
'-'
*
70
+
'
\n
'
)
f
.
write
(
'-'
*
70
+
'
\n
'
)
f
.
write
(
fill
(
s
)
+
'
\n\n
'
)
f
.
write
(
fill
(
s
)
+
'
\n\n
'
)
...
@@ -1572,19 +1596,35 @@ class TrManager:
...
@@ -1572,19 +1596,35 @@ class TrManager:
mailtoLst
=
[]
mailtoLst
=
[]
for
x
in
self
.
upToDateIdLst
:
for
x
in
self
.
upToDateIdLst
:
obj
=
self
.
__translDic
[
x
]
obj
=
self
.
__translDic
[
x
]
f
.
write
(
' '
+
obj
.
classId
)
if
obj
.
note
is
None
:
if
obj
.
note
:
f
.
write
(
' '
+
obj
.
classId
+
'
\n
'
)
f
.
write
(
' -- '
+
obj
.
note
)
f
.
write
(
'
\n
'
)
mailtoLst
.
extend
(
self
.
__emails
(
obj
.
classId
))
mailtoLst
.
extend
(
self
.
__emails
(
obj
.
classId
))
fmail
.
write
(
'up-to-date
\n
'
)
fmail
.
write
(
'up-to-date
\n
'
)
fmail
.
write
(
'; '
.
join
(
mailtoLst
))
fmail
.
write
(
'; '
.
join
(
mailtoLst
))
# Write separately the list of "ALMOST up-to-date" translator classes.
s
=
'''The following translator classes are ALMOST up-to-date (sorted
alphabetically). This means that they derive from the
Translator class, but there still may be some minor problems
listed for them:'''
f
.
write
(
'
\n
'
+
(
'-'
*
70
)
+
'
\n
'
)
f
.
write
(
fill
(
s
)
+
'
\n\n
'
)
mailtoLst
=
[]
for
x
in
self
.
upToDateIdLst
:
obj
=
self
.
__translDic
[
x
]
if
obj
.
note
is
not
None
:
f
.
write
(
' '
+
obj
.
classId
+
'
\t
-- '
+
obj
.
note
+
'
\n
'
)
mailtoLst
.
extend
(
self
.
__emails
(
obj
.
classId
))
fmail
.
write
(
'
\n\n
almost up-to-date
\n
'
)
fmail
.
write
(
'; '
.
join
(
mailtoLst
))
# Write the list of the adapter based classes. The very obsolete
# Write the list of the adapter based classes. The very obsolete
# translators that derive from TranslatorEnglish are included.
# translators that derive from TranslatorEnglish are included.
if
self
.
adaptIdLst
:
if
self
.
adaptIdLst
:
s
=
'''The following translator classes need
some
maintenance
s
=
'''The following translator classes need maintenance
(the most obsolete at the end). The other info shows the
(the most obsolete at the end). The other info shows the
estimation of Doxygen version when the class was last
estimation of Doxygen version when the class was last
updated and number of methods that must be implemented to
updated and number of methods that must be implemented to
...
@@ -1828,14 +1868,22 @@ class TrManager:
...
@@ -1828,14 +1868,22 @@ class TrManager:
htmlTableTpl
=
dedent
(
htmlTableTpl
)
htmlTableTpl
=
dedent
(
htmlTableTpl
)
htmlTrTpl
=
u'
\n
<tr bgcolor="#ffffff">
%
s
\n
</tr>'
htmlTrTpl
=
u'
\n
<tr bgcolor="#ffffff">
%
s
\n
</tr>'
htmlTdTpl
=
u'
\n
<td>
%
s</td>'
htmlTdTpl
=
u'
\n
<td>
%
s</td>'
htmlTdStatusColorTpl
=
u'
\n
<td bgcolor="
%
s">
%
s</td>'
# Loop through transl objects in the order of sorted readable names
# Loop through transl objects in the order of sorted readable names
# and add generate the content of the HTML table.
# and add generate the content of the HTML table.
trlst
=
[]
trlst
=
[]
for
name
,
obj
in
self
.
langLst
:
for
name
,
obj
in
self
.
langLst
:
# Fill the table data elements for one row. The first element
# Fill the table data elements for one row. The first element
# contains the readable name of the language.
# contains the readable name of the language. Only the oldest
lst
=
[
htmlTdTpl
%
obj
.
langReadable
]
# translator are colour marked in the language columnt. Less
# "heavy" color is used (when compared with the Status column).
if
obj
.
readableStatus
.
startswith
(
'1.4'
):
bkcolor
=
self
.
getBgcolorByReadableStatus
(
'1.6'
)
else
:
bkcolor
=
'#ffffff'
lst
=
[
htmlTdStatusColorTpl
%
(
bkcolor
,
obj
.
langReadable
)
]
# The next two elements contain the list of maintainers
# The next two elements contain the list of maintainers
# and the list of their mangled e-mails. For English-based
# and the list of their mangled e-mails. For English-based
...
@@ -1882,7 +1930,8 @@ class TrManager:
...
@@ -1882,7 +1930,8 @@ class TrManager:
lst
.
append
(
htmlTdTpl
%
ee
)
lst
.
append
(
htmlTdTpl
%
ee
)
# The last element contains the readable form of the status.
# The last element contains the readable form of the status.
lst
.
append
(
htmlTdTpl
%
obj
.
readableStatus
)
bgcolor
=
self
.
getBgcolorByReadableStatus
(
obj
.
readableStatus
)
lst
.
append
(
htmlTdStatusColorTpl
%
(
bgcolor
,
obj
.
readableStatus
))
# Join the table data to one table row.
# Join the table data to one table row.
trlst
.
append
(
htmlTrTpl
%
(
''
.
join
(
lst
)))
trlst
.
append
(
htmlTrTpl
%
(
''
.
join
(
lst
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment