summaryrefslogtreecommitdiffstats
path: root/doc/translator.py
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-08-16 11:14:23 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-08-16 11:14:23 (GMT)
commitf7bd440af03ef881d1b4b8ec891cebf9e9728eed (patch)
tree72a533cfcbb8f7d7644dd98048e349322fcda09a /doc/translator.py
parent9d7090da21fd190b7396624b42814eb66310271c (diff)
downloadDoxygen-f7bd440af03ef881d1b4b8ec891cebf9e9728eed.zip
Doxygen-f7bd440af03ef881d1b4b8ec891cebf9e9728eed.tar.gz
Doxygen-f7bd440af03ef881d1b4b8ec891cebf9e9728eed.tar.bz2
Building documentation after changing language files
- make `GLOB` for language files consistent with `GLOB` usage in e.g. `src` - make building of `language.doc ` depending on the language files as well - don't copy translator and other input files and handle this also in translator.py - update documentation (Found after Swedish language was updated and tried to build documentation on a non new directory)
Diffstat (limited to 'doc/translator.py')
-rw-r--r--doc/translator.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/doc/translator.py b/doc/translator.py
index c04a367..c4c75ef 100644
--- a/doc/translator.py
+++ b/doc/translator.py
@@ -1231,10 +1231,14 @@ class TrManager:
self.src_path = os.path.join(self.doxy_path, 'src')
# Normally the original sources aren't in the current directory
# (as we are in the build directory) so we have to specify the
- # original source directory.
+ # original source /documentation / ... directory.
self.org_src_path = self.src_path
+ self.org_doc_path = self.doc_path
+ self.org_doxy_path = self.doxy_path
if (len(sys.argv) > 1 and os.path.isdir(os.path.join(sys.argv[1], 'src'))):
self.org_src_path = os.path.join(sys.argv[1], 'src')
+ self.org_doc_path = os.path.join(sys.argv[1], 'doc')
+ self.org_doxy_path = sys.argv[1]
# Get the explicit arguments of the script.
self.script_argLst = sys.argv[2:]
else:
@@ -1290,7 +1294,7 @@ class TrManager:
# The translator.h must exist (the Transl object will check it),
# create the object for it and let it build the dictionary of
# required methods.
- tr = Transl(os.path.join(self.src_path, 'translator.h'), self)
+ tr = Transl(os.path.join(self.org_src_path, 'translator.h'), self)
self.requiredMethodsDic = tr.collectPureVirtualPrototypes()
tim = tr.getmtime()
if tim > self.lastModificationTime:
@@ -1298,7 +1302,7 @@ class TrManager:
# The translator_adapter.h must exist (the Transl object will check it),
# create the object for it and store the reference in the dictionary.
- tr = Transl(os.path.join(self.src_path, 'translator_adapter.h'), self)
+ tr = Transl(os.path.join(self.org_src_path, 'translator_adapter.h'), self)
self.adaptMethodsDic = tr.collectAdapterPrototypes()
tim = tr.getmtime()
if tim > self.lastModificationTime:
@@ -1310,11 +1314,11 @@ class TrManager:
if self.script_argLst:
lst = ['translator_' + x + '.h' for x in self.script_argLst]
for fname in lst:
- if not os.path.isfile(os.path.join(self.src_path, fname)):
+ if not os.path.isfile(os.path.join(self.org_src_path, fname)):
sys.stderr.write("\a\nFile '%s' not found!\n" % fname)
sys.exit(1)
else:
- lst = os.listdir(self.src_path)
+ lst = os.listdir(self.org_src_path)
lst = [x for x in lst if x[:11] == 'translator_'
and x[-2:] == '.h'
and x != 'translator_adapter.h']
@@ -1323,7 +1327,7 @@ class TrManager:
# content of the file. Then insert the object to the dictionary
# accessed via classId.
for fname in lst:
- fullname = os.path.join(self.src_path, fname)
+ fullname = os.path.join(self.org_src_path, fname)
tr = Transl(fullname, self)
tr.processing()
assert(tr.classId != 'Translator')
@@ -1402,7 +1406,7 @@ class TrManager:
self.numLang -= 1 # the couple will be counted as one
# Extract the version of Doxygen.
- f = xopen(os.path.join(self.doxy_path, 'VERSION'))
+ f = xopen(os.path.join(self.org_doxy_path, 'VERSION'))
self.doxVersion = f.readline().strip()
f.close()
@@ -1557,7 +1561,7 @@ class TrManager:
# The e-mail addresses of the maintainers will be collected to
# the auxiliary file in the order of translator classes listed
# in the translator report.
- fmail = xopen('mailto.txt', 'w')
+ fmail = xopen(os.path.join(self.doc_path, 'mailto.txt'), 'w')
# Write the list of "up-to-date" translator classes.
if self.upToDateIdLst:
@@ -1720,7 +1724,7 @@ class TrManager:
Fills the dictionary classId -> [(name, e-mail), ...]."""
- fname = os.path.join(self.doc_path, self.maintainersFileName)
+ fname = os.path.join(self.org_doc_path, self.maintainersFileName)
# Include the maintainers file to the group of files checked with
# respect to the modification time.
@@ -1775,7 +1779,7 @@ class TrManager:
# Check the last modification time of the template file. It is the
# last file from the group that decide whether the documentation
# should or should not be generated.
- fTplName = os.path.join(self.doc_path, self.languageTplFileName)
+ fTplName = os.path.join(self.org_doc_path, self.languageTplFileName)
tim = os.path.getmtime(fTplName)
if tim > self.lastModificationTime:
self.lastModificationTime = tim