avoiding connection types shoud avoid, but not forbid them.

This commit is contained in:
Laura Klünder 2016-12-21 03:21:31 +01:00
parent 10e331bf43
commit 4536245570
5 changed files with 23 additions and 3 deletions

View file

@ -14,6 +14,8 @@ class Route:
self.from_point = connections[0].from_point
self.to_point = connections[-1].to_point
self.ctypes_exception = None
self.routeparts = None
def __repr__(self):
@ -210,6 +212,14 @@ class Route:
if last_line.icon == 'location':
last_line.ignore = True
def check_allowed_ctypes(self, allowed_ctypes):
allowed_ctypes = set(allowed_ctypes)
self.ctypes_exception = False
for connection in self.connections:
if connection.ctype not in allowed_ctypes:
self.ctypes_exception = True
return
class RoutePart:
def __init__(self, graphlevel, lines):