[poppler] 10 commits - gtkdoc.py poppler/gen-unicode-tables.py regtest/backends regtest/Bisect.py regtest/builder regtest/commands regtest/Config.py regtest/HTMLReport.py regtest/InterruptibleQueue.py regtest/main.py regtest/Printer.py regtest/TestReferences.py regtest/TestRun.py regtest/Timer.py regtest/Utils.py

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 18 10:06:10 UTC 2018


 gtkdoc.py                           |    6 ++-
 poppler/gen-unicode-tables.py       |   61 ++++++++++++++++++++++--------------
 regtest/Bisect.py                   |    1 
 regtest/Config.py                   |    1 
 regtest/HTMLReport.py               |   12 ++-----
 regtest/InterruptibleQueue.py       |    1 
 regtest/Printer.py                  |   31 ++++++++----------
 regtest/TestReferences.py           |    1 
 regtest/TestRun.py                  |   13 +++++--
 regtest/Timer.py                    |    1 
 regtest/Utils.py                    |    4 +-
 regtest/backends/__init__.py        |    1 
 regtest/backends/cairo.py           |    1 
 regtest/backends/postscript.py      |    1 
 regtest/backends/splash.py          |    1 
 regtest/backends/text.py            |    1 
 regtest/builder/__init__.py         |    1 
 regtest/builder/autotools.py        |    1 
 regtest/commands/__init__.py        |    6 +--
 regtest/commands/create-refs.py     |    1 
 regtest/commands/create-report.py   |    1 
 regtest/commands/find-regression.py |    1 
 regtest/commands/run-tests.py       |    1 
 regtest/main.py                     |    1 
 24 files changed, 94 insertions(+), 56 deletions(-)

New commits:
commit 7bb75cc533339a8480c16fe432ae4034b7ff5c57
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Mon Oct 22 00:26:40 2018 -0400

    regtest: Fix file opened in wrong mode.

diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index c1867119..eb35ef9b 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -331,9 +331,8 @@ class HTMLReport:
         html += failed + crashed + failed_to_run + "</body></html>"
 
         report_index = os.path.join(self._htmldir, 'index.html')
-        f = open(report_index, 'wb')
-        f.write(html)
-        f.close()
+        with open(report_index, 'w') as f:
+            f.write(html)
 
         if launch_browser:
             subprocess.Popen(['xdg-open', report_index])
commit d02d1a1e62a13ff357815f13379a00f34b957233
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 22:12:19 2018 -0400

    regtest: Fix Printer.printerr.

diff --git a/regtest/Printer.py b/regtest/Printer.py
index 5c4563a8..3ad4cad9 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -82,8 +82,8 @@ class Printer:
         with self._lock:
             if self._blocked > 0:
                 return
-            self.stderr.write(self._ensure_new_line(msg))
-            self.stderr.flush()
+            sys.stderr.write(self._ensure_new_line(msg))
+            sys.stderr.flush()
 
     def print_test_result(self, doc_path, backend_name, n_test, total_tests, msg):
         self.printout("[%d/%d] %s (%s): %s" % (n_test, total_tests, doc_path, backend_name, msg))
commit 1c3cc387a8d1686897801833ae1dd9493a48b708
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 22:05:10 2018 -0400

    regtest: Replace execfile with plain read & exec.

diff --git a/regtest/Utils.py b/regtest/Utils.py
index 20efc3ab..e4fa60e7 100644
--- a/regtest/Utils.py
+++ b/regtest/Utils.py
@@ -67,6 +67,7 @@ def get_passwords(docsdir):
         return {}
 
     passwords = {}
-    execfile(passwords_file, passwords)
+    with open(passwords_file) as f:
+        exec(f.read(), passwords)
     return passwords['passwords']
 
commit 60cf2c0fc385f2a8f60036136c957adf2193cdf9
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:58:20 2018 -0400

    regtest: Enable new-style division everywhere.

