Example #1
0
 def reset(self, propagate=1, level=0):
     """ reset the channel structure """
     modesupport.reset(self, propagate, level)
     self.users = casedict()
     self.topic = ""
     self.bans = casedict() 
     self.invite = casedict()
     self.excempt = casedict()
     self.limit = 0 # no limit
     self.key = "" # no key
     if level > 0:
         self.state = channel.STATE_INACTIVE
Example #2
0
    def reset(self, propagate=1, level=1):
        """ 
            reset the server datastructure.

            depending on propagate/level, substructures (i.e. channels)
            are also reset, or completely removed.

            This method does not alter self.state - an explicit extra call
            to setState is required for this.

            Levels:

            0           clear all structures
            1           mark object as INACTIVE / DISCONNECTED / whatever
        """
        modesupport.reset(self, propagate, level)
        if propagate:
            for i in self.channels.values() + self.users.values():
                i.reset(propagate, level)
        self.notifies.reset(propagate, level)
        if level > 0:
            self.setState(server.STATE_NOTCONNECTED)