From d3459b44bc732527578a8da15f15460d5a67608e Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 7 May 2015 09:07:26 +0200 Subject: examples: Mark canceled trips --- examples/trip-query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/trip-query.py b/examples/trip-query.py index d848f5e..41b5f68 100644 --- a/examples/trip-query.py +++ b/examples/trip-query.py @@ -61,7 +61,8 @@ def format_full(trips): for trip in trips: i += 1 j = 0 - print ('Trip #%d' % i) + msg = ' - CANCELED' if trip.props.status == Lpf.TripStatusFlags.CANCELED else '' + print ('Trip #%d%s' % (i, msg)) for part in trip.props.parts: j += 1 print(' Part #%d' % j) @@ -91,7 +92,8 @@ def format_terse(trips): i = 0 for trip in trips: i += 1 - print ('Trip #%d' % i) + msg = ' - CANCELED' if trip.props.status == Lpf.TripStatusFlags.CANCELED else '' + print ('Trip #%d%s' % (i, msg)) start = trip.props.parts[0].props.start end = trip.props.parts[-1].props.end print(" Start: %s" % start.props.name) -- cgit v1.2.3