Exemplo n.º 1
0
  def checkMinRequirements(self):
    "Only attempt to count votes if there are enough candidates and voters."
    
    OrderDependentSTV.checkMinRequirements(self)
    if self.b.numBallots < self.batchCutoff * self.numSeats:
      raise RuntimeError, """\
Not enough ballots to run an election.
Need at least %d ballots but have only %d.""" % (
        self.batchCutoff*self.numSeats, self.b.numBallots)