summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-10-23 16:25:31 +0200
committeremkael <emkael@tlen.pl>2014-10-23 16:25:31 +0200
commit9a976853f6953b42c3f78cf989e028522bc48772 (patch)
tree81412500b34c84c665b38dccd0a970a60cb18848
parent225a26908b0ea981d735d7db7118a4f8598c95d5 (diff)
* printing -v info to stderr
-rwxr-xr-xelo.py2
-rw-r--r--f1elo/interface.py13
2 files changed, 9 insertions, 6 deletions
diff --git a/elo.py b/elo.py
index 4fac540..7f88113 100755
--- a/elo.py
+++ b/elo.py
@@ -19,7 +19,7 @@ parser.add_argument('--date',
'reset ratings all the way down to DATE\n'
'or rank the races all the way up to DATE.')
parser.add_argument('--limit', help='Ranking list (display) cut-off point.', type=int)
-parser.add_argument('-v', help='Display verbose info on rating progress.', action='store_true')
+parser.add_argument('-v', help='Display verbose info on rating progress to STDERR.', action='store_true')
parser.add_argument('--force', '-f', help='Force database initialization (for "init" command).', action='store_true')
arguments = parser.parse_args()
diff --git a/f1elo/interface.py b/f1elo/interface.py
index 4b938ae..a077986 100644
--- a/f1elo/interface.py
+++ b/f1elo/interface.py
@@ -1,5 +1,8 @@
+from __future__ import print_function
+
import datetime
import dateutil.relativedelta
+import sys
from sqlalchemy import MetaData
@@ -28,7 +31,7 @@ class Interface:
for race in query.all():
race.ranked = False
if _debug:
- print race
+ print(race, file=sys.stderr)
query = self.session.query(Ranking)
if date is not None:
@@ -56,8 +59,8 @@ class Interface:
for race in races:
if _debug:
- print race
- print
+ print(race, file=sys.stderr)
+ print('', file=sys.stderr)
ranks = elo.rank_race(race)
driver_ranks = {}
@@ -76,8 +79,8 @@ class Interface:
if _debug:
for entry in race.entries:
- print entry, elo.get_entry_ranking(entry, race.date), elo.get_entry_ranking(entry)
- print
+ print(entry, elo.get_entry_ranking(entry, race.date), elo.get_entry_ranking(entry), file=sys.stderr)
+ print('', file=sys.stderr)
race.ranked = True
date = race.date