-
Notifications
You must be signed in to change notification settings - Fork 161
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
Organizing parts of a large application #8
Comments
Hey Fredrik, I just tried the externalfile sample you mentioned and it works for me (see diff below). Either way, I think
The way I have it in fman is that I have such a file as
I think PyInstaller will complain if you run it twice with the same target directory. I would try running it with different target directories and then "brutally" copying them over each other. I'm afraid I'm not 100% sure I understood the requirements you outlined. Are the sub-apps standalone applications as well? Or are the simply windows displayed by the Base app? If the latter, I think I would try the following directory structure:
But of course that's just my best guess. I hope but am not sure it will work exactly like that for you :) Diff:
|
Okay, I realize I asked too many questions at once 😉
Ah yes, this did work... I must've done something wrong... 👍
Your example structure is almost what I'm trying to achieve, and I'll now just focus on the main problem I have. I'd like to achieve a freeze where the So, something like this for the files organization:
And something like this for the freeze (excluding all Python libraries etc):
Since both So, to clarify; I need the Does this all make sense? EDIT: I could just copy |
Yes, that makes sense. Thanks for clarifying :-) I think I would simply copy the You're probably right. Maybe you can't use
Hope this is what you meant? |
(P.S.: You probably can also simply call your |
Very nice, thank you! This works great, except for that I get this structure:
I'm just doing what you previously recommended:
Do you think I could get the cmdline.exe to be built in the Right now, I just copied the |
I'm going to make a public fork out of fbs-tutorial, by the way, so that anyone who wishes to do similar stuff could look at this as another tutorial example. |
I'm not sure; You could try PyInstaller's
Sounds good :-) |
Ok, I'll close this issue as I think I've got most questions answered ;) thanks again! |
Glad I could help :-) |
One last question on this setup... 😉 about the But after the freeze, Now, let's speculate that I would actually want the frozen Do you think such a thing would be possible? |
Here's my fork: https://github.com/fredrikaverpil/fbs-tutorial/tree/multibundle |
Yes, I would assume that if you delete the copy of |
Hm. I know that all python files are bundled under the .app on macOS etc, but I'm on Windows right now. And when I look inside of But I'll try a |
Very cool, it worked by doing a |
😄 |
I just hope all of this will work once auto-updating comes to fbs 😀 because it's awesome! |
We'll make it work :) |
Hm, unfortunately, I was mistaken. I can't import the |
Are you sure? I would have thought |
Yes. But I may have found a way with import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(sys.executable), 'modules'))
core = importlib.import_module('core') # works, imports Tutorial/modules/core/__init__.py
# import core # doesn't work, will import Tutorial/core/__init__.pyc Hm. It's not very nice... as you're bound to forget to not just |
I can't seem to get this to work in the long run. Even if I import |
Why is it important to read from the "source copy" of |
I have a Python API which I could bundle with the installer. It would be somewhat intuitive if the main apps (which uses this Python API) would actually use those files. But I guess it's not essential. |
Hi again @mherrmann!
In
src/main/python
, it seems like the intention is we can add multiple folders here in case our application is made out of multiple packages/parts. I've noticed that the tutorial example can import anything which resides here (very nice!) when running usingpython -m fbs run
.For example, I've got an application I'm experimenting with, which I might want to "fbs-ify" which is separated into many parts. Trying to simplify, here's an example of what my app could be made out of:
I'm thinking I could organize them in fbs by placing each "part" in a subfolder under
src/main/python
, as they could then be imported via a simple "import part" statement. However, I'm noticing that they won't get included in the app bundle when freezing (on Windows).To make a frozen app work, I have to place a copy of everything in the "resources" folder prior to the freeze, and it will successfully get bundled with the standalone app. So I'm starting to wonder how I should plan the file structure when using fbs... I don't want to put the same file in two locations so to speak.
What would you advise I do here?
My goal is to be able to have the standalone fbs application be able to import a certain module, but also allow for a headless way of importing the same module (meaning using Python).
EDIT: A very simple example is to just add an
extrafile.py
next to the tutorial'smain.py
and import this file inmain.py
. This will work fine withpython -m fbs run
but theextrafile.py
file will not be included with the standalone app when performing apython -m fbs run
, and thus the standalone app will crash.The text was updated successfully, but these errors were encountered: