def get_results(self): if self.poll.get_module().module_id == 'score': # last entry should be question min/max params # catch untagged entries for backwards compatibility candidates = self.do_get_candidates() params = candidates[-1] if not re.match(r"\d{1,}-\d{1,}", params): params = "%d-%d" % (0, len(candidates)) else: params = candidates.pop() return gamma_count_range(self.do_get_results(), candidates, params) if self.poll.get_module().module_id == 'stv': # we expect cached stv results return self.poll.stv_results return gamma_count_parties(self.do_get_results(), self.do_get_candidates())
def get_results(self): if self.poll.get_module().module_id == "score": # last entry should be question min/max params # catch untagged entries for backwards compatibility candidates = self.do_get_candidates() params = candidates[-1] if not re.match(r"\d{1,}-\d{1,}", params): params = "%d-%d" % (0, len(candidates)) else: params = candidates.pop() return gamma_count_range(self.do_get_results(), candidates, params) if self.poll.get_module().module_id == "stv": # we expect cached stv results return self.poll.stv_results return gamma_count_parties(self.do_get_results(), self.do_get_candidates())