diff --git a/regtest/Bisect.py b/regtest/Bisect.py
index bf8853d7..0782973d 100644
--- a/regtest/Bisect.py
+++ b/regtest/Bisect.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from builder import get_builder
 from TestRun import TestRun
diff --git a/regtest/Config.py b/regtest/Config.py
index 6d4e11b8..0e2b0bc9 100644
--- a/regtest/Config.py
+++ b/regtest/Config.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 class Config:
 
diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index b299e740..c1867119 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
diff --git a/regtest/InterruptibleQueue.py b/regtest/InterruptibleQueue.py
index 40514061..13156a96 100644
--- a/regtest/InterruptibleQueue.py
+++ b/regtest/InterruptibleQueue.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from threading import Lock, Condition
 from collections import deque
diff --git a/regtest/Printer.py b/regtest/Printer.py
index 060daff8..5c4563a8 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import sys
 from Config import Config
diff --git a/regtest/TestReferences.py b/regtest/TestReferences.py
index 1d6c0f22..68cd67ac 100644
--- a/regtest/TestReferences.py
+++ b/regtest/TestReferences.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import os
 import errno
diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index a729914b..8f9011e6 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
@@ -279,7 +279,8 @@ class TestRun:
             if self._exited_early:
                 self.printer.printout_ln("Testing exited early")
                 self.printer.printout_ln()
-            self.printer.printout_ln("%d tests passed (%.2f%%)" % (self._n_passed, (self._n_passed * 100.) / self._n_run))
+            self.printer.printout_ln("%d tests passed (%.2f%%)" % (
+                self._n_passed, (self._n_passed * 100) / self._n_run))
             self.printer.printout_ln()
 
             def result_tests(test_dict):
@@ -300,7 +301,8 @@ class TestRun:
                 percs = []
                 for backend in test_dict:
                     n_docs = len(test_dict[backend])
