Provide __str__ method for Topic and Link

When doing an #undo operation have the message be more helpful.

Before it would do an output like:
  Removing item from minutes: <ircmeeting.items.Link object at
  0x7fbb93c8f550>

Now it will output something like:
  Removing item from minutes: #link http://www.openstack.org/

Change-Id: I925ef47798eb9a86dc3dd35bb4e3601b4b70a08b
This commit is contained in:
John L. Villalovos 2016-11-29 11:55:52 -08:00
parent f56a92a74a
commit d628b590f2
1 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,8 @@ class Topic(_BaseItem):
def mw(self, M):
repl = self.get_replacements(M, escapewith=writers.mw)
return self.mw_template%repl
def __str__(self):
return "#topic %s" % self.topic
class GenericItem(_BaseItem):
itemtype = ''
@ -290,5 +292,7 @@ class Link(_BaseItem):
def mw(self, M):
repl = self.get_replacements(M, escapewith=writers.mw)
return self.mw_template%repl
def __str__(self):
return "#link %s" % self.url
class Vote(GenericItem):
itemtype = 'VOTE'