GEPS008: Re-structure Simple access and Quick Reports

svn: r19732
This commit is contained in:
Nick Hall
2012-05-31 23:46:57 +00:00
parent eba22c4062
commit 65d707d649
47 changed files with 847 additions and 728 deletions

View File

@@ -27,7 +27,8 @@
Display references for any object
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from Utils import probably_alive
from gen.ggettext import gettext as _
import gen.datehandler
@@ -41,7 +42,7 @@ def run(database, document, date):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
if not date.get_valid():
sdoc.paragraph("Date is not a valid date.")
return

View File

@@ -22,13 +22,14 @@
#
#
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
def run(database, document, attribute, value=None):
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
sdoc.title(_("People who have the '%s' Attribute") % attribute)
sdoc.paragraph("")
stab.columns(_("Person"), str(attribute))

View File

@@ -27,9 +27,10 @@
Display filtered data
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from Utils import media_path_full
from QuickReports import run_quick_report_by_name_direct
from gui.plug.quick import run_quick_report_by_name_direct
from gen.lib import Person
import gen.datehandler
@@ -81,7 +82,7 @@ def run(database, document, filter_name, *args, **kwargs):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
if (filter_name == 'all'):
sdoc.title(_("Summary counts of current selection"))
sdoc.paragraph("")

View File

@@ -25,7 +25,8 @@
Display link references for a note
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.lib import StyledTextTagType
from gen.ggettext import gettext as _
@@ -37,7 +38,7 @@ def run(database, document, obj):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
# display the title
sdoc.title(_("Link References for this note"))

View File

@@ -26,7 +26,8 @@
Display all events on a particular day.
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc, SimpleTable
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
import gen.lib
@@ -66,11 +67,11 @@ def run(database, document, main_event):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
stab.set_link_col(3)
yeartab = SimpleTable(sdb)
yeartab = QuickTable(sdb)
yeartab.set_link_col(3)
histab = SimpleTable(sdb)
histab = QuickTable(sdb)
histab.set_link_col(3)
# display the title

View File

@@ -27,7 +27,8 @@
Display references for any object
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
def get_ref(db, objclass, handle):
@@ -62,7 +63,7 @@ def run(database, document, object, item, trans):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
# display the title
sdoc.title(_("References for this %s") % trans)

View File

@@ -34,7 +34,8 @@
Display RepoRef for sources related to active repository
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
def run(database, document, repo):
@@ -46,7 +47,7 @@ def run(database, document, repo):
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
# First we find repository and add its text

View File

@@ -27,7 +27,8 @@
Display a people who have a person's same surname or given name.
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
from gen.ggettext import ngettext
import gen.lib
@@ -95,7 +96,7 @@ def run(database, document, person):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
if isinstance(person, gen.lib.Person):
surname = sdb.surname(person)
rsurname = person.get_primary_name().get_group_name()
@@ -137,7 +138,7 @@ def run_given(database, document, person):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
if isinstance(person, gen.lib.Person):
rgivenname = person.get_primary_name().get_first_name()
else:

View File

@@ -26,7 +26,8 @@
Display a person's events, both personal and family
"""
from Simple import SimpleAccess, by_date, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, by_date, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
def run(database, document, person):
@@ -38,7 +39,7 @@ def run(database, document, person):
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
# get the personal events
event_list = sdb.events(person)
@@ -74,7 +75,7 @@ def run_fam(database, document, family):
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
# get the family events
event_list = [(_('Family'), x) for x in sdb.events(family)]
@@ -112,7 +113,7 @@ def run_fam(database, document, family):
document.has_data = True
stab.write(sdoc)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
sdoc.header1(_("Personal events of the children"))
stab.columns(_("Family Member"), _("Event Type"),
_("Event Date"), _("Event Place"))

View File

@@ -31,7 +31,7 @@ Display a person's relations to the home person
#
#-------------------------------------------------------------------------
from Simple import SimpleAccess, SimpleDoc
from gen.simple import SimpleAccess, SimpleDoc
from gen.ggettext import gettext as _
import Relationship

View File

@@ -33,7 +33,8 @@ Display a person's father or mother lineage
#-------------------------------------------------------------------------
import gen.lib
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.ggettext import gettext as _
__FMT = "%-30s\t%-12s\t%-12s"
@@ -57,7 +58,7 @@ def run_father(database, document, person):
" People in this lineage all share the same Y-chromosome."
))
sd.paragraph("")
stab = SimpleTable(sa)
stab = QuickTable(sa)
stab.columns(_("Name Father"), _("Birth Date"), _("Death Date"), _("Remark"))
make_details(gen.lib.Person.MALE, person, sa, sd, database, stab)
stab.write(sd)
@@ -89,7 +90,7 @@ def run_mother(database, document, person):
))
sd.paragraph("")
stab = SimpleTable(sa)
stab = QuickTable(sa)
stab.columns(_("Name Mother"), _("Birth"), _("Death Date"), _("Remark"))
make_details(gen.lib.Person.FEMALE, person, sa, sd, database, stab)
stab.write(sd)

View File

@@ -26,7 +26,8 @@
Display a person's siblings in a report window
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
import Relationship
from gen.ggettext import gettext as _
@@ -38,7 +39,7 @@ def run(database, document, person):
# setup the simple access functions
sdb = SimpleAccess(database)
sdoc = SimpleDoc(document)
stab = SimpleTable(sdb)
stab = QuickTable(sdb)
rel_class = Relationship.get_relationship_calculator()
# display the title