source file: p10/commands/create.py
file stats: 11 lines, 11 executed: 100.0% covered
   1. #!/usr/bin/env python
   2. 
   3. import genericcommand
   4. 
   5. class create(genericcommand.genericcommand):
   6.     """ Handles channel create commands """
   7. 
   8.     def handle(self, origin, args):
   9.         for channel in args[0].split(','):
  10.             # If we return false, we propogate this as a join and bounce a deop
  11.             self._state.lock.acquire()
  12.             try:
  13.                 if not self._state.createChannel(origin, channel, args[1]):
  14.                     self._state.joinChannel(origin, origin, channel, ["o"])
  15.                     self._state.deop((self._state.getServerID, None), channel, origin)
  16.             finally:
  17.                 self._state.lock.release()