I have a module (bge) that only contains submodules (eg, render and logic). What is the proper way to create pypredef files for these? Currently I have a bge.pypredef, bge.render.pypredef and bge.logic.pypredef. bge.pypredef only has imports in it (import render; import logic). Without the imports using "bge." does nothing. However, the problem is this works (with the imports in bge.pypredef):
frombgeimportlogiclogic.foo# foo auto-completes
but this doesn't:
importbgebge.logic.foo# logic will auto-complete, but not foo
I'd like to be able to do the latter. Any thoughts?
Thanks,
Moguri
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It works as if it was python code, so, as you have different packages, you have to import the package you're using - i.e.: you have to add an import at bge to import the bge.logic package (as you'd need in regular python code).
E.g.:
bge.pypredef containing:
from bge import logic
bge.logic.pypredef containing:
class foo:
pass
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a module (bge) that only contains submodules (eg, render and logic). What is the proper way to create pypredef files for these? Currently I have a bge.pypredef, bge.render.pypredef and bge.logic.pypredef. bge.pypredef only has imports in it (import render; import logic). Without the imports using "bge." does nothing. However, the problem is this works (with the imports in bge.pypredef):
but this doesn't:
I'd like to be able to do the latter. Any thoughts?
Thanks,
Moguri
It works as if it was python code, so, as you have different packages, you have to import the package you're using - i.e.: you have to add an import at bge to import the bge.logic package (as you'd need in regular python code).
E.g.:
bge.pypredef containing:
from bge import logic
bge.logic.pypredef containing:
class foo:
pass
Cheers,
Fabio