-                    percs.append("%d %s (%.2f%%)" % (n_docs, backend, (n_docs * 100.) / n_tests))
+                    percs.append("%d %s (%.2f%%)" % (n_docs, backend,
+                                                     n_docs * 100 / n_tests))
                 return ", ".join(percs)
 
             test_results = [(self._failed, "unexpected failures"),
@@ -315,7 +317,9 @@ class TestRun:
                 if n_tests == 0:
                     continue
 
-                self.printer.printout_ln("%d %s (%.2f%%) [%s]" % (n_tests, test_msg, (n_tests * 100.) / self._n_run, backends_summary(test_dict, n_tests)))
+                self.printer.printout_ln("%d %s (%.2f%%) [%s]" % (
+                    n_tests, test_msg, n_tests * 100 / self._n_run,
+                    backends_summary(test_dict, n_tests)))
                 self.printer.printout_ln(tests)
                 self.printer.printout_ln()
         else:
diff --git a/regtest/Timer.py b/regtest/Timer.py
index 0dcd772b..069dd918 100644
--- a/regtest/Timer.py
+++ b/regtest/Timer.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from time import time, strftime, gmtime
 
diff --git a/regtest/Utils.py b/regtest/Utils.py
index dce113fa..20efc3ab 100644
--- a/regtest/Utils.py
+++ b/regtest/Utils.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import os
 
diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index ab5ac915..c44b3556 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import hashlib
 import os
diff --git a/regtest/backends/cairo.py b/regtest/backends/cairo.py
index 6e4d7452..3532cf50 100644
--- a/regtest/backends/cairo.py
+++ b/regtest/backends/cairo.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/postscript.py b/regtest/backends/postscript.py
index d73048e7..ff46837d 100644
--- a/regtest/backends/postscript.py
+++ b/regtest/backends/postscript.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/splash.py b/regtest/backends/splash.py
index 9c68bd2f..b606ba68 100644
--- a/regtest/backends/splash.py
+++ b/regtest/backends/splash.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/text.py b/regtest/backends/text.py
index d345183d..62269f0d 100644
--- a/regtest/backends/text.py
+++ b/regtest/backends/text.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/builder/__init__.py b/regtest/builder/__init__.py
index 5cbd2f54..09b001c9 100644
--- a/regtest/builder/__init__.py
+++ b/regtest/builder/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from Config import Config
 import os
diff --git a/regtest/builder/autotools.py b/regtest/builder/autotools.py
index e96366c0..067da0a3 100644
--- a/regtest/builder/autotools.py
+++ b/regtest/builder/autotools.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from builder import Builder, register_builder
 import os
diff --git a/regtest/commands/__init__.py b/regtest/commands/__init__.py
index e77843bf..5daf7b03 100644
--- a/regtest/commands/__init__.py
+++ b/regtest/commands/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import argparse
 
diff --git a/regtest/commands/create-refs.py b/regtest/commands/create-refs.py
index 201979d2..4ec3688a 100644
--- a/regtest/commands/create-refs.py
+++ b/regtest/commands/create-refs.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from commands import Command, register_command
 from TestReferences import TestReferences
diff --git a/regtest/commands/create-report.py b/regtest/commands/create-report.py
index 6f457662..2e852b17 100644
--- a/regtest/commands/create-report.py
+++ b/regtest/commands/create-report.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from commands import Command, register_command
 from HTMLReport import HTMLReport
diff --git a/regtest/commands/find-regression.py b/regtest/commands/find-regression.py
index 5c119a9f..6a116209 100644
--- a/regtest/commands/find-regression.py
+++ b/regtest/commands/find-regression.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from commands import Command, register_command
 from Bisect import Bisect
diff --git a/regtest/commands/run-tests.py b/regtest/commands/run-tests.py
index bf7ec3f8..4baf057f 100644
--- a/regtest/commands/run-tests.py
+++ b/regtest/commands/run-tests.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 from commands import Command, register_command
 from TestRun import TestRun
diff --git a/regtest/main.py b/regtest/main.py
index 0a88a91a..85d5fb5e 100644
--- a/regtest/main.py
+++ b/regtest/main.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, division, print_function
 
 import sys
 import argparse
commit 5a266afcf314660a0bf8b3aeffb6308c1c66f805
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:54:09 2018 -0400

    regtest: Enable absolute import on all files.

diff --git a/regtest/Bisect.py b/regtest/Bisect.py
index 6eb2511f..bf8853d7 100644
--- a/regtest/Bisect.py
+++ b/regtest/Bisect.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from builder import get_builder
 from TestRun import TestRun
diff --git a/regtest/Config.py b/regtest/Config.py
index 621cb56b..6d4e11b8 100644
--- a/regtest/Config.py
+++ b/regtest/Config.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 class Config:
 
diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index ba60a855..b299e740 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
diff --git a/regtest/InterruptibleQueue.py b/regtest/InterruptibleQueue.py
index 57c147bb..40514061 100644
--- a/regtest/InterruptibleQueue.py
+++ b/regtest/InterruptibleQueue.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from threading import Lock, Condition
 from collections import deque
diff --git a/regtest/Printer.py b/regtest/Printer.py
index dc45d69b..060daff8 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import sys
 from Config import Config
diff --git a/regtest/TestReferences.py b/regtest/TestReferences.py
index 6f1522e1..1d6c0f22 100644
--- a/regtest/TestReferences.py
+++ b/regtest/TestReferences.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import os
 import errno
diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index 804e24b7..a729914b 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
diff --git a/regtest/Timer.py b/regtest/Timer.py
index 5b0d7109..0dcd772b 100644
--- a/regtest/Timer.py
+++ b/regtest/Timer.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from time import time, strftime, gmtime
 
diff --git a/regtest/Utils.py b/regtest/Utils.py
index 45e9c3eb..dce113fa 100644
--- a/regtest/Utils.py
+++ b/regtest/Utils.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import os
 
diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index f03ca988..ab5ac915 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import hashlib
 import os
diff --git a/regtest/backends/cairo.py b/regtest/backends/cairo.py
index 4fc62363..6e4d7452 100644
--- a/regtest/backends/cairo.py
+++ b/regtest/backends/cairo.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/postscript.py b/regtest/backends/postscript.py
index 276ce201..d73048e7 100644
--- a/regtest/backends/postscript.py
+++ b/regtest/backends/postscript.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/splash.py b/regtest/backends/splash.py
index d0302e3c..9c68bd2f 100644
--- a/regtest/backends/splash.py
+++ b/regtest/backends/splash.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/text.py b/regtest/backends/text.py
index 528b6662..d345183d 100644
--- a/regtest/backends/text.py
+++ b/regtest/backends/text.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/builder/__init__.py b/regtest/builder/__init__.py
index 89e1ded5..5cbd2f54 100644
--- a/regtest/builder/__init__.py
+++ b/regtest/builder/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from Config import Config
 import os
diff --git a/regtest/builder/autotools.py b/regtest/builder/autotools.py
index 7b004b3c..e96366c0 100644
--- a/regtest/builder/autotools.py
+++ b/regtest/builder/autotools.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from builder import Builder, register_builder
 import os
diff --git a/regtest/commands/__init__.py b/regtest/commands/__init__.py
index adb98e59..e77843bf 100644
--- a/regtest/commands/__init__.py
+++ b/regtest/commands/__init__.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import argparse
 
diff --git a/regtest/commands/create-refs.py b/regtest/commands/create-refs.py
index 78a6a401..201979d2 100644
--- a/regtest/commands/create-refs.py
+++ b/regtest/commands/create-refs.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from commands import Command, register_command
 from TestReferences import TestReferences
diff --git a/regtest/commands/create-report.py b/regtest/commands/create-report.py
index 954e2132..6f457662 100644
--- a/regtest/commands/create-report.py
+++ b/regtest/commands/create-report.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from commands import Command, register_command
 from HTMLReport import HTMLReport
diff --git a/regtest/commands/find-regression.py b/regtest/commands/find-regression.py
index da7c4d90..5c119a9f 100644
--- a/regtest/commands/find-regression.py
+++ b/regtest/commands/find-regression.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from commands import Command, register_command
 from Bisect import Bisect
diff --git a/regtest/commands/run-tests.py b/regtest/commands/run-tests.py
index ee52ddea..bf7ec3f8 100644
--- a/regtest/commands/run-tests.py
+++ b/regtest/commands/run-tests.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from commands import Command, register_command
 from TestRun import TestRun
diff --git a/regtest/main.py b/regtest/main.py
index 9afbdc73..0a88a91a 100644
--- a/regtest/main.py
+++ b/regtest/main.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import sys
 import argparse
commit 557423168289490ec9ddf1301924667c82cb3481
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:48:24 2018 -0400

    regtest: Replace tabs with spaces.

diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index 7be9ebe9..804e24b7 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -209,7 +209,7 @@ class TestRun:
             if e.errno != errno.ENOENT:
                 raise
         except:
-	    raise
+            raise
 
         if not tests:
             docs, total_docs = get_document_paths_from_dir(self._docsdir)
commit 0c744c934927ebe644215d23d06677fd670175c4
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:43:09 2018 -0400

    regtest: Use print function everywhere.

diff --git a/regtest/Bisect.py b/regtest/Bisect.py
index 31addaac..6eb2511f 100644
--- a/regtest/Bisect.py
+++ b/regtest/Bisect.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from builder import get_builder
 from TestRun import TestRun
diff --git a/regtest/Config.py b/regtest/Config.py
index ff03e3ca..621cb56b 100644
--- a/regtest/Config.py
+++ b/regtest/Config.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 class Config:
 
diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index c504eb63..ba60a855 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
diff --git a/regtest/InterruptibleQueue.py b/regtest/InterruptibleQueue.py
index 4156e30b..57c147bb 100644
--- a/regtest/InterruptibleQueue.py
+++ b/regtest/InterruptibleQueue.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from threading import Lock, Condition
 from collections import deque
diff --git a/regtest/Printer.py b/regtest/Printer.py
index 7da4b82d..dc45d69b 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import sys
 from Config import Config
diff --git a/regtest/TestReferences.py b/regtest/TestReferences.py
index e70896fe..6f1522e1 100644
--- a/regtest/TestReferences.py
+++ b/regtest/TestReferences.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import os
 import errno
diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index d2a0ed07..7be9ebe9 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import get_backend, get_all_backends
 from Config import Config
diff --git a/regtest/Timer.py b/regtest/Timer.py
index e86f8c52..5b0d7109 100644
--- a/regtest/Timer.py
+++ b/regtest/Timer.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from time import time, strftime, gmtime
 
diff --git a/regtest/Utils.py b/regtest/Utils.py
index cd1a572f..45e9c3eb 100644
--- a/regtest/Utils.py
+++ b/regtest/Utils.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import os
 
diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index 1287110f..f03ca988 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import hashlib
 import os
diff --git a/regtest/backends/cairo.py b/regtest/backends/cairo.py
index 3dd9c799..4fc62363 100644
--- a/regtest/backends/cairo.py
+++ b/regtest/backends/cairo.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/postscript.py b/regtest/backends/postscript.py
index c7e8b612..276ce201 100644
--- a/regtest/backends/postscript.py
+++ b/regtest/backends/postscript.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/splash.py b/regtest/backends/splash.py
index 54f88f9a..d0302e3c 100644
--- a/regtest/backends/splash.py
+++ b/regtest/backends/splash.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/backends/text.py b/regtest/backends/text.py
index e36f4863..528b6662 100644
--- a/regtest/backends/text.py
+++ b/regtest/backends/text.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from backends import Backend, register_backend
 import subprocess
diff --git a/regtest/builder/__init__.py b/regtest/builder/__init__.py
index 649c68d9..89e1ded5 100644
--- a/regtest/builder/__init__.py
+++ b/regtest/builder/__init__.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from Config import Config
 import os
diff --git a/regtest/builder/autotools.py b/regtest/builder/autotools.py
index 4dd05659..7b004b3c 100644
--- a/regtest/builder/autotools.py
+++ b/regtest/builder/autotools.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from builder import Builder, register_builder
 import os
diff --git a/regtest/commands/__init__.py b/regtest/commands/__init__.py
index c7e91625..adb98e59 100644
--- a/regtest/commands/__init__.py
+++ b/regtest/commands/__init__.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import argparse
 
@@ -88,5 +89,5 @@ def print_help():
     for name, description in commands:
         print("  %-15s %s" % (name, description))
 
-    print
+    print()
     print("For more information run 'poppler-regtest --help-command <command>'")
diff --git a/regtest/commands/create-refs.py b/regtest/commands/create-refs.py
index b8073d35..78a6a401 100644
--- a/regtest/commands/create-refs.py
+++ b/regtest/commands/create-refs.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from commands import Command, register_command
 from TestReferences import TestReferences
diff --git a/regtest/commands/create-report.py b/regtest/commands/create-report.py
index ab37d080..954e2132 100644
--- a/regtest/commands/create-report.py
+++ b/regtest/commands/create-report.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from commands import Command, register_command
 from HTMLReport import HTMLReport
diff --git a/regtest/commands/find-regression.py b/regtest/commands/find-regression.py
index 734d12ad..da7c4d90 100644
--- a/regtest/commands/find-regression.py
+++ b/regtest/commands/find-regression.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from commands import Command, register_command
 from Bisect import Bisect
diff --git a/regtest/commands/run-tests.py b/regtest/commands/run-tests.py
index d8df26cc..ee52ddea 100644
--- a/regtest/commands/run-tests.py
+++ b/regtest/commands/run-tests.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 from commands import Command, register_command
 from TestRun import TestRun
diff --git a/regtest/main.py b/regtest/main.py
index 3c0d2109..9afbdc73 100644
--- a/regtest/main.py
+++ b/regtest/main.py
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+from __future__ import print_function
 
 import sys
 import argparse
commit 0c02573f7c43a5b02b29daf8cb7f94d3925137a9
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:38:15 2018 -0400

    regtest: Fix iteration through dictionary on Py3.

diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index b4840db2..c504eb63 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -296,15 +296,11 @@ class HTMLReport:
 
             results[root] = TestResult(self._docsdir, self._refsdir, self._outdir, root, files, backends)
 
-        tests = results.keys()
-        tests.sort()
-
         failed_anchors = []
         failed = ""
         crashed = ""
         failed_to_run = ""
-        for test_name in tests:
-            test = results[test_name]
+        for test_name, test in sorted(results.items()):
             if test.is_failed():
                 failed_anchors.append(test.get_test())
                 failed += test.get_failed_html()
diff --git a/regtest/commands/__init__.py b/regtest/commands/__init__.py
index 78e1f6fa..c7e91625 100644
--- a/regtest/commands/__init__.py
+++ b/regtest/commands/__init__.py
@@ -84,8 +84,7 @@ def print_help():
             pass
 
     print("Commands are:")
-    commands = [(x.name, x.description) for x in _commands.values()]
-    commands.sort()
+    commands = sorted((x.name, x.description) for x in _commands.values())
     for name, description in commands:
         print("  %-15s %s" % (name, description))
 
commit 98a84ba86d5b675b4cd490455c5f5d644235b5c3
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:30:04 2018 -0400

    regtest: Don't use exceptions for Printer singleton.
    
    In Python 3, exceptions must derive from the BaseException class, which
    Printer definitely does not do.

diff --git a/regtest/Printer.py b/regtest/Printer.py
index 23ef7b3f..7da4b82d 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -21,13 +21,16 @@ from Config import Config
 
 from threading import RLock
 
-class Printer:
 
-    __single = None
+_instance = None
+
 
+class Printer:
     def __init__(self):
-        if Printer.__single is not None:
-            raise Printer.__single
+        global _instance
+        if _instance is not None:
+            raise RuntimeError('Printer must not be instantiated more than '
+                               'once. Use the get_printer() function instead.')
 
         self._verbose = Config().verbose
         self._stream = sys.stdout
@@ -37,7 +40,7 @@ class Printer:
 
         self._lock = RLock()
 
-        Printer.__single = self
+        _instance = self
 
     def _erase_current_line(self):
         if not self._current_line_len:
@@ -99,13 +102,8 @@ class Printer:
         with self._lock:
             self._blocked -= 1
 
-def get_printer():
-    try:
-        instance = Printer()
-    except Printer, i:
-        instance = i
-
-    return instance
-
-
 
+def get_printer():
+    if _instance is None:
+        Printer()
+    return _instance
commit 6c427f7ecb97780ae3405be9ba6c7f0d9fe934dc
Author: Elliott Sales de Andrade <quantum.analyst at gmail.com>
Date:   Sun Oct 21 21:15:26 2018 -0400

    Support Python 3 in scripts.

diff --git a/gtkdoc.py b/gtkdoc.py
index cc73ffc1..b019d346 100644
--- a/gtkdoc.py
+++ b/gtkdoc.py
@@ -13,6 +13,7 @@
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+from __future__ import absolute_import, division, print_function
 
 import errno
 import logging
@@ -22,6 +23,9 @@ import subprocess
 import sys
 
 PY2 = sys.version_info[0] == 2
+if PY2:
+    input = raw_input
+
 
 class GTKDoc(object):
 
@@ -180,7 +184,7 @@ class GTKDoc(object):
         question += ' [y/N] '
         answer = None
         while answer != 'y' and answer != 'n' and answer != '':
-            answer = raw_input(question).lower()
+            answer = input(question).lower()
         return answer == 'y'
 
     def _run_command(self, args, env=None, cwd=None, print_output=True, ignore_warnings=False):
diff --git a/poppler/gen-unicode-tables.py b/poppler/gen-unicode-tables.py
index 282f6e52..d15beb7d 100644
--- a/poppler/gen-unicode-tables.py
+++ b/poppler/gen-unicode-tables.py
@@ -1,38 +1,53 @@
+from __future__ import absolute_import, division, print_function
+
+import sys
+import unicodedata
+
+
+if sys.version_info[0] == 2:
+    chr = unichr
+
 UNICODE_LAST_CHAR_PART1 = 0x2FAFF
 HANGUL_S_BASE = 0xAC00
 HANGUL_S_COUNT = 19 * 21 * 28
-import unicodedata
 
-print """// Generated by gen-unicode-tables.py
+
+print("""// Generated by gen-unicode-tables.py
 
 typedef struct {
   Unicode character;
   int length;
   int offset;
 } decomposition;
-"""
+""")
 
 decomp_table = []
 max_index = 0
 decomp_expansion_index = {}
 decomp_expansion = []
