Problem with importing "external" modules
I have got (again *g*) a problem (funny thing is, that this once worked but won't work now anymore...):
I have a "main" sikuli.file (Runme.sikuli) which loads other "external" sikuli-files on demand and runs a pre-defined
routine "runModule()" inside of the loaded "external" modules. These are then doing their tests and the main sikuli
file loads the next module and so on...
All these files are opened via \\FILESERVER\
\\FILESERVER\
The external modules "InitSystem" and "GlobalSettings" are opened and found correctly, they are saved here:
\\FILESERVER\
\\FILESERVER\
So the other external modules are one level more down (in the "Tests"-directory) than "InitSystem" and "GlobalSettings".
Here is the code (I have cut out all the other code which is not important here) of Runme.sikuli:
---
import InitSystem
import GlobalSettings
import os
dir = os.path.
tests = os.path.join(dir, "Tests")
modulesToRun = ("Test1", "Test2", "Test_OCR")
print("Testing started: " + InitSystem.
popup("Abort test with ALT+SHIFT+C")
if (InitSystem.
popup("ERROR during startup, cancelling all tests...")
exit
else: # Startup was OK
# Iterating through all Test-Modules
popup("OK starting Tests in Modules")
for currentModule in modulesToRun:
currDir = os.path.join(tests, currentModule+
if not currDir in sys.path:
# Position XXXX1
InitSystem.
print("Testing ended: " + getCurrentTime())
---
The contents of the variables are at Position XXXX1:
currentModule: Test1
currDir: \\FILESERVER\
The Error I get is:
---
[error] Error message: Traceback (most recent call last):
File "c:\temp\
exec("import " + currentModule)
File "", line 1, in
ImportError: No module named Test1
---
Can please anybody help me? :)
I hope that I could describe the setup here :-)
Thanks a lot and best regards,
Chris
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- CryoGenID
- Solved:
- Last query:
- Last reply: