On 2010/5/21 Thomas Paviot wrote:
> 2010/5/21 Denis Barbier wrote:
[...]
>> Have a look at src/addons/Display/wxDisplay.py for instance:
>>    def InitDriver(self):
>>        try:
>>            os.environ["CSF_GraphicShr"]
>>        except KeyError:
>>            raise "Please set the CSF_GraphicShr environment variable."
>>        self._display = OCCViewer.NISViewer3d(self.GetHandle())
>>        self._display.Create()
>>        self._inited = True
>>        print "Inited!!"
>>
>> Everything would work just fine on Debian, except that this check
>> about CSF_GraphicShr makes program abort.   This check should be
>> removed, or at least performed only when self._display.Create() fails.
>>
>> Denis
>
> Ok. The problem is that when Create() fails, the exception is not catched by
> python, and then impossible to call the Create() method statement in a
> try/except.

Maybe this check could be moved somewhere into wrapper/Visualization/.
 If Opencascade exceptions cannot be caught by python, IMHO it seems
logical to trap them into the native part of pythonocc.

> You write 'should work fine'. Did you test it?

Yes, successfully tested just now after removing all checks and
unsetting CSF_GraphicShr.

> Maybe debian knows where all the files are located, but not OCC.

Yes, I do not say that upstream should get rid of CASROOT, just that
applications built on top of Opencascade should not assume that all
variables found in env.{csh,ksh} are always set.  For instance here
you do not use CSF_GraphicShr at all, so you should not have to worry
about where TKOpenGl is located.
AFAICT what is described here about Debian is also true for other
Linux distributions which provide Opencascade binary packages.

Denis

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to