parallaxinc / BlocklyPropClient

Client to provide access to the propeller for loading binaries and serial terminal
9 stars 7 forks source link

When running on Linux, application tries to read files from the root directory #82

Closed dlcarrier closed 7 years ago

dlcarrier commented 7 years ago

When running BlocklyPropClient on Linux, the self.appdir call returns empty, and all attempts to read a file from the working directory, or a subdirectory of the working directory, result in a read from the root directory, or a subdirectory of the root directory.

This appears to be the same as this issue: https://github.com/parallaxinc/BlocklyProp/issues/929, except on Linux instead of OS X.

zfi commented 7 years ago

@dcarrier-parallax What flavor/version of Linux is this happening on? The self.appdir construct appears in a number of places in the source. My understanding is that there is only one place in the code where we are reading a file and that is when when we are launching the propeller-load to program the device. Where are you seeing this?

PropGit commented 7 years ago

@dcarrier-parallax told me yesterday that's its Ubuntu.

The error happens when 1) selecting About > About to see the about.txt file... where it tries to find it a /about.txt, and 2) downloading, where it tries /propeller-tools/propeller-load.

The output that led us to realize this was on the terminal output, I think, and not in the log file... but I can't remember that for sure.

PropGit commented 7 years ago

@zfi - I see the same thing happening on the Development VM. How are you starting the BlocklyPropClient on the Development VM? Maybe we're both doing it differently than you.

I've changed the code slightly to work in my case, but am pouring through the plethora of solutions to this problem before settling it.

zfi commented 7 years ago

On a Linux system, one should compile the application with this command line

$ pyinstaller BlocklyPropClient.linux.spec

This will create a distribution in the ./dist/BlocklyPropClient.linux/ folder. One can then run the compiled client

$ ./dist/BlocklyPropClient.linux/BlocklyPropClient

The about.txt file does not appear in the distribution file set. This needs to be corrected before the Abount menu item can work.

PropGit commented 7 years ago

Thanks @zfi - I have a fix completed for the about.txt issue and the run-from-source working folder not found issue. Both will be in a PR this morning after I verify that they don't cause problems with Win and Mac builds/runs.

PropGit commented 7 years ago

Fix for this is PR #83.

Tested on Win 32 (run from source, run from dist, run from installer), Mac (run from source, run from dist, run from installer) and Ubuntu (run from source and run from dist).

PropGit commented 7 years ago

@dcarrier-parallax - Can you pull from the demo branch again on your system and re-run the experiment we did before to verify good behavior?

PropGit commented 7 years ago

Closing this because I've verified this myself.