-for u in xrange(0, UNICODE_LAST_CHAR_PART1):
-	if (u >= HANGUL_S_BASE and u < HANGUL_S_BASE + HANGUL_S_COUNT):
-		continue
-	norm = tuple(map(ord, unicodedata.normalize("NFKD", unichr(u))))
-	if norm != (u,):
-		try: 
-			i = decomp_expansion_index[norm]
-			decomp_table.append((u, len(norm), i))
-		except KeyError:
-			decomp_table.append((u, len(norm), max_index))
-			decomp_expansion_index[norm] = max_index
-			decomp_expansion.append((norm, max_index))
-			max_index += len(norm)
-print "#define DECOMP_TABLE_LENGTH %d\n" % len(decomp_table)
-print "static const decomposition decomp_table[] = {\n%s\n};\n" % ", \n".join(
-		"  { 0x%x, %d, %d }" % (character, length, offset)
-		for character, length, offset in decomp_table)
-print "static const Unicode decomp_expansion[] = {\n%s\n};\n" % ", \n".join(
-		"  %s /* offset %d */ " % (", ".join("0x%x" % u for u in norm), 
-			index) for norm, index in decomp_expansion)
+for u in range(0, UNICODE_LAST_CHAR_PART1):
+    if HANGUL_S_BASE <= u < HANGUL_S_BASE + HANGUL_S_COUNT:
+        continue
+    norm = tuple(map(ord, unicodedata.normalize("NFKD", chr(u))))
+    if norm != (u, ):
+        try:
+            i = decomp_expansion_index[norm]
+            decomp_table.append((u, len(norm), i))
+        except KeyError:
+            decomp_table.append((u, len(norm), max_index))
+            decomp_expansion_index[norm] = max_index
+            decomp_expansion.append((norm, max_index))
+            max_index += len(norm)
+print("#define DECOMP_TABLE_LENGTH %d" % (len(decomp_table), ))
+print()
+print("static const decomposition decomp_table[] = {")
+print(*("  { 0x%x, %d, %d }" % (character, length, offset)
+        for character, length, offset in decomp_table),
+      sep=",\n")
+print("};")
+print()
+print("static const Unicode decomp_expansion[] = {")
+print(*("  %s /* offset %d */" % (", ".join("0x%x" % u for u in norm), index)
+        for norm, index in decomp_expansion),
+      sep=" ,\n")
+print("};")


More information about the poppler mailing list