Open francisco-dlp opened 7 years ago
Yes it should, the "Connection refused" error is relevant. Which version of Qt/PyQt/PySide are you using?
(the relevant file to debug is single_application.py
)
qt 4.8.7, pyqt 4.11.4
That should not be a problem. Try increasing SingleApplicationWithMessaging._timeout
and see if that changes anything.
Still refusing with 10000
Do you see any log output from the existing instance?
This is all I get
ERROR:hyperspyui.singleapplication:QLocalSocket::connectToServer: Connection refused
DEBUG:hyperspyui.singleapplication:An existing instance of HyperSpyUI is running, sending arguments to it.
PS, this uses a QLocalServer and a QLocalSocket to communicate from the secondary instance to the primary instance. Do you possibly have an interesting network config for localhost?
This is all I get [...]
That should be the log output from the new instance of the UI. Is there anything from the existing instance (the one that is running the full UI)?
No, that one doesn't print anything to the log while attempting to connect.
There is nothing special about my localhost AFAICT.
It works for me in Windows.
Could you download this file and run it from two different terminals? You will need to call it with an extra arg, e.g. python single_app.py test
.
It should isolate the problem to a very minimal scenario.
I get Exiting early!
When running the first one?
No, the first one is fine Loaded app
For me, the outputs are:
First:
python single_app.py
Loaded app
<waits here until second app gets run>
["test"]
Second:
python single_app.py test
Exiting early!
In Windows?
Could you check out the basic-CI branch on my repo? It has a test that performs those basic steps, which passes on Travis (#131).
Simply running py.test
should do.
I have not been able to reproduce the issue in my laptop computer which is running Ubuntu (my office computer runs Debian testing). So, you were right, there may be an issue with my OS. I'll check once I get to the office.
I have boiled down the problem to running hyperspyui as an application in Gnome. I have the following desktop entry:
[Desktop Entry]
Exec=/home/fjd29/anaconda3/bin/hyperspyui %F
Name=HyperSpy UI
Terminal=false
MimeType=application/x-hdf;application/x-dm3;
Icon=/home/fjd29/Python/hyperspyUI/hyperspyui/images/hyperspy.svg
Type=Application
X-MultipleArgs=true
Categories=Science;Physics;DataVisualization;
I only experience the issue when I start HyperSpyUI using this method. If I change Terminal
to true
I don't experience the issue any more (but I get a terminal with the app, which I don't want). When the issue triggers I have to restart in order to be able to launch hyperspyui from a terminal accepting connections. Killing hyperspyui manually doesn't work, nor login out from the gnome session.
Note: after I manage to integrate hyperspyui successfully in my gnome desktop I'll make a PR.
@francisco-dlp : Could you try to print sys.argv
on launch? I think the code might be making some assumptions about the form of that!
No wait, that wouldn't explain the network error :-/
Currently calling hyperspyui when an instance is active results in the following:
Shouldn't it open the file in the current instance instead?