avoiding connection types shoud avoid, but not forbid them.
This commit is contained in:
parent
10e331bf43
commit
4536245570
5 changed files with 23 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue