use SimpleTable

svn: r12493
This commit is contained in:
Jérôme Rapinat 2009-04-28 10:54:04 +00:00
parent d3b2a2ab27
commit d0b0a5314d

View File

@ -20,9 +20,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
#
# $Id$
#
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# #
@ -34,7 +31,7 @@
Display RepoRef for sources related to active repository Display RepoRef for sources related to active repository
""" """
from Simple import SimpleDoc from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _ from gettext import gettext as _
from gen.plug import PluginManager from gen.plug import PluginManager
from ReportBase import CATEGORY_QR_REPOSITORY from ReportBase import CATEGORY_QR_REPOSITORY
@ -44,7 +41,11 @@ def run(database, document, repo):
Display back-references (sources) for this repository. Display back-references (sources) for this repository.
""" """
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document) sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
# First we find repository and add its text # First we find repository and add its text
@ -70,10 +71,10 @@ def run(database, document, repo):
media = str(reporef.get_media_type()) media = str(reporef.get_media_type())
call = reporef.get_call_number() call = reporef.get_call_number()
sdoc.paragraph('%s, %s' % (media, call))
sdoc.paragraph('%s\n' % src.get_title()) stab.columns(_("Source"), _("Type of media"), _("Call number"))
else: stab.row(src.get_title(), media, call)
continue stab.write(sdoc)
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------