Open silicongarage opened 1 month ago
Hi-
Thank you. I use it frequently at work (I'm an EE) and it's a helpful little tool. I have a coworker who likes it as well.
The help file has always worked as long as it's in the same directory as LaSolv, or the directory above it, or the directory above that. At least it's worked on my Mac's and on a couple PC's at work. I don't follow what you're saying about the temporary file structure; you must be more of an expert on MacOS than I am, which doesn't take much- this is my hobby, not my career.
My understanding with pyinstaller was that singlefile is when you want a final product in one file. 'singledir' was more for debugging, once you got that working, singlefile would be the next step. But yes, it can be slow to start, mostly on PC's it seems to me. I can open it by double clicking the icon on my old Mac and it's open before the count of 3. I'm happy that I can ever even get LaSolv to open after using pyinstaller- for a year or two I couldn't get it to work (working on it occasionally) and couldn't upload any updates. I'm in the process now of doing this and I'm using the same .spec file but the app won't open, it gives me an error message that I don't fully understand and so far Google hasn't found an solution.
I'm not real familiar with version control terms, except checkin/out, revert, and retrieve. Any more than that and I end up deleting stuff I want to keep- I tried git and svn and hated them both. Anyway, go ahead and do what you want. I'll help if I can.
I apologize ahead of time for the code quality, some/a lot/most of it is just really bad. Like embarrassing. Even atrocious. I've tried starting a rewrite a few times, eqnSolver.py for instance is a real mess, but there's so much to rewrite that it's just overwhelming and I've given up. It's unfortunate because I occasionally get ideas for new features to add but they are so hard to incorporate (yes, it all should be rewritten before adding anything new) that I don't bother.
Tom Spargo
On Thu, Oct 3, 2024 at 7:40 PM silicongarage @.***> wrote:
First, pretty impressive little tool! I've started playing with it and noticed a few issues.
(1) The bundled app is super slow to start up compared to just running via 'python gui_wx.py'. Seems that's a general problem of pyInstaller bundles when they are created as 'singlefile' as opposed to 'singledir'
(2) When using LaSolv.app the program gives an error msg about not being able to find the help file (help.htm). This is due to macOS apps creating a temporary file structure to run which breaks any relative file location paths inside the calling py program.
I've forked this repository and have fixes for the both the above. If you want I can create a pull request for the above changes. The changes are only for macOS arm64.
— Reply to this email directly, view it on GitHub https://github.com/taspargo/LaSolv/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALBEPMGEDHFTOQWZVWVISATZZXW2JAVCNFSM6AAAAABPK5KVPGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU3DKMRWGAYTMMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Sorry for any confusion in my description. I created a build script (make_mac_spec.txt
) to re-generate the LaSolv_mac.spec file and then used 'pyinstaller LaSolv_mac.spec' to rebuild the source. I'm not much of a python person - so google has been my friend understanding the subtleties of pyinstaller. That basically means that there's probably much better ways to solve the problem than what I did!
When bundled as a singlefile, the startup time on my Macbook M2 was 10 to 15 seconds, but as a singledir the time is around 3 to 4 seconds. But the bundle size is much bigger. The singledir issue is not a big deal if its then bundled as mac app '/Applications/LaSolv.app', but once you do that the search paths inside gui_wx.py for help.htm (../help.htm, help.htm, ../../help.htm)
no longer work. The work around is to use a library sys call to get the actual runtime path:
base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
This also requires an additional switch in the pyinstaller spec file: datas=[('src/help.htm', '.')]
I will create a pull, and you can look through what little I had to change. Pick and choose what you what you want. And by the way, I'm an EE in Austin, TX 😃
I'm running on a Macbook Pro from mid 2014, or sometimes on an iMac from
I don't specify singledir or singlefile in the spec file, I'll read up on what pyinstaller does in this case.
On Thu, Oct 3, 2024 at 11:33 PM silicongarage @.***> wrote:
Sorry for any confusion in my description. I created a build script ( make_mac_spec.txt) to re-generate the LaSolv_mac.spec file and then used 'pyinstaller LaSolv_mac.spec' to rebuild the source. I'm not much of a python person - so google has been my friend understanding the subtleties of pyinstaller. That basically means that there's probably much better ways to solve the problem than what I did!
When bundled as a singlefile, the startup time on my Macbook M2 was 10 to 15 seconds, but as a singledir the time is around 3 to 4 seconds. But the bundle size is much bigger. The singledir issue is not a big deal if its then bundled as mac app '/Applications/LaSolv.app', but once you do that the search paths inside gui_wx.py for help.htm (../help.htm, help.htm, ../../help.htm) no longer work. The work around is to use a library sys call to get the actual runtime path: base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(file))) This also requires an additional switch in the pyinstaller spec file: datas=[('src/help.htm', '.')]
I will create a pull, and you can look through what little I had to change. Pick and choose what you what you want. And by the way, I'm an EE in Austin, TX 😃
— Reply to this email directly, view it on GitHub https://github.com/taspargo/LaSolv/issues/1#issuecomment-2392856708, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALBEPMAM42F4AM2HVLDVA3TZZYSDHAVCNFSM6AAAAABPK5KVPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJSHA2TMNZQHA . You are receiving this because you commented.Message ID: @.***>
First, pretty impressive little tool! I've started playing with it and noticed a few issues.
(1) The bundled app is super slow to start up compared to just running via 'python gui_wx.py'. Seems that's a general problem of pyInstaller bundles when they are created as 'singlefile' as opposed to 'singledir'
(2) When using LaSolv.app the program gives an error msg about not being able to find the help file (help.htm). This is due to macOS apps creating a temporary file structure to run which breaks any relative file location paths inside the calling py program.
I've forked this repository and have fixes for the both the above. If you want I can create a pull request for the above changes. The changes are only for macOS arm64.