summaryrefslogtreecommitdiffstats
path: root/languages/python/kde_pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'languages/python/kde_pydoc.py')
-rwxr-xr-xlanguages/python/kde_pydoc.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/languages/python/kde_pydoc.py b/languages/python/kde_pydoc.py
index 0516f172..c7c246bc 100755
--- a/languages/python/kde_pydoc.py
+++ b/languages/python/kde_pydoc.py
@@ -6,7 +6,7 @@ __author__ = "David Nolden<david.kde@art-master.de>, Ka-Ping Yee <ping@lfw.org>
__version__ = "6 April 2006"
import sys, imp, os, stat, re, types, cgi
-from repr import Repr
+from reprlib import Repr
from string import expandtabs, find, join, lower, split, strip, rstrip
import pydoc
@@ -67,9 +67,9 @@ def writedocs(path, pkgpath='', depth=0, notprocessed=[]):
if(depth == 1):
if(len(notprocessed) != 0):
- print "<br> the following paths were not processed because they are deeper than the maximum depth of " + str(__maxdepth) + ":<br>"
+ print("<br> the following paths were not processed because they are deeper than the maximum depth of " + str(__maxdepth) + ":<br>")
for x in notprocessed:
- print cgi.escape(x) + " <br>"
+ print(cgi.escape(x) + " <br>")
def writedoc(key,top=False):
"""Write HTML documentation to a file in the current directory."""
@@ -86,19 +86,19 @@ def writedoc(key,top=False):
seen = {}
for dir in pydoc.pathdirs():
indices.append(pydoc.html.index(dir, seen))
- print cleanlinks(heading + join(indices))
+ print(cleanlinks(heading + join(indices)))
return
if(type(key) != types.ModuleType):
object = pydoc.locate(key)
if(object == None and top):
- print "could not locate module/object for key " + \
- cgi.escape(key) + "<br><a href=\"pydoc:modules\">go to index</a>";
+ print("could not locate module/object for key " + \
+ cgi.escape(key) + "<br><a href=\"pydoc:modules\">go to index</a>");
else:
object = key
if object:
- print cleanlinks(pydoc.html.page(pydoc.describe(object), pydoc.html.document(object)))
+ print(cleanlinks(pydoc.html.page(pydoc.describe(object), pydoc.html.document(object))))
@@ -109,9 +109,9 @@ if __name__ == '__main__':
try:
opts, args = getopt.getopt(sys.argv[1:], 'k:p:w')
- print "<html>"
- print "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
- print "</head><body>"
+ print("<html>")
+ print("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">")
+ print("</head><body>")
if args:
for arg in args:
@@ -121,11 +121,11 @@ if __name__ == '__main__':
if os.path.isfile(arg):
arg = pydoc.importfile(arg)
writedoc(arg, True)
- except pydoc.ErrorDuringImport, value:
- print 'problem in %s - %s' % (
- cgi.escape(value.filename), cgi.escape(value.exc))
+ except pydoc.ErrorDuringImport as value:
+ print('problem in %s - %s' % (
+ cgi.escape(value.filename), cgi.escape(value.exc)))
else:
raise BadUsage
except (getopt.error, BadUsage):
- print "need parameters\n"
+ print("need parameters\n")