* src/plugins/IndivComplete.py: fix source citations (0000867)

* src/ReportBase.py: fix source citations (0000867)

svn: r8020
This commit is contained in:
Brian Matherly
2007-01-31 03:16:11 +00:00
parent eaf86944e8
commit e36c9fc6d4
3 changed files with 69 additions and 37 deletions

View File

@@ -33,6 +33,7 @@ A collection of utilities to aid in the generation of reports.
import time
import os
from gettext import gettext as _
import cStringIO
#------------------------------------------------------------------------
#
@@ -2314,3 +2315,31 @@ def get_address_str(addr):
str = "%s, %s" % (str,info)
return str
def get_endnotes(sref_map,obj):
if not obj:
return ""
slist = obj.get_source_references()
if not slist:
return ""
msg = cStringIO.StringIO()
first = 1
for ref in slist:
if not first:
msg.write(',')
first = 0
ref_base = ref.get_reference_handle()
the_key = 0
for key in sref_map.keys():
if ref_base == sref_map[key].get_reference_handle():
the_key = key
break
if not the_key:
the_key = len(sref_map) + 1
sref_map[the_key] = ref
msg.write("%d" % the_key)
str = msg.getvalue()
msg.close()
return str