mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-18 08:35:19 +00:00
Bounds: Refactor to move all initialization to the factory method.
This commit is contained in:
parent
790140acdb
commit
f33da33190
@ -39,17 +39,15 @@ cdef class Bounds(PolicySymbol):
|
||||
readonly object child
|
||||
|
||||
@staticmethod
|
||||
cdef factory(SELinuxPolicy policy, parent, child):
|
||||
cdef inline Bounds factory(SELinuxPolicy policy, parent, child):
|
||||
"""Factory function for creating Bounds objects."""
|
||||
b = Bounds(parent, child)
|
||||
cdef Bounds b = Bounds.__new__(Bounds)
|
||||
b.policy = policy
|
||||
b.ruletype = BoundsRuletype.typebounds
|
||||
b.parent = parent
|
||||
b.child = child
|
||||
return b
|
||||
|
||||
def __cinit__(self, parent, child):
|
||||
self.ruletype = BoundsRuletype.typebounds
|
||||
self.parent = parent
|
||||
self.child = child
|
||||
|
||||
def __str__(self):
|
||||
return "{0.ruletype} {0.parent} {0.child};".format(self)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user