Currently i try to implement my own mechanism for importing (Iron)Python files, but i'm note sure, if i'm consedering all cases.
For example i have the current structure in the filesystem for thesting the system:
/Sample/
/ImportResolver/
/Math/
/__init__.py
/Math2.py
__init__py contains:
# Sample math package
import Math2
Math.py contains:
# Add two values
def add(x, y):
return x + y
Now if i execute the following import statement:
import Sample.ImportResolver.Math
My code tries to resolve the following python scripts, when importing:
Try import sub package: Sample/init.py
Try import sub package: Sample/ImportResolver/init.py
Try import module: Sample/ImportResolver/Math.py
Try import package: Sample/ImportResolver/Math/init.py
Looking at the list above, am i trying to import all things needed, or is the mecahnism completly wrong?
Furthermore, which files should the importer try to import when executing:
from Sample.ImportResolver import Math
Please tell me if it is totally unclear what i am looking for. Thank you!