Commit 962ad74f authored by Petr Prikryl's avatar Petr Prikryl
Browse files

Merge branch 'master' into devel

parents 39bdafef 8cac977d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -167,7 +167,7 @@ void InputString::setEnabled(bool state)
{
{
  m_lab->setEnabled(state);
  m_lab->setEnabled(state);
  if (m_le)  m_le->setEnabled(state);
  if (m_le)  m_le->setEnabled(state);
  if (m_im)  m_le->setEnabled(state);
  if (m_im)  m_im->setEnabled(state);
  if (m_br)  m_br->setEnabled(state);
  if (m_br)  m_br->setEnabled(state);
  if (m_com) m_com->setEnabled(state);
  if (m_com) m_com->setEnabled(state);
  updateDefault();
  updateDefault();
+14 −6
Original line number Original line Diff line number Diff line
@@ -594,9 +594,10 @@ fi


# - check for python ----------------------------------------------------------
# - check for python ----------------------------------------------------------


python_version=0
printf "  Checking for python... "
printf "  Checking for python... "
if test "$f_python" = NO; then
if test "$f_python" = NO; then
  python_names="python2 python"
  python_names="python3 python2 python"
  python_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
  python_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
  python_prog=NO
  python_prog=NO
  python_found=NO
  python_found=NO
@@ -604,9 +605,16 @@ if test "$f_python" = NO; then
    for j in $python_dirs; do
    for j in $python_dirs; do
      if test -x "$j/$i"; then
      if test -x "$j/$i"; then
        python_found=YES
        python_found=YES
        if test `$j/$i -c "import sys; print sys.version_info[0]"` = 2; then
        if test `$j/$i -c "import sys; print(sys.version_info[0])"` = 3; then
          python_prog="$j/$i"
          python_prog="$j/$i";
          python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
          break 2
          break 2
        elif test `$j/$i -c "import sys; print(sys.version_info[0])"` = 2; then
          if test `$j/$i -c "import sys; print(sys.version_info[1])"` -ge 6; then
            python_prog="$j/$i";
            python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
            break 2
          fi
        fi
        fi
      fi
      fi
    done
    done
@@ -616,14 +624,14 @@ fi


if test "$f_python" = NO; then
if test "$f_python" = NO; then
  if test "$python_found" = YES; then
  if test "$python_found" = YES; then
    echo "version should be python 2."
    echo "version should be python 2.6 or higher."
  else
  else
    echo "not found!";
    echo "not found!";
  fi
  fi
  echo
  echo
  exit 2
  exit 2
fi
fi
echo "using $f_python";
echo "using $f_python (version $python_version)";


# - check for perl ------------------------------------------------------------
# - check for perl ------------------------------------------------------------


+1 −0
Original line number Original line Diff line number Diff line
@@ -556,6 +556,7 @@ open-source tools:
<li>GNU bison version 2.5 (Linux) and 2.3 (MacOSX)
<li>GNU bison version 2.5 (Linux) and 2.3 (MacOSX)
<li>GNU make version 3.81
<li>GNU make version 3.81
<li>Perl version 5.12
<li>Perl version 5.12
<li>Python verion 2.7 and 3.4
<li>TeX Live 2009 (or later)
<li>TeX Live 2009 (or later)
</ul>
</ul>


+2002 −2029
Original line number Original line Diff line number Diff line
@@ -66,11 +66,31 @@
               of translators introduced.
               of translators introduced.
  """
  """


from __future__ import generators
import codecs
import os
import os
import platform
import re
import re
import sys
import sys
import textwrap


def xopen(fname, mode='r', encoding='utf-8-sig'):
    '''Unified open of text files with UTF-8 default encoding.

    The 'utf-8-sig' skips the BOM automatically.
    '''

    # Use UTF-8 without BOM when writing to a text file.
    if encoding == 'utf-8-sig' and mode == 'w':
        encoding = 'utf-8'

    major, minor, patch = (int(e) for e in platform.python_version_tuple())
    if major == 2:
        if mode == 'w':
            mode = 'wU'
        import codecs
        return codecs.open(fname, mode=mode, encoding=encoding) # Python 2
    else:
        return open(fname, mode=mode, encoding=encoding)        # Python 3




def fill(s):
def fill(s):
@@ -99,58 +119,6 @@ def fill(s):
    return '\n'.join(lines)
    return '\n'.join(lines)




# The following function dedent() is the verbatim copy from the textwrap.py
# module. The textwrap.py was introduced in Python 2.3. To make this script
# working also in older Python versions, I have decided to copy it.
# Notice that the textwrap.py is copyrighted:
#
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
#
# The explicit permission to use the code here was sent by Guido van Rossum
# (4th June, 2004).
#
def dedent(text):
    """dedent(text : string) -> string

    Remove any whitespace than can be uniformly removed from the left
    of every line in `text`.

    This can be used e.g. to make triple-quoted strings line up with
    the left edge of screen/whatever, while still presenting it in the
    source code in indented form.

    For example:

        def test():
            # end first line with \ to avoid the empty line!
            s = '''\
            hello
              world
            '''
            print repr(s)          # prints '    hello\n      world\n    '
            print repr(dedent(s))  # prints 'hello\n  world\n'
    """
    lines = text.expandtabs().split('\n')
    margin = None
    for line in lines:
        content = line.lstrip()
        if not content:
            continue
        indent = len(line) - len(content)
        if margin is None:
            margin = indent
        else:
            margin = min(margin, indent)

    if margin is not None and margin > 0:
        for i in range(len(lines)):
            lines[i] = lines[i][margin:]

    return '\n'.join(lines)


class Transl:
class Transl:
    """One instance is build for each translator.
    """One instance is build for each translator.


@@ -237,7 +205,7 @@ class Transl:


        # Open the file for reading and extracting tokens until the eof.
        # Open the file for reading and extracting tokens until the eof.
        # Initialize the finite automaton.
        # Initialize the finite automaton.
        f = open(self.fname)
        f = xopen(self.fname)
        lineNo = 0
        lineNo = 0
        line = ''         # init -- see the pos initialization below
        line = ''         # init -- see the pos initialization below
        linelen = 0       # init
        linelen = 0       # init
@@ -256,8 +224,6 @@ class Transl:
            else:
            else:
                lineNo += 1
                lineNo += 1
                line = f.readline()
                line = f.readline()
                if line.startswith('\xef\xbb\xbf'):
                    line = line[3:]    # skip the BOM
                linelen = len(line)
                linelen = len(line)
                pos = 0
                pos = 0
                if line == '':         # eof
                if line == '':         # eof
@@ -276,7 +242,7 @@ class Transl:
                    # If it is an unknown item, it can still be recognized
                    # If it is an unknown item, it can still be recognized
                    # here. Keywords and separators are the example.
                    # here. Keywords and separators are the example.
                    if tokenId == 'unknown':
                    if tokenId == 'unknown':
                        if tokenDic.has_key(tokenStr):
                        if tokenStr in tokenDic:
                            tokenId = tokenDic[tokenStr]
                            tokenId = tokenDic[tokenStr]
                        elif tokenStr.isdigit():
                        elif tokenStr.isdigit():
                            tokenId = 'num'
                            tokenId = 'num'
@@ -329,7 +295,7 @@ class Transl:
                    tokenStr = c
                    tokenStr = c
                    tokenLineNo = lineNo
                    tokenLineNo = lineNo
                    status = 8
                    status = 8
                elif tokenDic.has_key(c):  # known one-char token
                elif c in tokenDic:  # known one-char token
                    tokenId = tokenDic[c]
                    tokenId = tokenDic[c]
                    tokenStr = c
                    tokenStr = c
                    tokenLineNo = lineNo
                    tokenLineNo = lineNo
@@ -424,7 +390,7 @@ class Transl:
                if c.isspace():
                if c.isspace():
                    pos += 1
                    pos += 1
                    status = 0           # tokenId may be determined later
                    status = 0           # tokenId may be determined later
                elif tokenDic.has_key(c):  # separator, don't move pos
                elif c in tokenDic:  # separator, don't move pos
                    status = 0
                    status = 0
                else:
                else:
                    tokenStr += c        # collect
                    tokenStr += c        # collect
@@ -457,7 +423,7 @@ class Transl:


            # Always assume that the previous tokens were processed. Get
            # Always assume that the previous tokens were processed. Get
            # the next one.
            # the next one.
            tokenId, tokenStr, tokenLineNo = tokenIterator.next()
            tokenId, tokenStr, tokenLineNo = next(tokenIterator)


            # Process the token and never return back.
            # Process the token and never return back.
            if status == 0:    # waiting for the 'class' keyword.
            if status == 0:    # waiting for the 'class' keyword.
@@ -588,7 +554,7 @@ class Transl:
        while status != 777:
        while status != 777:


            # Get the next token.
            # Get the next token.
            tokenId, tokenStr, tokenLineNo = tokenIterator.next()
            tokenId, tokenStr, tokenLineNo = next(tokenIterator)


            if status == 0:      # waiting for 'public:'
            if status == 0:      # waiting for 'public:'
                if tokenId == 'public':
                if tokenId == 'public':
@@ -670,7 +636,7 @@ class Transl:


            elif status == 9:    # after semicolon, produce the dic item
            elif status == 9:    # after semicolon, produce the dic item
                if tokenId == 'semic':
                if tokenId == 'semic':
                    assert(not resultDic.has_key(uniPrototype))
                    assert(uniPrototype not in resultDic)
                    resultDic[uniPrototype] = prototype
                    resultDic[uniPrototype] = prototype
                    status = 2
                    status = 2
                else:
                else:
@@ -752,7 +718,7 @@ class Transl:


        # Eat the rest of the source to cause closing the file.
        # Eat the rest of the source to cause closing the file.
        while tokenId != 'eof':
        while tokenId != 'eof':
            tokenId, tokenStr, tokenLineNo = tokenIterator.next()
            tokenId, tokenStr, tokenLineNo = next(tokenIterator)


        # Return the resulting dictionary with 'uniPrototype -> prototype'.
        # Return the resulting dictionary with 'uniPrototype -> prototype'.
        return resultDic
        return resultDic
@@ -800,7 +766,7 @@ class Transl:
        while status != 777:
        while status != 777:


            # Get the next token.
            # Get the next token.
            tokenId, tokenStr, tokenLineNo = tokenIterator.next()
            tokenId, tokenStr, tokenLineNo = next(tokenIterator)


            if status == 0:      # waiting for 'public:'
            if status == 0:      # waiting for 'public:'
                if tokenId == 'public':
                if tokenId == 'public':
@@ -912,7 +878,7 @@ class Transl:
                            sys.stderr.write(msg)
                            sys.stderr.write(msg)
                            assert False
                            assert False


                        assert(not self.prototypeDic.has_key(uniPrototype))
                        assert(uniPrototype not in self.prototypeDic)
                        # Insert new dictionary item.
                        # Insert new dictionary item.
                        self.prototypeDic[uniPrototype] = prototype
                        self.prototypeDic[uniPrototype] = prototype
                        status = 2      # body consumed
                        status = 2      # body consumed
@@ -1056,12 +1022,12 @@ class Transl:
                # For the required methods, update the dictionary of methods
                # For the required methods, update the dictionary of methods
                # implemented by the adapter.
                # implemented by the adapter.
                for protoUni in self.prototypeDic:
                for protoUni in self.prototypeDic:
                    if reqDic.has_key(protoUni):
                    if protoUni in reqDic:
                        # This required method will be marked as implemented
                        # This required method will be marked as implemented
                        # by this adapter class. This implementation assumes
                        # by this adapter class. This implementation assumes
                        # that newer adapters do not reimplement any required
                        # that newer adapters do not reimplement any required
                        # methods already implemented by older adapters.
                        # methods already implemented by older adapters.
                        assert(not adaptDic.has_key(protoUni))
                        assert(protoUni not in adaptDic)
                        adaptDic[protoUni] = (version, self.classId)
                        adaptDic[protoUni] = (version, self.classId)


                # Clear the dictionary object and the information related
                # Clear the dictionary object and the information related
@@ -1094,7 +1060,7 @@ class Transl:
        # Eat the rest of the source to cause closing the file.
        # Eat the rest of the source to cause closing the file.
        while True:
        while True:
            try:
            try:
                t = tokenIterator.next()
                t = next(tokenIterator)
            except StopIteration:
            except StopIteration:
                break
                break


@@ -1106,7 +1072,7 @@ class Transl:
        # Build the list of obsolete methods.
        # Build the list of obsolete methods.
        self.obsoleteMethods = []
        self.obsoleteMethods = []
        for p in myDic:
        for p in myDic:
            if not reqDic.has_key(p):
            if p not in reqDic:
                self.obsoleteMethods.append(p)
                self.obsoleteMethods.append(p)


        # Build the list of missing methods and the list of implemented
        # Build the list of missing methods and the list of implemented
@@ -1114,7 +1080,7 @@ class Transl:
        self.missingMethods = []
        self.missingMethods = []
        self.implementedMethods = []
        self.implementedMethods = []
        for p in reqDic:
        for p in reqDic:
            if myDic.has_key(p):
            if p in myDic:
                self.implementedMethods.append(p)
                self.implementedMethods.append(p)
            else:
            else:
                self.missingMethods.append(p)
                self.missingMethods.append(p)
@@ -1133,7 +1099,7 @@ class Transl:
                adaptMinVersion = '9.9.99'
                adaptMinVersion = '9.9.99'
                adaptMinClass = 'TranslatorAdapter_9_9_99'
                adaptMinClass = 'TranslatorAdapter_9_9_99'
                for uniProto in self.missingMethods:
                for uniProto in self.missingMethods:
                    if adaptDic.has_key(uniProto):
                    if uniProto in adaptDic:
                        version, cls = adaptDic[uniProto]
                        version, cls = adaptDic[uniProto]
                        if version < adaptMinVersion:
                        if version < adaptMinVersion:
                            adaptMinVersion = version
                            adaptMinVersion = version
@@ -1342,9 +1308,9 @@ class TrManager:
                    sys.exit(1)
                    sys.exit(1)
        else:
        else:
            lst = os.listdir(self.src_path)
            lst = os.listdir(self.src_path)
            lst = filter(lambda x: x[:11] == 'translator_'
            lst = [x for x in lst if x[:11] == 'translator_'
                                   and x[-2:] == '.h'
                                   and x[-2:] == '.h'
                                   and x != 'translator_adapter.h', lst)
                                   and x != 'translator_adapter.h']


        # Build the object for the translator_xx.h files, and process the
        # Build the object for the translator_xx.h files, and process the
        # content of the file. Then insert the object to the dictionary
        # content of the file. Then insert the object to the dictionary
@@ -1366,7 +1332,7 @@ class TrManager:
        # Build the auxiliary list with strings compound of the status,
        # Build the auxiliary list with strings compound of the status,
        # readable form of the language, and classId.
        # readable form of the language, and classId.
        statLst = []
        statLst = []
        for obj in self.__translDic.values():
        for obj in list(self.__translDic.values()):
            assert(obj.classId != 'Translator')
            assert(obj.classId != 'Translator')
            s = obj.status + '|' + obj.langReadable + '|' + obj.classId
            s = obj.status + '|' + obj.langReadable + '|' + obj.classId
            statLst.append(s)
            statLst.append(s)
@@ -1384,9 +1350,10 @@ class TrManager:
        # Build the list of tuples that contain (langReadable, obj).
        # Build the list of tuples that contain (langReadable, obj).
        # Sort it by readable name.
        # Sort it by readable name.
        self.langLst = []
        self.langLst = []
        for obj in self.__translDic.values():
        for obj in list(self.__translDic.values()):
            self.langLst.append((obj.langReadable, obj))
            self.langLst.append((obj.langReadable, obj))
        self.langLst.sort(lambda a, b: cmp(a[0], b[0]))

        self.langLst.sort(key=lambda x: x[0])


        # Create the list with readable language names. If the language has
        # Create the list with readable language names. If the language has
        # also the English-based version, modify the item by appending
        # also the English-based version, modify the item by appending
@@ -1400,7 +1367,7 @@ class TrManager:
            # of the English-based object. If the object exists, modify the
            # of the English-based object. If the object exists, modify the
            # name for the readable list of supported languages.
            # name for the readable list of supported languages.
            classIdEn = obj.classId + 'En'
            classIdEn = obj.classId + 'En'
            if self.__translDic.has_key(classIdEn):
            if classIdEn in self.__translDic:
                name += ' (+En)'
                name += ' (+En)'


            # Append the result name of the language, possibly with note.
            # Append the result name of the language, possibly with note.
@@ -1424,16 +1391,16 @@ class TrManager:
        for name, obj in self.langLst:
        for name, obj in self.langLst:
            if obj.status == 'En':
            if obj.status == 'En':
                classId = obj.classId[:-2]
                classId = obj.classId[:-2]
                if self.__translDic.has_key(classId):
                if classId in self.__translDic:
                    self.numLang -= 1    # the couple will be counted as one
                    self.numLang -= 1    # the couple will be counted as one


        # Extract the version of Doxygen.
        # Extract the version of Doxygen.
        f = open(os.path.join(self.doxy_path, 'VERSION'))
        f = xopen(os.path.join(self.doxy_path, 'VERSION'))
        self.doxVersion = f.readline().strip()
        self.doxVersion = f.readline().strip()
        f.close()
        f.close()


        # Update the last modification time.
        # Update the last modification time.
        for tr in self.__translDic.values():
        for tr in list(self.__translDic.values()):
            tim = tr.getmtime()
            tim = tr.getmtime()
            if tim > self.lastModificationTime:
            if tim > self.lastModificationTime:
                self.lastModificationTime = tim
                self.lastModificationTime = tim
@@ -1472,11 +1439,11 @@ class TrManager:
        probably used should be checked first and the resulting reduced
        probably used should be checked first and the resulting reduced
        dictionary should be used for checking the next files (speed up).
        dictionary should be used for checking the next files (speed up).
        """
        """
        lst_in = dic.keys()   # identifiers to be searched for
        lst_in = list(dic.keys())   # identifiers to be searched for


        # Read content of the file as one string.
        # Read content of the file as one string.
        assert os.path.isfile(fname)
        assert os.path.isfile(fname)
        f = open(fname)
        f = xopen(fname)
        cont = f.read()
        cont = f.read()
        f.close()
        f.close()


@@ -1497,7 +1464,7 @@ class TrManager:
        # Build the dictionary of the required method prototypes with
        # Build the dictionary of the required method prototypes with
        # method identifiers used as keys.
        # method identifiers used as keys.
        trdic = {}
        trdic = {}
        for prototype in self.requiredMethodsDic.keys():
        for prototype in list(self.requiredMethodsDic.keys()):
            ri = prototype.split('(')[0]
            ri = prototype.split('(')[0]
            identifier = ri.split()[1].strip()
            identifier = ri.split()[1].strip()
            trdic[identifier] = prototype
            trdic[identifier] = prototype
@@ -1553,7 +1520,7 @@ class TrManager:
        output = os.path.join(self.doc_path, self.translatorReportFileName)
        output = os.path.join(self.doc_path, self.translatorReportFileName)


        # Open the textual report file for the output.
        # Open the textual report file for the output.
        f = open(output, 'w')
        f = xopen(output, 'w')


        # Output the information about the version.
        # Output the information about the version.
        f.write('(' + self.doxVersion + ')\n\n')
        f.write('(' + self.doxVersion + ')\n\n')
@@ -1581,7 +1548,7 @@ class TrManager:
        # The e-mail addresses of the maintainers will be collected to
        # The e-mail addresses of the maintainers will be collected to
        # the auxiliary file in the order of translator classes listed
        # the auxiliary file in the order of translator classes listed
        # in the translator report.
        # in the translator report.
        fmail = open('mailto.txt', 'w')
        fmail = xopen('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:
@@ -1665,12 +1632,12 @@ class TrManager:
            # adapters.
            # adapters.
            if not self.script_argLst:
            if not self.script_argLst:
                to_remove = {}
                to_remove = {}
                for version, adaptClassId in self.adaptMethodsDic.values():
                for version, adaptClassId in list(self.adaptMethodsDic.values()):
                    if version < adaptMinVersion:
                    if version < adaptMinVersion:
                        to_remove[adaptClassId] = True
                        to_remove[adaptClassId] = True


                if to_remove:
                if to_remove:
                    lst = to_remove.keys()
                    lst = list(to_remove.keys())
                    lst.sort()
                    lst.sort()
                    plural = len(lst) > 1
                    plural = len(lst) > 1
                    note = 'Note: The adapter class'
                    note = 'Note: The adapter class'
@@ -1716,7 +1683,7 @@ class TrManager:
                f.write('\n' + '=' * 70 + '\n')
                f.write('\n' + '=' * 70 + '\n')
                f.write(fill(s) + '\n\n')
                f.write(fill(s) + '\n\n')


                keys = dic.keys()
                keys = list(dic.keys())
                keys.sort()
                keys.sort()
                for key in keys:
                for key in keys:
                    f.write('  ' + dic[key] + '\n')
                    f.write('  ' + dic[key] + '\n')
@@ -1726,7 +1693,7 @@ class TrManager:
        f.write('\n' + '=' * 70)
        f.write('\n' + '=' * 70)
        f.write('\nDetails for translators (classes sorted alphabetically):\n')
        f.write('\nDetails for translators (classes sorted alphabetically):\n')


        cls = self.__translDic.keys()
        cls = list(self.__translDic.keys())
        cls.sort()
        cls.sort()


        for c in cls:
        for c in cls:
@@ -1753,7 +1720,7 @@ class TrManager:
            self.lastModificationTime = tim
            self.lastModificationTime = tim


        # Process the content of the maintainers file.
        # Process the content of the maintainers file.
        f = codecs.open(fname, 'r', 'utf-8')
        f = xopen(fname)
        inside = False  # inside the record for the language
        inside = False  # inside the record for the language
        lineReady = True
        lineReady = True
        classId = None
        classId = None
@@ -1764,28 +1731,28 @@ class TrManager:
            lineReady = line != ''         # when eof, then line == ''
            lineReady = line != ''         # when eof, then line == ''


            line = line.strip()            # eof should also behave as separator
            line = line.strip()            # eof should also behave as separator
            if line != u'' and line[0] == u'%':    # skip the comment line
            if line != '' and line[0] == '%':    # skip the comment line
                continue
                continue


            if not inside:                 # if outside of the record
            if not inside:                 # if outside of the record
                if line != u'':            # should be language identifier
                if line != '':            # should be language identifier
                    classId = line
                    classId = line
                    maintainersLst = []
                    maintainersLst = []
                    inside = True
                    inside = True
                # Otherwise skip empty line that do not act as separator.
                # Otherwise skip empty line that do not act as separator.


            else:                          # if inside the record
            else:                          # if inside the record
                if line == u'':            # separator found
                if line == '':            # separator found
                    inside = False
                    inside = False
                else:
                else:
                    # If it is the first maintainer, create the empty list.
                    # If it is the first maintainer, create the empty list.
                    if not self.__maintainersDic.has_key(classId):
                    if classId not in self.__maintainersDic:
                        self.__maintainersDic[classId] = []
                        self.__maintainersDic[classId] = []


                    # Split the information about the maintainer and append
                    # Split the information about the maintainer and append
                    # the tuple. The address may be prefixed '[unreachable]'
                    # the tuple. The address may be prefixed '[unreachable]'
                    # or whatever '[xxx]'. This will be processed later.
                    # or whatever '[xxx]'. This will be processed later.
                    lst = line.split(u':', 1)
                    lst = line.split(':', 1)
                    assert(len(lst) == 2)
                    assert(len(lst) == 2)
                    t = (lst[0].strip(), lst[1].strip())
                    t = (lst[0].strip(), lst[1].strip())
                    self.__maintainersDic[classId].append(t)
                    self.__maintainersDic[classId].append(t)
@@ -1817,7 +1784,7 @@ class TrManager:
        #
        #
        # Read the template of the documentation, and remove the first
        # Read the template of the documentation, and remove the first
        # attention lines.
        # attention lines.
        f = codecs.open(fTplName, 'r', 'utf-8')
        f = xopen(fTplName)
        doctpl = f.read()
        doctpl = f.read()
        f.close()
        f.close()


@@ -1829,7 +1796,7 @@ class TrManager:
        # document template.
        # document template.
        tplDic = {}
        tplDic = {}


        s = u'Do not edit this file. It was generated by the %s script.\n * Instead edit %s and %s' % (self.script_name, self.languageTplFileName, self.maintainersFileName)
        s = u'Do not edit this file. It was generated by the %s script. * Instead edit %s and %s' % (self.script_name, self.languageTplFileName, self.maintainersFileName)
        tplDic['editnote'] = s
        tplDic['editnote'] = s


        tplDic['doxVersion'] = self.doxVersion
        tplDic['doxVersion'] = self.doxVersion
@@ -1865,7 +1832,7 @@ class TrManager:
            </table>
            </table>
            \\endhtmlonly
            \\endhtmlonly
            '''
            '''
        htmlTableTpl = dedent(htmlTableTpl)
        htmlTableTpl = textwrap.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>'
        htmlTdStatusColorTpl = u'\n    <td bgcolor="%s">%s</td>'
@@ -1881,7 +1848,7 @@ class TrManager:
            if obj.readableStatus.startswith('1.4'):
            if obj.readableStatus.startswith('1.4'):
                bkcolor = self.getBgcolorByReadableStatus('1.4')
                bkcolor = self.getBgcolorByReadableStatus('1.4')
            else:
            else:
                bkcolor = '#ffffff'
                bkcolor = u'#ffffff'


            lst = [ htmlTdStatusColorTpl % (bkcolor, obj.langReadable) ]
            lst = [ htmlTdStatusColorTpl % (bkcolor, obj.langReadable) ]


@@ -1905,23 +1872,23 @@ class TrManager:
                lm = []
                lm = []
                for maintainer in self.__maintainersDic[obj.classId]:
                for maintainer in self.__maintainersDic[obj.classId]:
                    name = maintainer[0]
                    name = maintainer[0]
                    if name.startswith(u'--'):
                    if name.startswith('--'):
                        name = u'<span style="color: red; background-color: yellow">'\
                        name = u'<span style="color: red; background-color: yellow">'\
                               + name + u'</span>'
                               + name + u'</span>'
                    lm.append(name)
                    lm.append(name)
                mm = u'<br/>'.join(lm)
                mm = '<br/>'.join(lm)


                # The marked adresses (they start with the mark '[unreachable]',
                # The marked adresses (they start with the mark '[unreachable]',
                # '[resigned]', whatever '[xxx]') will not be displayed at all.
                # '[resigned]', whatever '[xxx]') will not be displayed at all.
                # Only the mark will be used instead.
                # Only the mark will be used instead.
                rexMark = re.compile(ur'(?P<mark>\[.*?\])')
                rexMark = re.compile(u'(?P<mark>\\[.*?\\])')
                le = []
                le = []
                for maintainer in self.__maintainersDic[obj.classId]:
                for maintainer in self.__maintainersDic[obj.classId]:
                    address = maintainer[1]
                    address = maintainer[1]
                    m = rexMark.search(address)
                    m = rexMark.search(address)
                    if m is not None:
                    if m is not None:
                        address = u'<span style="color: brown">'\
                        address = u'<span style="color: brown">'\
                                  + m.group(u'mark') + u'</span>'
                                  + m.group('mark') + u'</span>'
                    le.append(address)
                    le.append(address)
                ee = u'<br/>'.join(le)
                ee = u'<br/>'.join(le)


@@ -1940,7 +1907,7 @@ class TrManager:
        htmlTable = htmlTableTpl % (''.join(trlst))
        htmlTable = htmlTableTpl % (''.join(trlst))


        # Define templates for LaTeX table parts of the documentation.
        # Define templates for LaTeX table parts of the documentation.
        latexTableTpl = ur'''
        latexTableTpl = b'''
            \latexonly
            \latexonly
            \footnotesize
            \footnotesize
            \begin{longtable}{|l|l|l|l|}
            \begin{longtable}{|l|l|l|l|}
@@ -1952,9 +1919,9 @@ class TrManager:
            \end{longtable}
            \end{longtable}
            \normalsize
            \normalsize
            \endlatexonly
            \endlatexonly
            '''
            '''.decode('utf_8')
        latexTableTpl = dedent(latexTableTpl)
        latexTableTpl = textwrap.dedent(latexTableTpl)
        latexLineTpl = u'\n' + r'  %s & %s & {\tt\tiny %s} & %s \\'
        latexLineTpl = u'\n  %s & %s & {\\tt\\tiny %s} & %s \\\\'


        # 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 LaTeX table.
        # and add generate the content of the LaTeX table.
@@ -1965,7 +1932,7 @@ class TrManager:
            # in the table is placed explicitly above the first
            # in the table is placed explicitly above the first
            # maintainer. Prepare the arguments for the LaTeX row template.
            # maintainer. Prepare the arguments for the LaTeX row template.
            maintainers = []
            maintainers = []
            if self.__maintainersDic.has_key(obj.classId):
            if obj.classId in self.__maintainersDic:
                maintainers = self.__maintainersDic[obj.classId]
                maintainers = self.__maintainersDic[obj.classId]


            lang = obj.langReadable
            lang = obj.langReadable
@@ -1976,8 +1943,8 @@ class TrManager:
                classId = obj.classId[:-2]
                classId = obj.classId[:-2]
                if classId in self.__translDic:
                if classId in self.__translDic:
                    langNE = self.__translDic[classId].langReadable
                    langNE = self.__translDic[classId].langReadable
                    maintainer = u'see the %s language' % langNE
                    maintainer = 'see the %s language' % langNE
                    email = u'~'
                    email = '~'


            if not maintainer and (obj.classId in self.__maintainersDic):
            if not maintainer and (obj.classId in self.__maintainersDic):
                lm = [ m[0] for m in self.__maintainersDic[obj.classId] ]
                lm = [ m[0] for m in self.__maintainersDic[obj.classId] ]
@@ -1996,8 +1963,8 @@ class TrManager:


            # List the other maintainers for the language. Do not set
            # List the other maintainers for the language. Do not set
            # lang and status for them.
            # lang and status for them.
            lang = u'~'
            lang = '~'
            status = u'~'
            status = '~'
            for m in maintainers[1:]:
            for m in maintainers[1:]:
                maintainer = m[0]
                maintainer = m[0]
                email = m[1]
                email = m[1]
@@ -2012,14 +1979,20 @@ class TrManager:
        tplDic['informationTable'] = htmlTable + u'\n' + latexTable
        tplDic['informationTable'] = htmlTable + u'\n' + latexTable


        # Insert the symbols into the document template and write it down.
        # Insert the symbols into the document template and write it down.
        f = codecs.open(fDocName, 'w', 'utf-8')
        f = xopen(fDocName, 'w')
        f.write(doctpl % tplDic)
        f.write(doctpl % tplDic)
        f.close()
        f.close()


if __name__ == '__main__':
if __name__ == '__main__':


    # Create the manager, build the transl objects, and parse the related
    # The Python 2.6+ or 3.3+ is required.
    # sources.
    major, minor, patch = (int(e) for e in platfor      m.python_version_tuple())
    if (major == 2 and minor < 6) or (major == 3 and minor < 3):
        print('Python 2.6+ or Python 3.3+ are required for the script')
        sys.exit(1)

    # The translator manager builds the transl objects, parses the related
    # sources, and keeps them in memory.
    trMan = TrManager()
    trMan = TrManager()


    # Generate the language.doc.
    # Generate the language.doc.
+2 −0
Original line number Original line Diff line number Diff line
@@ -11601,7 +11601,9 @@ static inline bool is_arabic(unsigned short x) {
	    ((x >= 0xfb50) && (x <= 0xfdff)) ||
	    ((x >= 0xfb50) && (x <= 0xfdff)) ||
	    ((x >= 0xfe70) && (x <= 0xfeff)));
	    ((x >= 0xfe70) && (x <= 0xfeff)));
}
}
#endif


#ifndef QT_NO_UNICODETABLES
static inline bool is_neutral(unsigned short dir) {
static inline bool is_neutral(unsigned short dir) {
  return ((dir == QChar::DirB) ||
  return ((dir == QChar::DirB) ||
		  (dir == QChar::DirS) ||
		  (dir == QChar::DirS) ||
Loading