From: Patrick Steinhardt Date: Thu, 23 May 2019 20:15:31 +0000 (+0200) Subject: docs: more carefully handle relative module imports X-Git-Tag: v0.13.72~57^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05a6e4bffd3ac04f3fff96310800d6d7d5c54f6c;p=zziplib docs: more carefully handle relative module imports The way how relative module imports are handled has changed with Python 3, causing it to throw exceptions when we try to import zzipdoc.* modules. Fix this by specifying the base module from which we import fo fix compatibility with Python 3. --- diff --git a/docs/zzipdoc/commentmarkup.py b/docs/zzipdoc/commentmarkup.py index 3f605a7..71803e0 100644 --- a/docs/zzipdoc/commentmarkup.py +++ b/docs/zzipdoc/commentmarkup.py @@ -1,4 +1,4 @@ -from match import Match +from zzipdoc.match import Match def markup_link_syntax(text): """ markup the link-syntax ` => somewhere ` in the text block """ diff --git a/docs/zzipdoc/dbk2htm.py b/docs/zzipdoc/dbk2htm.py index f8593e6..42d95b1 100644 --- a/docs/zzipdoc/dbk2htm.py +++ b/docs/zzipdoc/dbk2htm.py @@ -1,4 +1,4 @@ -from match import Match +from zzipdoc.match import Match import string class dbk2htm_conversion: diff --git a/docs/zzipdoc/docbookdocument.py b/docs/zzipdoc/docbookdocument.py index c4602ad..ea0dfdc 100644 --- a/docs/zzipdoc/docbookdocument.py +++ b/docs/zzipdoc/docbookdocument.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- -from match import Match +from zzipdoc.match import Match class DocbookDocument: """ binds some xml content page with additional markup - in this diff --git a/docs/zzipdoc/functionheader.py b/docs/zzipdoc/functionheader.py index 81bb385..7020b28 100644 --- a/docs/zzipdoc/functionheader.py +++ b/docs/zzipdoc/functionheader.py @@ -1,4 +1,4 @@ -from match import Match +from zzipdoc.match import Match class FunctionHeader: """ parsing the comment block that is usually presented before diff --git a/docs/zzipdoc/functionlisthtmlpage.py b/docs/zzipdoc/functionlisthtmlpage.py index 4ec9178..b631083 100644 --- a/docs/zzipdoc/functionlisthtmlpage.py +++ b/docs/zzipdoc/functionlisthtmlpage.py @@ -1,5 +1,5 @@ -from options import * -from match import Match +from zzipdoc.options import * +from zzipdoc.match import Match class FunctionListHtmlPage: """ The main part here is to create a TOC (table of contents) at the diff --git a/docs/zzipdoc/functionlistreference.py b/docs/zzipdoc/functionlistreference.py index c38ff0a..5053110 100644 --- a/docs/zzipdoc/functionlistreference.py +++ b/docs/zzipdoc/functionlistreference.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- -from match import Match -from htm2dbk import * +from zzipdoc.match import Match +from zzipdoc.htm2dbk import * class FunctionListReference: """ Creating a docbook-style list of parts diff --git a/docs/zzipdoc/functionprototype.py b/docs/zzipdoc/functionprototype.py index fda85bb..23a1076 100644 --- a/docs/zzipdoc/functionprototype.py +++ b/docs/zzipdoc/functionprototype.py @@ -1,4 +1,4 @@ -from match import Match +from zzipdoc.match import Match class FunctionPrototype: """ takes a single function prototype line (cut from some source file) diff --git a/docs/zzipdoc/htm2dbk.py b/docs/zzipdoc/htm2dbk.py index 816a695..18ffe59 100644 --- a/docs/zzipdoc/htm2dbk.py +++ b/docs/zzipdoc/htm2dbk.py @@ -7,10 +7,10 @@ want is the docbook-to-pdf converter and similar technology being present in the world of docbook-to-anything converters. """ from datetime import date -import match +from zzipdoc.match import Match import sys -m = match.Match +m = Match class htm2dbk_conversion_base: regexlist = [ diff --git a/docs/zzipdoc/htmldocument.py b/docs/zzipdoc/htmldocument.py index 47d58dc..be35591 100644 --- a/docs/zzipdoc/htmldocument.py +++ b/docs/zzipdoc/htmldocument.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- -from match import Match +from zzipdoc.match import Match class HtmlDocument: """ binds some html content page with additional markup - in this diff --git a/docs/zzipdoc/options.py b/docs/zzipdoc/options.py index c6758d5..d2a3e9f 100644 --- a/docs/zzipdoc/options.py +++ b/docs/zzipdoc/options.py @@ -3,7 +3,7 @@ # @creator (C) 2003 Guido U. Draheim # @license http://creativecommons.org/licenses/by-nc-sa/2.0/de/ -from match import Match +from zzipdoc.match import Match # use as o.optionname to check for commandline options. class Options: diff --git a/docs/zzipdoc/textfileheader.py b/docs/zzipdoc/textfileheader.py index ceaa28e..c737243 100644 --- a/docs/zzipdoc/textfileheader.py +++ b/docs/zzipdoc/textfileheader.py @@ -1,4 +1,4 @@ -from match import Match +from zzipdoc.match import Match class TextFileHeader: """ scan for a comment block at the source file start and fill the