Closed EricTRocks closed 7 years ago
@willjp @drogenlied Could you have a look to see if there is anything that stands out as incompatible with PySide2 / Python3
I tested pyqt4 and pyqt5 on Python3 and there are definitely some issues:
./setup.py develop
does not lead to a working dev installation, all the python files except for setup.*
need to be in a folder named pyflowgraph
iteritems
entry on http://python-future.org/compatible_idioms.html or line 295 in graph_view.py
for solutions:
Traceback (most recent call last):
File "/home/jan/build/pyflowgraph_eric/pyflowgraph/graph_view.py", line 461, in mouseMoveEvent
for name, node in self.__nodes.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
Traceback (most recent call last):
File "/home/jan/build/pyflowgraph_eric/pyflowgraph/graph_view.py", line 491, in mouseMoveEvent
delta = event.pos() - self._lastMousePos
AttributeError: 'GraphView' object has no attribute '_lastMousePos'
QtCore.Qt.MouseButton.MiddleButton
and QtCore.Qt.MouseButton.RightButton
do not exist and the is
comparison has caused problems for me previously, so i would recommend comparing with ==
:
if event.button() is QtCore.Qt.LeftButton:
...
elif event.button() is QtCore.Qt.MouseButton.MiddleButton:
...
elif event.button() is QtCore.Qt.MouseButton.RightButton:
...
@drogenlied Thanks for testing. The problem with keeping the nested pyflowgraph
directory is that it can no longer be easily included as a submodule in other git projects where it's cloned location in that master project is within a path that is automatically added to PYTHONPATH. I tested normal installation with pip and it worked. What are you referring to when you are saying a dev installation
?
I'll take a look at the rest of the issues and fix them up.
@drogenlied I did a setup.py develop
on my end and it created an egg-link file and I could then import pyflowgraph without issue. What is not working for you? regarding thing?
@EricTRocks, when I use setup.py develop
, it creates the link just fine but I can't import pyflowgraph.
This happens on both Python 2.7.13 and 3.5.3.
However, I can do import graph_view
anywhere, which then fails because it cannot import Node
from the relative path .node
.
@drogenlied OK thanks for that information. I've got Python 2.7.9 installed I believe. Will upgrade and see if I get the same issues.
@drogenlied I actually did get the error with the develop mode install. Just needed to restart the command prompt to see it. I've fixed all the issues you found previously I believe with the recent commits aside from the connection line artifacts.
I've logged another issue for the artifacts. https://github.com/EricTRocks/pyflowgraph/issues/9
Let me know how the recent changes work for you.
@drogenlied The artifacts for connections is fixed (#9) with the latest commit. This was due to a change that was made where in graph_view.py it was calling node.moveBy()
instead of node.translate()
. The latter is a custom method which calls prepareConnectionGeometryChange()
that is used to alert the system that the connections need to be redrawn.
Things look ok now, except for the Python3/pyqt4 segfault on exit, which may not even be reproducible with slightly different versions of Qt or other operating systems.
I'll open a ticket for the segfault. In the mean time I'm merging this in.
This PR ports changed done locally in Kraken to pyflowgraph to extend the functionality and to allow Kraken to make pyflowgraph a sub-module.