origin, origin_type = origin_tuple
destination, destination_type = destination_tuple
- if not origin_type in POSITION_TYPES or\
- not destination_type in POSITION_TYPES:
+
+ if origin_type is None:
+ origin_type = 'stop'
+
+ if destination_type is None:
+ destination_type = 'stop'
+
+ if (origin_type not in POSITION_TYPES or
+ destination_type not in POSITION_TYPES):
raise ParserError('Invalid position type')
post = defaults.search_post
from gotovienna.routing import *
parser = argparse.ArgumentParser(description='Get public transport route for Vienna')
-parser.add_argument('-ot', metavar='type', type=str, help='origin type: %s' % ' | '.join(POSITION_TYPES), default='stop', choices=POSITION_TYPES)
-parser.add_argument('-dt', metavar='type', type=str, help='destination type: %s' % ' | '.join(POSITION_TYPES), default='stop', choices=POSITION_TYPES)
+parser.add_argument('-ot', metavar='type', type=str, help='origin type: %s' % ' | '.join(POSITION_TYPES), default=None, choices=POSITION_TYPES)
+parser.add_argument('-dt', metavar='type', type=str, help='destination type: %s' % ' | '.join(POSITION_TYPES), default=None, choices=POSITION_TYPES)
parser.add_argument('origin', nargs='?', help='origin station name')
parser.add_argument('destination', nargs='?', help='destination station name')