Menu

PrintFacts() doesn't print after bad Assert

Help
Pyc Liph
2008-07-28
2013-04-25
  • Pyc Liph

    Pyc Liph - 2008-07-28

    It appears that clips.PrintFacts() stops printing after a bad Assert, as below:

    >>> clips.PrintFacts()
    f-0     (initial-fact)
    f-1     (duck)
    For a total of 2 facts.
    >>> clips.Assert("eagle")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "build/bdist.linux-i686/egg/clips/_clips_wrap.py", line 3152, in Assert
    _clips.ClipsError: C12: could not assert
    >>>
    >>>
    >>> clips.Assert("(eagle)")
    <Fact 'f-2': fact object at 0x844f700>
    >>> clips.FactList()
    [<Fact 'f-0': fact object at 0x831bb40>, <Fact 'f-1': fact object at 0x8300280>, <Fact 'f-2': fact object at 0x8300740>]
    >>> clips.PrintFacts()
    >>>
    >>> clips.PrintFacts()
    >>> clips.FactList()
    [<Fact 'f-0': fact object at 0x83006c0>, <Fact 'f-1': fact object at 0x8300900>, <Fact 'f-2': fact object at 0x844fc60>]
    >>>

    One would expect no correlation between assert error and fact printing.
    Is there a way to 'clean' pyclips enough, after the '... C12: could not assert'
    to keep the clips.PrintFacts() operational?
    Thanks,
    Pyc.

     
    • Francesco Garosi

      Hello,

      it looks like the "(facts)" function does not work after a bad call to Assert(), even when it is called directly via SendCommand(). I have to investigate a little about it, to verify where the problem takes place!

      F.

       

Log in to post a comment.