summaryrefslogtreecommitdiff
path: root/bvg-grabber.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2013-06-15 09:54:46 +0200
committerJannis Leidel <jannis@leidel.info>2013-06-15 09:54:46 +0200
commit7ec90f6b730688f072ec3254987e86c33ec350f0 (patch)
treee6877a171aa494ed65c4107c1527620bf9306d71 /bvg-grabber.py
parentcc784751a46441a707c72b72293ee6aa9da143b1 (diff)
downloadbvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.tar.gz
bvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.tar.bz2
bvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.zip
Accept '-' as an output option additional to 'stdout'.
Diffstat (limited to 'bvg-grabber.py')
-rwxr-xr-xbvg-grabber.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/bvg-grabber.py b/bvg-grabber.py
index 318aded..fcaf318 100755
--- a/bvg-grabber.py
+++ b/bvg-grabber.py
@@ -56,10 +56,9 @@ if __name__ == '__main__':
query = ActualDepartureQueryApi(args.station)
res = query.call()
- if args.file == 'stdout':
+ if args.file in ('stdout', '-'):
print(res.to_json, file=sys.stdout)
else:
file = open(args.file, 'w')
print(res.to_json, file=file)
file.close()
-