def __init__(self): WordsRealm.__init__(self, 's') ## 's' is what real peerchat uses (prly to save bandwidth) ## clean up channels from dirty exit for chan in Channel.objects.all(): chan.users.clear() if chan.name.startswith('GSP'): chan.delete()
def getGroup(self, name): def ebGroup(err): ## supermethod only handles ewords.DuplicateGroup exceptions ## this will trap if user tried to make chan not starting with 'GSP' err.trap(Exception) ##TODO: make nopermstocreate exc return self.lookupGroup(name) return WordsRealm.getGroup(self, name).addErrback(ebGroup)