Clean up AncestorTree report.
svn: r11796
This commit is contained in:
@@ -41,8 +41,8 @@ from gen.plug import PluginManager
|
||||
from gen.plug.menu import BooleanOption, NumberOption, TextOption, PersonOption
|
||||
from ReportBase import Report, ReportUtils, CATEGORY_DRAW, MenuReportOptions
|
||||
from BasicUtils import name_displayer
|
||||
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
cm2pt = ReportUtils.cm2pt
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -58,6 +58,9 @@ _DIED = _('short for died|d.')
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def log2(val):
|
||||
"""
|
||||
Calculate the log base 2 of a value.
|
||||
"""
|
||||
return int(math.log10(val)/math.log10(2))
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -137,7 +140,7 @@ class GenChart:
|
||||
x = 0
|
||||
for entry in i:
|
||||
new_map[entry] = (new_y, x)
|
||||
x =+ 1
|
||||
x += 1
|
||||
new_y += 1
|
||||
self.array = new_array
|
||||
self.map = new_map
|
||||
@@ -332,7 +335,8 @@ class AncestorTree(Report):
|
||||
self.delta = pt2cm(self.box_pad_pts) + self.box_width + 0.2
|
||||
if not self.force_fit:
|
||||
calc_width = self.box_width + 0.2 + pt2cm(self.box_pad_pts)
|
||||
remain = self.doc.get_usable_width() - ((self.generations_per_page)*calc_width)
|
||||
remain = self.doc.get_usable_width() - \
|
||||
((self.generations_per_page)*calc_width)
|
||||
self.delta += remain / (self.generations_per_page)
|
||||
|
||||
def scale_styles(self):
|
||||
@@ -363,12 +367,15 @@ class AncestorTree(Report):
|
||||
if self.genchart.get_xy(x, y) != 0:
|
||||
blank = False
|
||||
break
|
||||
if not blank: break
|
||||
if blank: return
|
||||
if not blank:
|
||||
break
|
||||
if blank:
|
||||
return
|
||||
|
||||
self.doc.start_page()
|
||||
if self.title and self.force_fit:
|
||||
self.doc.center_text('AC2-title',self.title,self.doc.get_usable_width()/2,0)
|
||||
self.doc.center_text('AC2-title', self.title,
|
||||
self.doc.get_usable_width() / 2, 0)
|
||||
phys_y = 0
|
||||
for y in range(starty, stopy):
|
||||
phys_x = 0
|
||||
|
||||
Reference in New Issue
Block a user