Commits

Richard Shea committed aed9c3e Draft

Fixups arising from massive tabs for spaces exercise in order to get test suite to run clean

  • Participants
  • Parent commits a8a1f6b

Comments (0)

Files changed (5)

MathsMish/QuestionMachine.py

         self.__operator = operator
         self.__lhsCandidates = [] 
         self.__rhsCandidates = [] 
-                #In the longer term __dicCandidateQuestions should
-                #probably be initialized within __maintainCandidateAndQuestionSpace
+        #In the longer term __dicCandidateQuestions should
+        #probably be initialized within __maintainCandidateAndQuestionSpace
         self.__dicCandidateQuestions = [] 
-                #I think it's possible that __dicCandidateQuestions is redundant
-                #due to it now having been replaced with the CandidateSpace 
-                #property
-                self.__CandidateQuestions = []
+        #I think it's possible that __dicCandidateQuestions is redundant
+        #due to it now having been replaced with the CandidateSpace 
+        #property
+        self.__CandidateQuestions = []
 
         self.__rhsDefaultsInUse = MMDBConstants.RHS_STARTOFFSET
         self.__lhsDefaultsInUse = MMDBConstants.LHS_STARTOFFSET
         self.__questionSelectionMethod = QuestionSelectionMethod.WEIGHTED
         self.__candidateOperators = ['x'] 
 
-        pass
-
     def __del__(self):
         pass
 

MathsMish/mmdb/BusinessObject/Attempt.py

     def __init__(self, whn = None, lhs = None, rhs = None, op = None, correct = None, uid = None, suppAns = None):
         self._player = Player(uid)
         self._question = Question(lhs, rhs, op, suppliedAnswer= suppAns)
-            self._when = whn 
+        self._when = whn 
         self._correct = None 
 
     def getsum(self):

MathsMish/mmdb/BusinessObject/Question.py

             operator = "x"
         self.__validateInitArgs(lhs, rhs, operator)
     
-    self.__sum = Sum(lhs, rhs, operator)
-    self.__inuse = inuse 
-    self.__order = order 
-    self.__userid = userid 
-    self.__suppliedAnswer = suppliedAnswer 
+        self.__sum = Sum(lhs, rhs, operator)
+        self.__inuse = inuse 
+        self.__order = order 
+        self.__userid = userid 
+        self.__suppliedAnswer = suppliedAnswer 
     
     def __str__(self):
         return "%s %s %s" % (self.sum.lhs, self.sum.operator, self.sum.rhs)
     
     def hasBeenAnswered(self):
         if self.suppliedAnswer == None:
-        return False
-    else:
-        return True
+            return False
+        else:
+            return True
     
     def __validateInitArgs(self, lhs, rhs, operator):
         try:

MathsMish/mmdb/BusinessObject/Sum.py

 class Sum(object):
     
     def __init__(self, lhs = None, rhs = None, operator = None, id = None):
-    self._lhs = lhs 
-    self._rhs = rhs 
-    self._operator = operator 
-    self.__id =  id
+        self._lhs = lhs 
+        self._rhs = rhs 
+        self._operator = operator 
+        self.__id =  id
     
     def __str__(self):
         return "%s %s %s" % (self.lhs, self.operator, self.rhs)

MathsMish/mmdb/mmdbConnection.py

     
     def useColumnNames(self, blnUseColumnNames):
         if blnUseColumnNames == True: 
-        self.rowFactory = sqlite3.Row
+            self.rowFactory = sqlite3.Row
         elif blnUseColumnNames == False: 
-        self.rowFactory = None 
+            self.rowFactory = None 
         else:
-        raise MMDBExceptions.FallingOutOfIfStatement 
+            raise MMDBExceptions.FallingOutOfIfStatement