From 746d1566482d3d58c5e524fcb84ac5050ec5568a Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Mon, 13 Apr 2020 12:47:25 +0200 Subject: [PATCH] update to python3 in docs/* --- docs/CMakeLists.txt | 4 ++-- docs/cpp2markdown-1.py | 4 +--- docs/dbk2man.py | 3 +-- docs/dir2index.py | 3 +-- docs/make-doc.py | 4 +--- docs/makedocs.py | 27 ++++++++++++++------------- docs/zzipdoc/docbookdocument.py | 4 +--- docs/zzipdoc/htm2dbk.py | 4 +--- docs/zzipdoc/htmldocument.py | 1 - 9 files changed, 22 insertions(+), 32 deletions(-) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 9707173..57d9000 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -13,7 +13,7 @@ option(MSVC_STATIC_RUNTIME "Build with static runtime libs (/MT)" ON) # Zlib library needed find_package ( ZLIB REQUIRED ) # pkg_search_module ( ZZIP zzip ) -find_package(Python REQUIRED) +find_package(PythonInterp REQUIRED) find_package(UnixCommands REQUIRED) # bash cp mv rm gzip tar find_program(XMLTO xmlto) @@ -23,7 +23,7 @@ set(README ${CMAKE_SOURCE_DIR}/README) set(topdir ${CMAKE_SOURCE_DIR}) set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) set(outdir ${CMAKE_CURRENT_BINARY_DIR}) -set(PY ${Python_EXECUTABLE}) +set(PY ${PYTHON_EXECUTABLE}) # targets ######################################################## set(doc_FILES README.MSVC6 README.SDL COPYING.MPL COPYING.LIB COPYING.ZLIB diff --git a/docs/cpp2markdown-1.py b/docs/cpp2markdown-1.py index 317e9f8..aaaf390 100755 --- a/docs/cpp2markdown-1.py +++ b/docs/cpp2markdown-1.py @@ -1,6 +1,4 @@ -#! /usr/bin/env python - -from __future__ import print_function +#! /usr/bin/env python3 import pygments.lexers.compiled as lexer import optparse diff --git a/docs/dbk2man.py b/docs/dbk2man.py index 4acc460..49cac4e 100755 --- a/docs/dbk2man.py +++ b/docs/dbk2man.py @@ -1,5 +1,4 @@ -#! /usr/bin/python -from __future__ import print_function +#! /usr/bin/python3 """ Converts an xml-file with docbook elements into troff manual pages. The conversion uses etree expecting elements in the input. diff --git a/docs/dir2index.py b/docs/dir2index.py index dea1c2e..4453802 100755 --- a/docs/dir2index.py +++ b/docs/dir2index.py @@ -1,5 +1,4 @@ -#! /usr/bin/python -from __future__ import print_function +#! /usr/bin/python3 """ Searches through a directory and creates an index page for it """ diff --git a/docs/make-doc.py b/docs/make-doc.py index 355fb7f..0bf8232 100644 --- a/docs/make-doc.py +++ b/docs/make-doc.py @@ -1,8 +1,6 @@ -#! /usr/bin/python +#! /usr/bin/python3 # -*- coding: UTF-8 -*- -from __future__ import print_function - import sys import re import commands diff --git a/docs/makedocs.py b/docs/makedocs.py index 244d069..ad6bf72 100644 --- a/docs/makedocs.py +++ b/docs/makedocs.py @@ -1,4 +1,5 @@ -from __future__ import print_function +#! /usr/bin/python3 + import sys from zzipdoc.match import * from zzipdoc.options import * @@ -38,7 +39,7 @@ class PerFile: return None def print_list_mainheader(self): for t_fileheader in self.headers: - print (t_fileheader.get_filename(), t_fileheader.src_mainheader()) + print(t_fileheader.get_filename(), t_fileheader.src_mainheader()) class PerFunctionEntry: def __init__(self, header, comment, prototype): @@ -67,10 +68,10 @@ class PerFunction: functionprototype) ] def print_list_titleline(self): for funcheader in self.headers: - print (funcheader.get_filename(), "[=>]", funcheader.get_titleline()) + print(funcheader.get_filename(), "[=>]", funcheader.get_titleline()) def print_list_name(self): for funcheader in self.prototypes: - print (funcheader.get_filename(), "[>>]", funcheader.get_name()) + print(funcheader.get_filename(), "[>>]", funcheader.get_name()) class PerFunctionFamilyEntry: def __init__(self, leader): @@ -123,12 +124,12 @@ class PerFunctionFamily: for name in self.retarget: into = self.retarget[name] if into not in name_list: - print ("function '"+name+"' retarget into '"+into+ - "' does not exist - keep alone") + print("function '"+name+"' retarget into '"+into+ + "' does not exist - keep alone") if into in self.retarget: other = self.retarget[into] - print ("function '"+name+"' retarget into '"+into+ - "' which is itself a retarget into '"+other+"'") + print("function '"+name+"' retarget into '"+into+ + "' which is itself a retarget into '"+other+"'") if into not in lead_list: lead_list += [ into ] for func in self.functions: @@ -142,7 +143,7 @@ class PerFunctionFamily: entry.add(func) # the first self.entries += [ entry ] else: - print ("head function '"+name+" has no entry") + print("head function '"+name+" has no entry") for func in self.functions: name = func.get_name() if name in self.retarget: @@ -151,14 +152,14 @@ class PerFunctionFamily: if entry is not None: entry.add(func) # will not add duplicates else: - print ("into function '"+name+" has no entry") + print("into function '"+name+" has no entry") def print_list_name(self): for family in self.entries: name = family.get_name() - print (name, ":", end = " ") + print(name, ":", end = " ") for item in family.functions: - print (item.get_name(), ",", end = " ") - print ("") + print(item.get_name(), ",", end = " ") + print("") class HtmlManualPageAdapter: def __init__(self, entry): """ usually takes a PerFunctionEntry """ diff --git a/docs/zzipdoc/docbookdocument.py b/docs/zzipdoc/docbookdocument.py index 7356c3a..f23790a 100644 --- a/docs/zzipdoc/docbookdocument.py +++ b/docs/zzipdoc/docbookdocument.py @@ -1,8 +1,6 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: UTF-8 -*- -from __future__ import print_function - from zzipdoc.match import Match class DocbookDocument: diff --git a/docs/zzipdoc/htm2dbk.py b/docs/zzipdoc/htm2dbk.py index 0a6d743..d0f17cc 100644 --- a/docs/zzipdoc/htm2dbk.py +++ b/docs/zzipdoc/htm2dbk.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """ this file converts simple html text into a docbook xml variant. @@ -6,8 +6,6 @@ The mapping of markups and links is far from perfect. But all we want is the docbook-to-pdf converter and similar technology being present in the world of docbook-to-anything converters. """ -from __future__ import print_function - from datetime import date from zzipdoc.match import Match import sys diff --git a/docs/zzipdoc/htmldocument.py b/docs/zzipdoc/htmldocument.py index 0466b9d..4f771d8 100644 --- a/docs/zzipdoc/htmldocument.py +++ b/docs/zzipdoc/htmldocument.py @@ -1,4 +1,3 @@ -#! /usr/bin/env python # -*- coding: UTF-8 -*- from __future__ import print_function -- 2.40.0