Exemple #1
0
def execute_test(filepath):
    
    EventManager.reset()
    
    DEBUG = False
    parseError = False
    try:
        parsedItems = clipsparser.parseFile(filepath, DEBUG)
    except ParseException, e:
        
        parseError = True
        
        print "Errore nel file: ", filepath
        print "    [dopo] Riga:         ", e.lineno
        print "    [dopo] Colonna:      ", e.col
        print "    [dopo] Testo:        ", e.line
        print "    Messaggio:           ", str(e)
        print
Exemple #2
0
    
    except Exception, e2:
        parseError = True
        
        print e2
        
    finally:

        # in caso di eccezione del parser, e debug falso
        # eseguo nuovamente
        if parseError: 
            if not DEBUG:
                print "Vuoi attivare la modalita' debug del parser? (si/no)"
                risposta = raw_input()
                if risposta.lower() == "si":
                    parsedItems = clipsparser.parseFile(filepath, True)
                else:
                    return
            else:
                return            
        
    if DEBUG:
        clipsparser.debug_parsed(parsedItems)

    rete = ReteNetwork()
    
    DM = ConsoleDebugMonitor()
    DM.linkToEventManager(EventManager)
    
    RR = ReteRenderer()
    RR.linkToEventManager(EventManager)