Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/writers.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-01 03:30:31 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-01 03:30:31 (GMT)
commit8b87980586c4dfa331452e35c8196e191af098df (patch)
treec0d6daf03590e2328d91f04264c9eea04ae610e7 /writers.py
parentc2c99deb617d9d1940cb2bf7b9fb6d0c84a8309f (diff)
change to not use isinstance() in determing types
- reload() of modules messed this up greatly, in certain cases. Modules get re-executed when you reload(), which causes the classes to be redefined, meaning that the classes stored in the Meeting object are *not* any longer subclasses of items.* - With the other fixes I did, this was only going to be a problem if supybot reloaded the MeetBot module during a meeting, however, it's best to plan for that anyway. - I switch to comparing m.itemtype to a string value. Not as elegant, but works for now. darcs-hash:20090701033031-82ea9-cf69f235e06d70dd70265f5c5481e4c8262ec971.gz
Diffstat (limited to 'writers.py')
-rw-r--r--writers.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/writers.py b/writers.py
index 98dd8b3..d237c07 100644
--- a/writers.py
+++ b/writers.py
@@ -97,7 +97,7 @@ class HTML(object):
import meeting
for m in M.minutes:
# The hack below is needed because of pickling problems
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
data.append(" <li>%s</li>"%m.line) #already escaped
data.append("</ol>\n\n<br>")
@@ -108,7 +108,7 @@ class HTML(object):
headerPrinted = False
for m in M.minutes:
# The hack below is needed because of pickling problems
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
if m.line.find(nick) == -1: continue
if not headerPrinted:
data.append(" <li> %s <ol>"%nick)
@@ -121,7 +121,7 @@ class HTML(object):
data.append(" <li><b>UNASSIGNED</b><ol>")
numberUnassigned = 0
for m in M.minutes:
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
if getattr(m, 'assigned', False): continue
data.append(" <li>%s</li>"%m.line) # already escaped
numberUnassigned += 1
@@ -177,7 +177,7 @@ class RST(object):
haveTopic = None
for m in M.minutes:
item = "* "+m.rst(M)
- if isinstance(m, items.Topic):
+ if m.itemtype == "TOPIC":
item = wrapList(item, 0)
haveTopic = True
else:
@@ -193,7 +193,7 @@ class RST(object):
ActionItems = [ ]
for m in M.minutes:
# The hack below is needed because of pickling problems
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
#already escaped
ActionItems.append(wrapList("* %s"%m.line, indent=0))
ActionItems = "\n\n".join(ActionItems)
@@ -204,7 +204,7 @@ class RST(object):
headerPrinted = False
for m in M.minutes:
# The hack below is needed because of pickling problems
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
if m.line.find(nick) == -1: continue
if not headerPrinted:
ActionItemsPerson.append("* %s"%nick)
@@ -218,7 +218,7 @@ class RST(object):
ActionItemsPerson.append("* **UNASSIGNED**")
numberUnassigned = 0
for m in M.minutes:
- if not isinstance(m, items.Action): continue
+ if m.itemtype != "ACTION": continue
if getattr(m, 'assigned', False): continue
# already escaped
ActionItemsPerson.append(wrapList("* %s"%m.line, 2))