Patch from Raphael Ackermann <raphael.ackermann@gmail.com> -- Fix 0001538: tabs and spaces are mixed in some source files

svn: r9713
This commit is contained in:
Brian Matherly
2008-01-05 20:10:26 +00:00
parent aa8288eddd
commit bf3900f043
57 changed files with 499 additions and 440 deletions
+1 -1
View File
@@ -376,7 +376,7 @@ class DescendChart(Report):
self.doc.draw_line('DC2-line', xlast, ystop, xnext, ystop)
if x%2:
phys_x +=1
phys_x +=1
phys_y += 1
if not self.force_fit:
+2 -2
View File
@@ -473,7 +473,7 @@ class FamilyGroup(Report):
spouse_id = family.get_mother_handle()
else:
spouse_id = family.get_father_handle()
if spouse_id:
self.doc.start_row()
if m or index != families:
@@ -528,7 +528,7 @@ class FamilyGroup(Report):
mark = BaseDoc.IndexMark(title,BaseDoc.INDEX_TYPE_TOC,1)
self.doc.write_text( title, mark )
self.doc.end_paragraph()
family = self.database.get_family_from_handle(family_handle)
self.dump_parent(_("Husband"),family.get_father_handle())
+9 -9
View File
@@ -179,11 +179,11 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
_("No matches found"),
_("No potential duplicate people were found"))
else:
try:
ShowMatches(self.dbstate,self.uistate,self.track,
self.list,self.map,self.update)
except Errors.WindowActiveError:
pass
try:
ShowMatches(self.dbstate,self.uistate,self.track,
self.list,self.map,self.update)
except Errors.WindowActiveError:
pass
def find_potentials(self,thresh):
self.progress = Utils.ProgressMeter(_('Find duplicates'),
@@ -336,12 +336,12 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
f2 = self.db.get_family_from_handle(f2_id)
dad1_id = f1.get_father_handle()
if dad1_id:
dad1 = get_name_obj(self.db.get_person_from_handle(dad1_id))
dad1 = get_name_obj(self.db.get_person_from_handle(dad1_id))
else:
dad1 = None
dad2_id = f2.get_father_handle()
if dad2_id:
dad2 = get_name_obj(self.db.get_person_from_handle(dad2_id))
dad2 = get_name_obj(self.db.get_person_from_handle(dad2_id))
else:
dad2 = None
@@ -354,12 +354,12 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
mom1_id = f1.get_mother_handle()
if mom1_id:
mom1 = get_name_obj(self.db.get_person_from_handle(mom1_id))
mom1 = get_name_obj(self.db.get_person_from_handle(mom1_id))
else:
mom1 = None
mom2_id = f2.get_mother_handle()
if mom2_id:
mom2 = get_name_obj(self.db.get_person_from_handle(mom2_id))
mom2 = get_name_obj(self.db.get_person_from_handle(mom2_id))
else:
mom2 = None
+3 -2
View File
@@ -275,9 +275,9 @@ class RelGraphReport(Report):
color = self.colors['unknown']
elif self.colorize == 'filled':
if style != "":
style += ",filled"
style += ",filled"
else:
style = "filled"
style = "filled"
if gender == person.MALE:
fill = self.colors['male']
elif gender == person.FEMALE:
@@ -512,3 +512,4 @@ register_report(
author_email ="brian@gramps-project.org"
)
+2 -2
View File
@@ -462,8 +462,8 @@ class MarkerOptions(ReportOptions):
nextint = self.max_non_custom+1
custommarkers = dialog.db.get_marker_types()
for item in custommarkers:
int_to_string_map[nextint] = item
nextint += 1
int_to_string_map[nextint] = item
nextint += 1
marker_index = 0
for int, str in int_to_string_map.items() :
+5 -5
View File
@@ -232,9 +232,9 @@ class BasePage:
return of
def link_path(self,name,path):
path = "%s/%s/%s" % (path,name[0].lower(),name[1].lower())
path = self.build_name(path,name)
return path
path = "%s/%s/%s" % (path,name[0].lower(),name[1].lower())
path = self.build_name(path,name)
return path
def create_link_file(self,name,path):
self.cur_name = self.link_path(name,path)
@@ -1708,8 +1708,8 @@ class IndividualPage(BasePage):
family = self.db.get_family_from_handle(handle)
media_list += family.get_media_list()
for evt_ref in family.get_event_ref_list():
event = self.db.get_event_from_handle(evt_ref.ref)
media_list += event.get_media_list()
event = self.db.get_event_from_handle(evt_ref.ref)
media_list += event.get_media_list()
for evt_ref in self.person.get_primary_event_ref_list():
event = self.db.get_event_from_handle(evt_ref.ref)
if event:
+1 -1
View File
@@ -267,7 +267,7 @@ class PHPGedViewConnector:
result.append(line.strip())
line = f.readline()
if len(result) > 0:
return result
return result
return None
+26 -26
View File
@@ -211,7 +211,7 @@ class Extract:
if place_handle:
place = self.db.get_place_from_handle(place_handle).get_title()
if place:
places.append(place)
places.append(place)
else:
places.append(_("Place missing"))
return places
@@ -503,15 +503,15 @@ class StatisticsChart(Report):
'year_from': year_from,
'year_to': year_to
}
self.progress = ProgressMeter(_('Statistics Charts'))
self.progress = ProgressMeter(_('Statistics Charts'))
# extract requested items from the database and count them
self.progress.set_pass(_('Collecting data...'), 1)
self.progress.set_pass(_('Collecting data...'), 1)
tables = _Extract.collect_data(database, filterfun, options,
gender, year_from, year_to, options['no_years'])
self.progress.step()
self.progress.step()
self.progress.set_pass(_('Sorting data...'), len(tables))
self.progress.set_pass(_('Sorting data...'), len(tables))
self.data = []
sortby = options['sortby']
reverse = options['reverse']
@@ -525,8 +525,8 @@ class StatisticsChart(Report):
else:
heading = _("Persons born %(year_from)04d-%(year_to)04d: %(chart_title)s") % mapping
self.data.append((heading, table[0], table[1], lookup))
self.progress.step()
#DEBUG
self.progress.step()
#DEBUG
#print heading
#print table[1]
@@ -558,7 +558,7 @@ class StatisticsChart(Report):
def write_report(self):
"output the selected statistics..."
self.progress.set_pass(_('Saving charts...'), len(self.data))
self.progress.set_pass(_('Saving charts...'), len(self.data))
for data in self.data:
self.doc.start_page()
if len(data[2]) < self.bar_items:
@@ -566,8 +566,8 @@ class StatisticsChart(Report):
else:
self.output_barchart(data[0], data[1], data[2], data[3])
self.doc.end_page()
self.progress.step()
self.progress.close()
self.progress.step()
self.progress.close()
def output_piechart(self, title, typename, data, lookup):
@@ -591,17 +591,17 @@ class StatisticsChart(Report):
chart_data.append((style, data[key], text))
color = (color+1) % 7 # There are only 7 color styles defined
margin = 1.0
legendx = 2.0
margin = 1.0
legendx = 2.0
# output data...
radius = middle - 2*margin
yoffset = yoffset + margin + radius
ReportUtils.draw_pie_chart(self.doc, middle, yoffset, radius, chart_data, -90)
yoffset = yoffset + radius + margin
text = _("%s (persons):") % typename
ReportUtils.draw_legend(self.doc, legendx, yoffset, chart_data, text,'SC-legend')
text = _("%s (persons):") % typename
ReportUtils.draw_legend(self.doc, legendx, yoffset, chart_data, text,'SC-legend')
def output_barchart(self, title, typename, data, lookup):
@@ -622,10 +622,10 @@ class StatisticsChart(Report):
for key in lookup:
max_value = max(data[key], max_value)
# horizontal area for the gfx bars
margin = 1.0
middle = width/2.0
textx = middle + margin/2.0
stopx = middle - margin/2.0
margin = 1.0
middle = width/2.0
textx = middle + margin/2.0
stopx = middle - margin/2.0
maxsize = stopx - margin
# start output
@@ -634,10 +634,10 @@ class StatisticsChart(Report):
yoffset = pt2cm(pstyle.get_font().get_size())
#print title
# header
yoffset += (row_h + pad)
text = _("%s (persons):") % typename
self.doc.draw_text('SC-text', text, textx, yoffset)
# header
yoffset += (row_h + pad)
text = _("%s (persons):") % typename
self.doc.draw_text('SC-text', text, textx, yoffset)
for key in lookup:
yoffset += (row_h + pad)
@@ -651,8 +651,8 @@ class StatisticsChart(Report):
value = data[key]
startx = stopx - (maxsize * value / max_value)
self.doc.draw_box('SC-bar',"",startx,yoffset,stopx-startx,row_h)
# text after bar
text = "%s (%d)" % (key, data[key])
# text after bar
text = "%s (%d)" % (key, data[key])
self.doc.draw_text('SC-text', text, textx, yoffset)
#print key + ":",
+3 -3
View File
@@ -539,9 +539,9 @@ class WebReport(Report):
if first:
first = False
if day_col > 1:
of.write(' <td colspan="%s" class="cal_cell">&nbsp;</td>\n' % str(day_col))
of.write(' <td colspan="%s" class="cal_cell">&nbsp;</td>\n' % str(day_col))
elif day_col == 1:
of.write(' <td class="cal_cell">&nbsp;</td>\n')
of.write(' <td class="cal_cell">&nbsp;</td>\n')
of.write(' <td class="%s">%s' % (cellclass,str(thisday.day)))
something_this_week = 1
if list > []:
@@ -570,7 +570,7 @@ class WebReport(Report):
if week_row == 5:
of.write(' class="cal_note">')
if self.Note[month-1].strip() != '':
of.write(self.Note[month-1])
of.write(self.Note[month-1])
else:
of.write("&nbsp;")
of.write('</td>\n')
+1 -1
View File
@@ -332,7 +332,7 @@ class GeneWebWriter:
return
if reflist:
for sr in reflist:
for sr in reflist:
sbase = sr.get_reference_handle()
if sbase:
source = self.db.get_source_from_handle(sbase)
+1 -1
View File
@@ -375,7 +375,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
if other_person.get_gender() == gen.lib.Person.MALE:
return (self.get_nephew(firstRel-secondRel,secondRel),common)
else:
return (self.get_niece(firstRel-secondRel,secondRel),common)
return (self.get_niece(firstRel-secondRel,secondRel),common)
else: # obviously secondRel == firstRel
if other_person.get_gender() == gen.lib.Person.MALE:
return (self.get_male_cousin(firstRel-1),common)
+53 -53
View File
@@ -274,20 +274,20 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
# other_level+orig_level=stopień pokrewieństwa (degree of kinship)
def get_junior_male_cousin_father_uncle(self,other_level,orig_level):
if other_level == orig_level == 2:
return "brat stryjeczny"
if other_level == orig_level == 2:
return "brat stryjeczny"
else:
return "daleki kuzyn (%d. stopień pokrewieństwa)" % (other_level+orig_level)
def get_junior_male_cousin_mother_uncle(self,other_level,orig_level):
if other_level == orig_level == 2:
return "brat wujeczny"
if other_level == orig_level == 2:
return "brat wujeczny"
else:
return "daleki kuzyn (%d. stopień pokrewieństwa)" % (other_level+orig_level)
def get_junior_male_cousin_aunt(self,other_level,orig_level):
if other_level == orig_level == 2:
return "brat cioteczny"
if other_level == orig_level == 2:
return "brat cioteczny"
else:
return "daleki kuzyn (%d. stopień pokrewieństwa)" % (other_level+orig_level)
@@ -304,20 +304,20 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
return "daleki %s (%d. stopień pokrewieństwa)" % (_brother_level_of_female[level],other_level+orig_level)
def get_junior_female_cousin_father_uncle(self,other_level,orig_level):
if other_level == orig_level == 2:
return "siostra stryjeczna"
if other_level == orig_level == 2:
return "siostra stryjeczna"
else:
return "daleka kuzynka (%d. stopień pokrewieństwa)" % (other_level+orig_level)
def get_junior_female_cousin_mother_uncle(self,other_level,orig_level):
if other_level == orig_level == 2:
return "siostra wujeczna"
if other_level == orig_level == 2:
return "siostra wujeczna"
else:
return "daleka kuzynka (%d. stopień pokrewieństwa)" % (other_level+orig_level)
def get_junior_female_cousin_aunt(self,other_level,orig_level):
if other_level == orig_level == 2:
return "siostra cioteczna"
if other_level == orig_level == 2:
return "siostra cioteczna"
else:
return "daleka kuzynka (%d. stopień pokrewieństwa)" % (other_level+orig_level)
@@ -349,14 +349,14 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
def get_mother(self,other_level,orig_level):
level=other_level
if level>len(_mother_level)-1:
if level>len(_mother_level)-1:
return "oddalona pra*babcia (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _mother_level[level]
def get_daughter(self,other_level,orig_level):
level=orig_level
if level>len(_daughter_level)-1:
if level>len(_daughter_level)-1:
return "oddalona pra*wnuczka (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _daughter_level[level]
@@ -390,56 +390,56 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
return _brother_level_of_female[level]
def get_nephew_of_brothers_son(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_nephew_level_of_brothers_son)-1:
return "oddalony pra*wnuk bratanka (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _nephew_level_of_brothers_son[level]
return _nephew_level_of_brothers_son[level]
def get_nephew_of_brothers_daughter(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_nephew_level_of_brothers_daughter)-1:
return "oddalony pra*wnuk bratanicy (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _nephew_level_of_brothers_daughter[level]
return _nephew_level_of_brothers_daughter[level]
def get_nephew_of_sisters_son(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_nephew_level_of_sisters_son)-1:
return "oddalony pra*wnuk siostrzeńca (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _nephew_level_of_sisters_son[level]
return _nephew_level_of_sisters_son[level]
def get_nephew_of_sisters_daughter(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_nephew_level_of_sisters_daughter)-1:
return "oddalony pra*wnuk siostrzenicy (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _nephew_level_of_sisters_daughter[level]
return _nephew_level_of_sisters_daughter[level]
def get_niece_of_brothers_son(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_niece_level_of_brothers_son)-1:
return "oddalona pra*wnuczka bratanka (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _niece_level_of_brothers_son[level]
def get_niece_of_brothers_daughter(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_niece_level_of_brothers_daughter)-1:
return "oddalona pra*wnuczka bratanicy (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _niece_level_of_brothers_daughter[level]
def get_niece_of_sisters_son(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_niece_level_of_sisters_son)-1:
return "oddalona pra*wnuczka siostrzeńca (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
return _niece_level_of_sisters_son[level]
def get_niece_of_sisters_daughter(self,other_level,orig_level):
level=orig_level-1
level=orig_level-1
if level>len(_niece_level_of_sisters_daughter)-1:
return "oddalona pra*wnuczka siostrzenicy (%d. stopień pokrewieństwa)" %(other_level+orig_level)
else:
@@ -688,7 +688,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
else:
return (self.get_senior_female_cousin_of_female(secondRel-firstRel+1,firstRel,secondRel),common)
else:
families1 = db.get_person_from_handle(common[0]).get_family_handle_list()
families1 = db.get_person_from_handle(common[0]).get_family_handle_list()
families2 = None
if len(common) >1:
families2 = db.get_person_from_handle(common[1]).get_family_handle_list()
@@ -704,32 +704,32 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
children = ancFamily.get_child_ref_list()
for sibling_handle in children:
if sibling_handle.ref in firstList:
for other_sibling_handle in children:
if other_sibling_handle.ref in secondList:
sibling = db.get_person_from_handle(sibling_handle.ref)
other_sibling = db.get_person_from_handle(other_sibling_handle.ref)
if other_person.get_gender() == gen.lib.Person.MALE:
if other_sibling.get_gender() == gen.lib.Person.MALE:
if sibling.get_gender() == gen.lib.Person.MALE:
# brat stryjeczny
return (self.get_junior_male_cousin_father_uncle(secondRel,firstRel),common)
else:
# brat wujeczny
return (self.get_junior_male_cousin_mother_uncle(secondRel,firstRel),common)
else:
# brat cioteczny
return (self.get_junior_male_cousin_aunt(secondRel,firstRel),common)
else:
if other_sibling.get_gender() == gen.lib.Person.MALE:
if sibling.get_gender() == gen.lib.Person.MALE:
# siostra stryjeczna
return (self.get_junior_female_cousin_father_uncle(secondRel,firstRel),common)
else:
# siostra wujeczna
return (self.get_junior_female_cousin_mother_uncle(secondRel,firstRel),common)
else:
# siostra cioteczna
return (self.get_junior_female_cousin_aunt(secondRel,firstRel),common)
for other_sibling_handle in children:
if other_sibling_handle.ref in secondList:
sibling = db.get_person_from_handle(sibling_handle.ref)
other_sibling = db.get_person_from_handle(other_sibling_handle.ref)
if other_person.get_gender() == gen.lib.Person.MALE:
if other_sibling.get_gender() == gen.lib.Person.MALE:
if sibling.get_gender() == gen.lib.Person.MALE:
# brat stryjeczny
return (self.get_junior_male_cousin_father_uncle(secondRel,firstRel),common)
else:
# brat wujeczny
return (self.get_junior_male_cousin_mother_uncle(secondRel,firstRel),common)
else:
# brat cioteczny
return (self.get_junior_male_cousin_aunt(secondRel,firstRel),common)
else:
if other_sibling.get_gender() == gen.lib.Person.MALE:
if sibling.get_gender() == gen.lib.Person.MALE:
# siostra stryjeczna
return (self.get_junior_female_cousin_father_uncle(secondRel,firstRel),common)
else:
# siostra wujeczna
return (self.get_junior_female_cousin_mother_uncle(secondRel,firstRel),common)
else:
# siostra cioteczna
return (self.get_junior_female_cousin_aunt(secondRel,firstRel),common)
#-------------------------------------------------------------------------
#
+4 -4
View File
@@ -93,7 +93,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
item = ""
result.append(word)
continue
if item:
if item:
if word == 'syster':
item = item[0:-1]
word = 'ster'
@@ -186,11 +186,11 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
removed = len(rel_string_long)-len(rel_string_short)-1
level = len(rel_string_short)-1
if level:
result.append(self._get_cousin(level,step,inlaw))
result.append(self._get_cousin(level,step,inlaw))
elif rel_string_long[removed] == 'f':
result.append('bror')
result.append('bror')
else:
result.append('syster')
result.append('syster')
for ix in range(removed-1,-1,-1):
if rel_string_long[ix] == 'f':
result.append('son')