This is an automated email from the ASF dual-hosted git repository.

gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git

commit 5613140a0435cf374e09cacd0d0f069bc5d35ea8
Author: Greg Stein <[email protected]>
AuthorDate: Tue Jun 7 21:13:14 2022 -0500

    Remove reliance upon CandidateList object.
    
    Switch to using the tally's "human" return result, rather than relying
    upon the CandidateList class to print results.
    
    A small typo/tweak was needed in stv.py to fix the output.
---
 v3/steve/vtypes/stv.py | 2 +-
 v3/test/run_stv.py     | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/v3/steve/vtypes/stv.py b/v3/steve/vtypes/stv.py
index baccdd5..14277e1 100644
--- a/v3/steve/vtypes/stv.py
+++ b/v3/steve/vtypes/stv.py
@@ -66,7 +66,7 @@ def tally(votestrings, kv, names=None):
     results = stv_tool.run_stv(names, votes, seats)
 
     human = '\n'.join(
-        f'{c.name:40}{" " if c.status == stv_tool.ELECTED else " not 
"}selected'
+        f'{c.name:40}{" " if c.status == stv_tool.ELECTED else " not "}elected'
         for c in results.l
         )
     data = { 'raw': results, }
diff --git a/v3/test/run_stv.py b/v3/test/run_stv.py
index fbde0b7..c9b2b28 100755
--- a/v3/test/run_stv.py
+++ b/v3/test/run_stv.py
@@ -56,12 +56,10 @@ def main(mtgdir):
 
     # NOTE: for backwards-compat, the tally() function accepts a
     # list of names with caller-defined sorting.
-    human, data = steve.vtypes.stv.tally(votes, kv, names)
+    human, _ = steve.vtypes.stv.tally(votes, kv, names)
 
-    candidates = data['raw']
-    candidates.print_results()
-
-    ### ugh. for comparison, do it:
+    # For the comparison purposes:
+    print(human)
     print('Done!')
 
 

Reply via email to