Ejemplo n.º 1
0
def printResults(string, answers={}):
                history = DBtransactions.parseInput(string)
                if not isinstance(history, basestring):
                        historyString = views.historyToString(history)
			historyTable = views.historyToTable(history)
                        result = DBtransactions.computeEverything(history)
			conflictOperations = views.conflictOperationsToString(result['conflictOperations'])
			readingTAs = views.readingTAsToString(result['readingTAs'])
			committedTransactions = views.transactionListToString(result['committedTAs'])
			abortedTransactions = views.transactionListToString(result['abortedTAs'])
                        graph = result['graph']
                        isSR = result['SR']
                        operationsNotRC = result['operationsNotRC']
			isRC = result['RC']
                        operationsNotACA = result['operationsNotACA']
			isACA = result['ACA']
                        operationsNotST = result['operationsNotST']
			isST = result['ST']
			
			resultString =  historyTable+views.wrapInPanel("Konfliktoperationen", conflictOperations,3)+views.wrapInPanel("Lesende Transaktionen", readingTAs, 3)+views.wrapInPanel("Committete Transaktionen", committedTransactions, 3)+views.wrapInPanel("Abortete Transaktionen", abortedTransactions, 3)+views.htmlGraph()+"<div>"+views.wrapInPanel("Eigenschaften von H := "+historyString, views.booleanPropertyToString("serialisierbar", isSR)+views.propertyToString("rücksetzbar", history, operationsNotRC)+views.propertyToString("vermeidet kaskadierendes Rücksetzen", history, operationsNotACA)+views.propertyToString("strikt", history, operationsNotST), 12)+"</div>"+printjquery(graph, history)
                	if answers:
				if answers['SR'] == isSR and  answers['RC'] == isRC and  answers['ACA'] == isACA and  answers['ST'] == isST:
					returnString = printCheckboxes(answers) + views.getMessageBox("Richtig!","thumbs-up") + resultString
				else:
					returnString = printCheckboxes(answers) + views.getMessageBox("Leider falsch!","thumbs-down")
			else:
				returnString = printCheckboxes(result) + resultString
		else:
			returnString = printCheckboxes(answers) + history
		return returnString
Ejemplo n.º 2
0
def printResults(string, answers={}):
                history = DBtransactions.parseInput(string)
                if not isinstance(history, basestring):
                        historyString = views.historyToString(history)
			historyTable = views.historyToTable(history)
                        result = DBtransactions.computeEverything(history)
			conflictOperations = views.conflictOperationsToString(result['conflictOperations'])
			readingTAs = views.readingTAsToString(result['readingTAs'])
			committedTransactions = views.transactionListToString(result['committedTAs'])
			abortedTransactions = views.transactionListToString(result['abortedTAs'])
                        graph = result['graph']
                        isSR = result['SR']
                        operationsNotRC = result['operationsNotRC']
			isRC = result['RC']
                        operationsNotACA = result['operationsNotACA']
			isACA = result['ACA']
                        operationsNotST = result['operationsNotST']
			isST = result['ST']
			
			resultString =  historyTable+views.wrapInPanel("Konfliktoperationen", conflictOperations,3)+views.wrapInPanel("Lesende Transaktionen", readingTAs, 3)+views.wrapInPanel("Committete Transaktionen", committedTransactions, 3)+views.wrapInPanel("Abortete Transaktionen", abortedTransactions, 3)+views.htmlGraph()+"<div>"+views.wrapInPanel("Eigenschaften von H := "+historyString, views.booleanPropertyToString("serialisierbar", isSR)+views.propertyToString("rücksetzbar", history, operationsNotRC)+views.propertyToString("vermeidet kaskadierendes Rücksetzen", history, operationsNotACA)+views.propertyToString("strikt", history, operationsNotST), 12)+"</div>"+printjquery(graph, history)
                	if answers:
				if answers['SR'] == isSR and  answers['RC'] == isRC and  answers['ACA'] == isACA and  answers['ST'] == isST:
					returnString = printCheckboxes(answers) + views.getMessageBox("Richtig!","thumbs-up") + resultString
				else:
					returnString = printCheckboxes(answers) + views.getMessageBox("Leider falsch!","thumbs-down")
			else:
				returnString = printCheckboxes(result) + resultString
		else:
			returnString = printCheckboxes(answers) + history
		return returnString