add option for delayed imports

will make setup checking easier, although it does not work for all cases
(from imports for example)

Change-Id: I2e5cf9b427a6f8e6f603d9662cdb9700d5f9ad9a
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/33893
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
Alexander Zaft
2024-06-10 14:05:51 +02:00
committed by Markus Zolliker
parent e093bdae96
commit 6837b82791
4 changed files with 33 additions and 14 deletions

View File

@ -24,17 +24,17 @@
from os import path
# eventually he3control
from he3d import he3cell # pylint: disable=import-error
from frappy.core import Attached
from frappy.datatypes import ArrayOf, FloatRange, IntRange, StatusType, \
StringType, TupleOf
from frappy.errors import CommandRunningError
from frappy.lib import delayed_import
from frappy.modules import Command, Drivable, Module, Parameter, Property, \
Readable
from frappy.rwhandler import CommonReadHandler
he3d = delayed_import('he3d')
integral = IntRange()
floating = FloatRange()
string = StringType()
@ -52,7 +52,7 @@ class Cell(Module):
def initModule(self):
super().initModule()
self.cell = he3cell.He3_cell(
self.cell = he3d.he3cell.He3_cell(
path.join(self.config_directory, 'cell.yml'))
# Commands