| 2 | from index_utils import * |
| 3 | |
| 4 | class Constraint(): |
| 5 | def __init__(self, ct, et, lbl, attrs, status): |
| 6 | self.s = status |
| 7 | self.ct = ct |
| 8 | self.et = et |
| 9 | self.lbl = lbl |
| 10 | self.attrs = attrs |
| 11 | |
| 12 | def __eq__(self, other): |
| 13 | return (self.lbl == other.lbl and |
| 14 | self.s == other.s and |
| 15 | self.et == other.et and |
| 16 | self.attrs == other.attrs and |
| 17 | self.ct == other.ct) |
| 18 | |
| 19 | @property |
| 20 | def label(self): |
| 21 | return self.lbl |
| 22 | |
| 23 | @property |
| 24 | def status(self): |
| 25 | return self.s |
| 26 | |
| 27 | @property |
| 28 | def entity_type(self): |
| 29 | return self.et |
| 30 | |
| 31 | @property |
| 32 | def attributes(self): |
| 33 | return self.attrs |
| 34 | |
| 35 | @property |
| 36 | def type(self): |
| 37 | return self.ct |
| 38 | |
| 39 | def get_constraint(g, ct_type, entity_type, lbl, *props): |
| 40 | props_filter = "properties = [" + ",".join(["'" + p + "'" for p in props]) + "]" |
no outgoing calls
no test coverage detected