diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-05-07 09:07:26 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-05-07 10:41:56 +0200 |
commit | d3459b44bc732527578a8da15f15460d5a67608e (patch) | |
tree | fcf6f43d4e2b169bed4934f3e298ca6c84a43de2 /examples | |
parent | 51ceb537e0bef66ecac1de1a7792c730486a74b7 (diff) |
examples: Mark canceled trips
Diffstat (limited to 'examples')
-rw-r--r-- | examples/trip-query.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |