From 4c650a44a64f5b3e786a97da184c810eba27550c Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 18 Oct 2013 21:01:53 +0200 Subject: [PATCH] Fixed up some channel-related errors and made unittests run again. --- src/commands/default/comms.py | 6 +++--- src/commands/default/tests.py | 3 +-- src/comms/models.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/commands/default/comms.py b/src/commands/default/comms.py index 43f719c98b..ac5adf3941 100644 --- a/src/commands/default/comms.py +++ b/src/commands/default/comms.py @@ -254,13 +254,13 @@ class CmdChannels(MuxPlayerCommand): # all channels we have available to listen to channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')] - print channels + #print channels if not channels: self.msg("No channels available.") return # all channel we are already subscribed to subs = [conn.channel for conn in PlayerChannelConnection.objects.get_all_player_connections(caller)] - print subs + #print subs if self.cmdstring == "comlist": # just display the subscribed channels with no extra info @@ -320,7 +320,7 @@ class CmdCdestroy(MuxPlayerCommand): channel.msg(msgobj) channel.delete() CHANNELHANDLER.update() - self.msg("%s was destroyed." % channel) + self.msg("Channel '%s' was destroyed." % channel) class CmdCBoot(MuxPlayerCommand): """ diff --git a/src/commands/default/tests.py b/src/commands/default/tests.py index 22d4fa7e54..5a1dcb89c6 100644 --- a/src/commands/default/tests.py +++ b/src/commands/default/tests.py @@ -134,7 +134,6 @@ class CommandTest(TestCase): retval = sep1 + msg.strip() + sep2 + returned_msg + sep3 raise AssertionError(retval) - #------------------------------------------------------------ # Individual module Tests #------------------------------------------------------------ @@ -253,7 +252,7 @@ class TestComms(CommandTest): self.call(comms.CmdCWho(), "testchan", "Channel subscriptions\ntestchan:\n TestPlayer7") self.call(comms.CmdPage(), "TestPlayer7b = Test", "You paged TestPlayer7b with: 'Test'.") self.call(comms.CmdCBoot(), "", "Usage: @cboot[/quiet] = [:reason]") # noone else connected to boot - self.call(comms.CmdCdestroy(), "testchan" ,"Channel 'testchan' (Test Channel) was destroyed.") + self.call(comms.CmdCdestroy(), "testchan" ,"Channel 'testchan' was destroyed.") from src.commands.default import batchprocess class TestBatchProcess(CommandTest): diff --git a/src/comms/models.py b/src/comms/models.py index 0ef8f5776c..0a83c6bcae 100644 --- a/src/comms/models.py +++ b/src/comms/models.py @@ -136,7 +136,6 @@ class Msg(SharedMemoryModel): elif typ == 'external': self.db_sender_external = "1" self.extra_senders.append(obj) - print "I ran!" elif isinstance(typ, basestring): self.db_sender_external = obj elif not obj: @@ -599,7 +598,7 @@ class ExternalChannelConnection(SharedMemoryModel): # make sure we are not echoing back our own message to ourselves # (this would result in a nasty infinite loop) - print senders + #print senders if self in make_iter(senders):#.external_key: return