Re: Uploaded code

From: Matt Shomphe <mshomphe_at_comcast_dot_net>
Date: Wed Oct 29 2003 - 23:27:45 CST

Sorry about my prolonged absence. I am alive, and far away from those
SoCal fires :)

(By way of a brief apologia: I've been moving both my parents & my brother,
as well as dealing with massive layoffs at work. C'est la vie!)

I've checked out Jan's code for QAing. There are a few things to note.

(1) I'm getting the following error:
C:\Python23\Lib\site-packages\evm2003\test\ DeprecationWarning:
CII character '\xe4' in file
C:\Python23\lib\site-packages\evm2003\bva\ on line 13, but no
encoding declared; see for details
   from evm2003.bva.Play import Play
C:\Python23\Lib\site-packages\evm2003\test\ DeprecationWarning:
Non-ASCII character '\xe4' in file
C:\Python23\lib\site-packages\evm2003\utils\ on line 4, but no
encoding declared; see for details

What this means: if you use a non-ASCII character (like the "a" with the
umlaut over it), you have to declare at the top of the file the encoding
(utf-8 or something like that). See: Moreover,
I can't seem to save the files that have the in them. This may be a bug
in IDLE.

I need to know exactly what steps I can do to use this software. This
includes not only the installation steps, but any ancillary files I need
(voting ballots, etc.), and the steps to successfully run the
code. Currently, I have no ink, so I can't print out ballots. So it
goes.... But it took me a while to whack my way through the code. Also,
I'm working on a Windows XP system (laugh all you want ;), and I need to
know about compatability issues, if any. Basically, I need a whole bunch
of documentation in a single location.

(3) Installing the code. The best thing to do, I think, rather than
setting pythonpath variables, is to drop the evm2003 directory in your
$PYTHONPATH/Lib/site-packages directory. This is in the PYTHONPATH (at
least on windows it is). We should probably also work on an
installer. disutils ships with python and is pretty easy to use. This
isn't essential for right now, but something to keep in the back of our
collective hive
mind. (

(4) Coding standards. I've only looked at the code briefly, and it looks
fantastic! Great job, Jan! There are only two issues that I saw:
         - The use of the "string" module. This is largely deprecated in
favor of string methods. You have 'string.join(numdigits, "")'. This is
better expressed as '"".join(numdigits)'.
         - hardcoding v/data separation. I would pull out any variable
hardcoding (directories, etc.) and put it in a separate file. Then import
the variables into the module. We don't want to get bitten by a hardcoded
directory in the future.

I'll post more later.


At 04:11 PM 10/22/2003 +0200, Jan Karrman wrote:
>I have uploaded my code to SourceForge now. You can check it out
>with 'cvs checkout src'. To run the scripts, you need to set your
>PYTHONPATH environment variable to include the src directory
>where the code was downloaded. On Unix/Linux with something like:
> PYTHONPATH=/home/jan/voting-project/src; export PYTHONPATH
> setenv PYTHONPATH /home/jan/voting-project/src
>depending on what shell you have. Under Windows I believe you can
>set it via the Control Panel, or by editing AUTOEXEC.BAT on older
>To use the code, you will also need to install the gnosis XML parser:
>(should we upload this to SourceForge as well, to make it simpler to
>get the code together?)
>In the directory src/evm2003/test you will find two scripts that
>generate a paper ballot: prints directly to a printer, and
> writes postscript to a file.
>There is also a sample file vote-selection.xml that is used by
>The script is a simple barcode vocalization machine.
>You need to edit and to reflect your local environment;
>see the comments within the scripts.
>Here are the changes I have made to vote-selection.xml to get all
>needed information:
>In cast_ballot element, I added the attributes 'number' and 'precinct':
> <cast_ballot number="8545" precinct="2216"...>
>To define the data for President and Vice President within the same
>election element, I added the attribute 'coupled', and in selection
>the attribute 'name':
> <election coupled="Yes" name="Presidency"...>
> <selection name="President"...>Rachel Carson</selection>
> <selection name="Vice President"...>John Muir</selection>
>Since I have written the votes2digits() function myself now, I do not
>longer use the previously suggested barcodedata element.
>I know there are several Python wizards in the project - please note
>that this is the first Python code I have ever written :-)
>Looking forward to seeing more code uploaded soon...
= The content of this message, with the exception of any external
= quotations under fair use, are released to the Public Domain
Received on Fri Oct 31 23:17:05 2003

This archive was generated by hypermail 2.1.8 : Fri Oct 31 2003 - 23:17:07 CST