Beispiel #1
0
def getCrimeScore():
  ''' Returns the calculated CrimeScore.'''

  ratingsHash = getRatingsHashFromForm()
  cs = CrimeScore(ratingsHash)
  score = cs.calculateCrimeScore()
  commentary = cs.getScoreCommentary()

  if ratingsHash.keys == ["ERROR"] or len(ratingsHash) == 0:
    # If there's an error or the user hasn't filled in ratings yet,
    # there's no CrimeScore to return!
    return ""

  else: #so, if the hash table is populated
    return score
Beispiel #2
0
def getCrimeScore():
    ''' Returns the calculated CrimeScore.'''

    ratingsHash = getRatingsHashFromForm()
    cs = CrimeScore(ratingsHash)
    score = cs.calculateCrimeScore()
    commentary = cs.getScoreCommentary()

    if ratingsHash.keys == ["ERROR"] or len(ratingsHash) == 0:
        # If there's an error or the user hasn't filled in ratings yet,
        # there's no CrimeScore to return!
        return ""

    else:  #so, if the hash table is populated
        return score
Beispiel #3
0
def getCrimeScoreCommentary():
  '''Returns the CrimeScore's associated commentary.'''
  ratingsHash = getRatingsHashFromForm()
  cs = CrimeScore(ratingsHash)
  return cs.getScoreCommentary()
Beispiel #4
0
def getCrimeScoreCommentary():
    '''Returns the CrimeScore's associated commentary.'''
    ratingsHash = getRatingsHashFromForm()
    cs = CrimeScore(ratingsHash)
    return cs.getScoreCommentary()