+1 on Python -- I need to take some time to take a look at the Perl code. I used Perl way back when so will have to get up on my shifts and such :)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Chris Mattmann, Ph.D. Senior Computer Scientist NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 171-266B, Mailstop: 171-246 Email: chris.a.mattm...@nasa.gov WWW: http://sunset.usc.edu/~mattmann/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Adjunct Assistant Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -----Original Message----- From: Greg Stein <gst...@gmail.com> Reply-To: "dev@steve.apache.org" <dev@steve.apache.org> Date: Sunday, June 2, 2013 2:08 PM To: "dev@steve.apache.org" <dev@steve.apache.org> Subject: Re: svn commit: r1487609 - in /steve/trunk/cmdline: ballots.pm make_issue.pl randomize.pm reminder.pl steve.pm >Per Alan's wanting to do some Python work... anybody have any problem >with [the project] converting the Perl scripts over to Python? > >While I can manage some Perl with perlman in front of me, I think >we're all more comfortable with Python. We have 1492 lines of Perl. >Looking at the long (make_issue.pl), it is more text than code. We >should be able to port the scripts over one at a time. > >(and note that wrapsuid.c is agnostic about the target program) > >I'm also thinking we could write a ./configure script in Python. >Normally, it is shell, but if Steve requires Python, then I see no >problem with configure being in Python. (specifically, I'm looking at >grp.getgrnam() (and similar for user id) to map a human name to an ID, >rather than hard-coding in Makefile) > >Cheers, >-g > > >On Wed, May 29, 2013 at 3:35 PM, <j...@apache.org> wrote: >> Author: jim >> Date: Wed May 29 19:35:26 2013 >> New Revision: 1487609 >> >> URL: http://svn.apache.org/r1487609 >> Log: >> Lump all Steve subs into steve.pm >> >> Removed: >> steve/trunk/cmdline/ballots.pm >> steve/trunk/cmdline/randomize.pm >> Modified: >> steve/trunk/cmdline/make_issue.pl >> steve/trunk/cmdline/reminder.pl >> steve/trunk/cmdline/steve.pm >> >> Modified: steve/trunk/cmdline/make_issue.pl >> URL: >>http://svn.apache.org/viewvc/steve/trunk/cmdline/make_issue.pl?rev=148760 >>9&r1=1487608&r2=1487609&view=diff >> >>========================================================================= >>===== >> --- steve/trunk/cmdline/make_issue.pl (original) >> +++ steve/trunk/cmdline/make_issue.pl Wed May 29 19:35:26 2013 >> @@ -38,8 +38,6 @@ BEGIN { >> unshift @INC, "/home/voter/bin"; >> } >> require "getopts.pl"; >> -use randomize; >> -use ballots; >> use steve; >> >> umask(0077); >> >> Modified: steve/trunk/cmdline/reminder.pl >> URL: >>http://svn.apache.org/viewvc/steve/trunk/cmdline/reminder.pl?rev=1487609& >>r1=1487608&r2=1487609&view=diff >> >>========================================================================= >>===== >> --- steve/trunk/cmdline/reminder.pl (original) >> +++ steve/trunk/cmdline/reminder.pl Wed May 29 19:35:26 2013 >> @@ -26,7 +26,6 @@ >> BEGIN { >> unshift @INC, "/home/voter/bin"; >> } >> -use randomize; >> use steve; >> >> >> >> Modified: steve/trunk/cmdline/steve.pm >> URL: >>http://svn.apache.org/viewvc/steve/trunk/cmdline/steve.pm?rev=1487609&r1= >>1487608&r2=1487609&view=diff >> >>========================================================================= >>===== >> --- steve/trunk/cmdline/steve.pm (original) >> +++ steve/trunk/cmdline/steve.pm Wed May 29 19:35:26 2013 >> @@ -19,6 +19,8 @@ >> # shared functions for Apache Steve. >> # >> >> +##use strict; >> + >> $ECHO = '/bin/echo'; >> $CAT = '/bin/cat'; >> $MD5 = '/sbin/md5'; >> @@ -204,4 +206,42 @@ sub not_valid { >> return 0; >> } >> >> +# randomize the order in which candidates are listed >> +# >> +# candidates are identified with a single alphanumeric character >>surrounded >> +# by square brackets as the first non-blank on a line. >> +# >> +# candidates are to be listed consecutively, one per line. If this is >> +# found not to be the case, NO reordering is performed. >> +sub randomize { >> + my (@prolog, @choices, @epilog); >> + >> + push @prolog, shift while @_ && not $_[0] =~ /^\s*\[[a-z0-9]\]\s/; >> + unshift @epilog, pop while @_ && not $_[-1] =~ /^\s*\[[a-z0-9]\]\s/; >> + return @prolog, @_, @epilog if grep !/^\s*\[\S\]\s/, @_; >> + push @choices, splice(@_, rand @_, 1) while @_; >> + return @prolog, @choices, @epilog; >> +} >> + >> +# return the ballot identifiers for each candidate in an issue. >> +# >> +# candidates are identified with a single alphanumeric character >>surrounded >> +# by square brackets as the first non-blank on a line. >> +# >> +# candidates are to be listed consecutively, one per line. >> +# >> +sub ballots { >> + my (@ballots); >> + >> + shift while @_ && not $_[0] =~ /^\s*\[[a-z0-9]\]\s/; >> + for (@_) { >> + if (/^\s*\[([a-z0-9])\]\s/) { >> + push @ballots, "$1\n"; >> + } else { >> + last; >> + } >> + } >> + return @ballots; >> +} >> + >> 1; >> >>