'implement the door functionality'

def func(self):

    if (not self.args):
        self.caller.msg('Usage:    open||close    <door>')
        return
    door = self.caller.search(self.args)
    if (not door):
        return
    if (not inherits_from(door, SimpleDoor)):
        self.caller.msg('This    is    not    a    door.')
        return
    if (self.cmdstring == 'open'):
        if door.locks.check(self.caller, 'traverse'):
            self.caller.msg(('%s    is    already    open.' % door.key))
        else:
            door.setlock('traverse:true()')
            self.caller.msg(('You    open    %s.' % door.key))
    elif (not door.locks.check(self.caller, 'traverse')):
        self.caller.msg(('%s    is    already    closed.' % door.key))
    else:
        door.setlock('traverse:false()')
        self.caller.msg(('You    close    %s.' % door.key))
