Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

www-data folder in GUI build #58

Closed
photomedia opened this issue Aug 30, 2018 · 8 comments
Closed

www-data folder in GUI build #58

photomedia opened this issue Aug 30, 2018 · 8 comments

Comments

@photomedia
Copy link
Contributor

photomedia commented Aug 30, 2018

I ran into an issue while constructing the build (using .spec) for MAC OS for the GUI version.

I'm able to make the distribution, and the GUI launches from the dist folder and the APP bundle, but then when I try to launch --run_server from within the GUI, I get an error like this (running from dist folder):

16554] Failed to execute script fluentdnagui
Traceback (most recent call last):
File "DDV/fluentdnagui.py", line 541, in
File "site-packages/gooey/python_bindings/gooey_decorator.py", line 89, in
File "DDV/fluentdnagui.py", line 537, in main
File "DDV/fluentdnagui.py", line 129, in ddv
File "DDV/fluentdnagui.py", line 120, in done
File "DDV/fluentdnagui.py", line 104, in run_server
FileNotFoundError: [Errno 2] No such file or directory: '/Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui/www-data/dnadata'
Setting up Python...
Running in: /Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui
Setting up HTTP Server based from /Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui/www-data/dnadata

From the APP bundle, the same folder is not found , but that runs from within a different folder if you just double click on it (running from APP bundle):

[17058] Failed to execute script fluentdnagui
Traceback (most recent call last):
File "DDV/fluentdnagui.py", line 541, in
File "site-packages/gooey/python_bindings/gooey_decorator.py", line 89, in
File "DDV/fluentdnagui.py", line 537, in main
File "DDV/fluentdnagui.py", line 129, in ddv
File "DDV/fluentdnagui.py", line 120, in done
File "DDV/fluentdnagui.py", line 104, in run_server
FileNotFoundError: [Errno 2] No such file or directory: '/Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui.app/Contents/MacOS/www-data/dnadata'
Setting up Python...
Running in: /Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui.app/Contents/MacOS
Setting up HTTP Server based from /Users/tomasz/Documents/bitbucket/FluentDNA/dist/FluentDNAgui.app/Contents/MacOS/www-data/dnadata

Clearly, the www-data/dnadata isn't being found, causing this issue. I pushed the in-development spec file (https://github.com/josiahseaman/FluentDNA/blob/gui/fluentdnagui.spec) for the GUI version, but this issue needs to be solved. Any suggestions or comments on this www-data/dnadata folder?

@josiahseaman
Copy link
Owner

The spec file contains mentions of folders that should be included and pathed in the executable bundle. example_data/ and www-data/dnadata should both be their own folders separate from the executable. That way people can reference the example_data for testing their new program. Though there's also the simple solution that --runserver should just create a folder if it isn't there. It's okay for www-data/dnadata to be empty.

@photomedia
Copy link
Contributor Author

thanks for that, I added the empty folder to DDV/ and the www-data/dnadata reference to the spec file. That removes the error message with the reference to the missing folder, but now there is no error message but --runserver still doesn't work, and there is just no output at all. This works fine when run locally (not from the distribution) so it is something to do with the build.

@josiahseaman
Copy link
Owner

If you find that you can load a page in the browser, but there's no text output on the application, then it's a problem with output flushing. I found I needed edit some print lines with print('...', flush=True) in the code in order to get it to behave properly in the GUI. These changes are in my GUI branch. Does that sound like the problem you're seeing?

I also have this open issue #54 but I haven't looked into it in more detail, so I couldn't say.

@photomedia
Copy link
Contributor Author

photomedia commented Sep 6, 2018

Yes, I added some more error checking, and a flush=True on the last print, and it turns out that the server was being launched. The flush=True got the output onto the GUI, and the server is actually launched. However, it looks like it is launched in a new thread, so you end up with two instances of the application running:
screen shot 2018-09-06 at 11 06 45 am
That leaves the GUI with no way to return/edit other than "stop", which leads to this not so friendly message:
screen shot 2018-09-06 at 11 21 01 am
If you click on "OK", you do get back to the GUI that allows you to Edit, Restart, Close:
screen shot 2018-09-06 at 11 13 35 am
So with the Flush=True, it becomes more usable, but having to go through a duplicate window that needs to Close with a warning is not user friendly.
So this looks like the threading on the httpd.serve_forever() is not working well with the Gooey?

@josiahseaman
Copy link
Owner

josiahseaman commented Sep 6, 2018 via email

@photomedia
Copy link
Contributor Author

photomedia commented Sep 6, 2018

Sure, I can push a "pre-release" of the MAC GUI bundled "APP", but obviously, the design/layout of the GUI still needs a lot of work and testing.

@josiahseaman
Copy link
Owner

josiahseaman commented Sep 6, 2018 via email

@photomedia
Copy link
Contributor Author

OK, the pre-release of the GUI for the Mac https://github.com/josiahseaman/FluentDNA/releases/tag/fluentdnagui-macos-prerelease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants