Skip to content

Commit

Permalink
Merge pull request #64 from nineinchnick/isinstance
Browse files Browse the repository at this point in the history
use isinstance to allow inheritance
  • Loading branch information
izar authored Feb 11, 2020
2 parents 4980f55 + 44c6b89 commit 3d7bcbf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytm/pytm.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ def dfd(self):
b.dfd()
for e in TM._BagOfElements:
# Boundaries draw themselves
if type(e) != Boundary and e.inBoundary is None:
if not isinstance(e, Boundary) and e.inBoundary is None:
e.dfd()
print("}")

def seq(self):
print("@startuml")
for e in TM._BagOfElements:
if type(e) is Actor:
if isinstance(e, Actor):
print("actor {0} as \"{1}\"".format(_uniq_name(e.name, e.uuid), e.name))
elif type(e) is Datastore:
elif isinstance(e, Datastore):
print("database {0} as \"{1}\"".format(_uniq_name(e.name, e.uuid), e.name))
elif type(e) is not Dataflow and type(e) is not Boundary:
elif not isinstance(e, Dataflow) and isinstance(e, Boundary):
print("entity {0} as \"{1}\"".format(_uniq_name(e.name, e.uuid), e.name))

ordered = sorted(TM._BagOfFlows, key=lambda flow: flow.order)
Expand Down

0 comments on commit 3d7bcbf

Please sign in to comment.