Fix module imports with Python3

Authored by cordlandwehr on Nov 30 2019, 5:14 PM.



The broken module import was covered by the missleading warning
"WARNING Missing Graphviz dependency: diagrams will not be generated."

Test Plan

Installed and run kapidox_generate ../kunitconversion/

Diff Detail

R264 KApiDox
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
cordlandwehr created this revision.Nov 30 2019, 5:14 PM
Restricted Application added projects: Frameworks, Documentation. · View Herald TranscriptNov 30 2019, 5:14 PM
Restricted Application added subscribers: kde-doc-english, kde-frameworks-devel. · View Herald Transcript
cordlandwehr requested review of this revision.Nov 30 2019, 5:14 PM
ochurlaud accepted this revision.Dec 1 2019, 4:32 PM

If it still works it's OK to push.

This revision is now accepted and ready to land.Dec 1 2019, 4:32 PM
This revision was automatically updated to reflect the committed changes.
kossebau added a subscriber: kossebau.EditedJan 14 2020, 5:53 AM

Hi. Sadly failed to pick this change up until yesterday, as I had forgotten a change in the local checkout on my last work on the server, which then blocked the update via scripted git pull.
That I fixed partially yesterday, making sure latest KApiDox is run on, but that showed that gentoo(?) server running does not like yet this new code:

Traceback (most recent call last):
  File "/home/api/kapidox/src/kapidox_generate", line 110, in <module>
  File "/home/api/kapidox/src/kapidox_generate", line 106, in main
  File "/home/api/kapidox/src/kapidox/", line 108, in do_it
    dot_files, tmp_dir)
  File "/home/api/kapidox/src/kapidox/", line 646, in generate_diagram
  File "/home/api/kapidox/src/kapidox/depdiagram/", line 156, in generate
    db.populate(dot_files, with_qt=with_qt)
  File "/home/api/kapidox/src/kapidox/depdiagram/", line 175, in populate
    fw = parser.parse(tier, dot_file)
  File "/home/api/kapidox/src/kapidox/depdiagram/", line 115, in parse
    dot_data =  preprocess(dot_file)
  File "/home/api/kapidox/src/kapidox/depdiagram/", line 75, in preprocess
    for node_handle in gvutils.get_node_list(graph_handle):
NameError: global name 'gvutils' is not defined


Seems that new import kapidox.depdiagram.gvutils is something the python there is not digesting as expected? (Edit: which is Python 2.7.15)

Not yet looked further myself, only got up now :)

No python developer myself, but from patterns seen I guess the imports should have some

if sys.version_info.major < 3:
    // python2 import style
    // python3 import style


D26652 now up as proposal to fix this