OOP is for maintaining the state of something. OOP is for some object that has both properties and methods to manipulate those properties.
class Chair(object):
MAX_WEIGHT = 300
def __init__(self):
super().__init__()
self.weight = 5
self.currentWeight = self.weight
self.holding = None
self.broken = False
def hold(self, item):
self.holding = item
self.currentWeight = self.weight + item.weight
self.checkWeight()
def checkWeight(self):
if self.holding.weight > self.MAX_WEIGHT:
self.broken = True
...
Your code seems fine; rewriting the code just for OOP may be more work than it's worth. If you really want to use OOP you may wish to do something like below.
class Table(object):
def __init__(self):
self.chain = None
self.rule = None
self.match = None
def setInput(self):
self.chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), 'INPUT')
def setOutput(self):
self.chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), 'OUTPUT')
...
table = Table()
table.setInput()
...