Re: [OVC-demo-team] BRP status report

From: David Mertz <voting-project_at_gnosis_dot_cx>
Date: Mon Mar 15 2004 - 23:27:35 CST

> To do this, I had to patch random_ballots.py to address the ballot ID
> padding issue Alan mentioned.

Good job Eron. One little suggestion. Instead of your patch:

     randomId = ids[i]
     if randomId < 1000:
         ballotId = '0' + str(randomId)
     else:
         ballotId = randomId

A simpler way is:

     ballotId = "%04d" % ids[i]

Or if you like, you can do this at top:

        # ids = range(10000) # Use padded strings instead ->
        ids = ["%04d" % i for i in range(10000)]

Admittedly, the later lines that use 'ballotId' rather than 'ids[i]'
are probably more self-documenting.

I'm not sure what the barcode/IndexError issue is. I don't -think-
there's anything wrong with my random ballots, but I might have missed
something. Probably Jan will have a better guess about that (though if
I had to guess, I'd guess that the problem had to do with the special
value "No Preference Indicated" in some contests and/or the value
"WRITE-IN").
==================================================================
= The content of this message, with the exception of any external
= quotations under fair use, are released to the Public Domain
==================================================================
Received on Thu Apr 1 02:40:27 2004

This archive was generated by hypermail 2.1.8 : Thu Apr 01 2004 - 02:40:36 CST