* src/RelLib.py: documentation improvements, move family

relations constants from const.py.in
* src/AddSpouse.py: relationship constant changes
* src/BaseDoc.py: documentation improvements
* src/ChooseParents.py: relationship constant changes
* src/Date.py: documentation changes
* src/ReadGedcom.py: relationship constant changes, remove
unused global
* src/ReadXML.py: relationship constant changes
* src/SelectChild.py: has_family to get_parent_family
* src/const.py.in: moved family relation constants to RelLib
* src/plugins/Check.py: relationship constant changes
* src/plugins/ImportGeneWeb.py: relationship constant changes
* src/plugins/WriteGeneWeb.py: relationship constant changes


svn: r3836
This commit is contained in:
Don Allingham
2004-12-24 18:46:34 +00:00
parent 66bc5b5807
commit b7bb274409
13 changed files with 818 additions and 301 deletions

View File

@@ -1,3 +1,19 @@
2004-12-24 Don Allingham <dallingham@users.sourceforge.net>
* src/RelLib.py: documentation improvements, move family
relations constants from const.py.in
* src/AddSpouse.py: relationship constant changes
* src/BaseDoc.py: documentation improvements
* src/ChooseParents.py: relationship constant changes
* src/Date.py: documentation changes
* src/ReadGedcom.py: relationship constant changes, remove
unused global
* src/ReadXML.py: relationship constant changes
* src/SelectChild.py: has_family to get_parent_family
* src/const.py.in: moved family relation constants to RelLib
* src/plugins/Check.py: relationship constant changes
* src/plugins/ImportGeneWeb.py: relationship constant changes
* src/plugins/WriteGeneWeb.py: relationship constant changes
2004-12-23 Alex Roitman <shura@alex.neuro.umn.edu> 2004-12-23 Alex Roitman <shura@alex.neuro.umn.edu>
* src/ReportOptions.py (ReportOptions): Add wrappers to hide handler. * src/ReportOptions.py (ReportOptions): Add wrappers to hide handler.
* src/plugins/BookReport.py: Use wrappers. * src/plugins/BookReport.py: Use wrappers.

View File

@@ -139,7 +139,7 @@ class AddSpouse:
"destroy_passed_object" : Utils.destroy_passed_object "destroy_passed_object" : Utils.destroy_passed_object
}) })
self.rel_combo.set_active(const.FAMILY_MARRIED) self.rel_combo.set_active(RelLib.Family.MARRIED)
self.update_data() self.update_data()
def add_columns(self,tree): def add_columns(self,tree):
@@ -189,7 +189,7 @@ class AddSpouse:
import EditPerson import EditPerson
relation = self.rel_combo.get_active() relation = self.rel_combo.get_active()
if relation == const.FAMILY_CIVIL_UNION: if relation == RelLib.Family.CIVIL_UNION:
if self.person.get_gender() == RelLib.Person.male: if self.person.get_gender() == RelLib.Person.male:
gen = RelLib.Person.male gen = RelLib.Person.male
else: else:
@@ -335,7 +335,7 @@ class AddSpouse:
return 1 return 1
def set_gender(self): def set_gender(self):
if self.rel_combo.get_active() == const.FAMILY_CIVIL_UNION: if self.rel_combo.get_active() == RelLib.Family.CIVIL_UNION:
if self.gender == RelLib.Person.male: if self.gender == RelLib.Person.male:
self.sgender = RelLib.Person.female self.sgender = RelLib.Person.female
else: else:

View File

@@ -150,9 +150,9 @@ class PaperStyle:
""" """
Creates a new paper style with. Creates a new paper style with.
name - Name of the new style @param name: name of the new style
height - page height in centimeters @param height: page height in centimeters
width - page width in centimeters @param width: page width in centimeters
""" """
self.name = name self.name = name
self.orientation = PAPER_PORTRAIT self.orientation = PAPER_PORTRAIT
@@ -171,7 +171,7 @@ class PaperStyle:
""" """
Sets the page orientation. Sets the page orientation.
val - new orientation, should be either PAPER_PORTRAIT or @param val: new orientation, should be either PAPER_PORTRAIT or
PAPER_LANDSCAPE PAPER_LANDSCAPE
""" """
self.orientation = val self.orientation = val
@@ -221,7 +221,7 @@ class FontStyle:
""" """
Creates a new FontStyle object, accepting the default values. Creates a new FontStyle object, accepting the default values.
style - if specified, initializes the FontStyle from the passed @param style: if specified, initializes the FontStyle from the passed
FontStyle instead of using the defaults. FontStyle instead of using the defaults.
""" """
if style: if style:
@@ -243,12 +243,12 @@ class FontStyle:
""" """
Sets font characteristics. Sets font characteristics.
face - font type face, either FONT_SERIF or FONT_SANS_SERIF @param face: font type face, either FONT_SERIF or FONT_SANS_SERIF
size - type face size in points @param size: type face size in points
italic - 1 enables italics, 0 disables italics @param italic: True enables italics, False disables italics
bold - 1 enables bold face, 0 disables bold face @param bold: True enables bold face, False disables bold face
underline - 1 enables underline, 0 disables underline @param underline: True enables underline, False disables underline
color - an RGB color representation in the form of three integers @param color: an RGB color representation in the form of three integers
in the range of 0-255 represeting the red, green, and blue in the range of 0-255 represeting the red, green, and blue
components of a color. components of a color.
""" """
@@ -330,8 +330,8 @@ class TableStyle:
Creates a new TableStyle object, with the values initialized to Creates a new TableStyle object, with the values initialized to
empty, with allocating space for up to 100 columns. empty, with allocating space for up to 100 columns.
obj - if not None, then the object created gets is attributes from @param obj: if not None, then the object created gets is attributes
the passed object instead of being initialized to empty. from the passed object instead of being initialized to empty.
""" """
if obj: if obj:
self.width = obj.width self.width = obj.width
@@ -343,27 +343,35 @@ class TableStyle:
self.colwid = [ 0 ] * 100 self.colwid = [ 0 ] * 100
def set_width(self,width): def set_width(self,width):
"""Sets the width of the table in terms of percent of the available """
width""" Sets the width of the table in terms of percent of the available
width
"""
self.width = width self.width = width
def get_width(self): def get_width(self):
"Returns the specified width as a percentage of the available space" """
Returns the specified width as a percentage of the available space
"""
return self.width return self.width
def set_columns(self,columns): def set_columns(self,columns):
"""Sets the number of columns. """
Sets the number of columns.
columns - number of columns that should be used. @param columns: number of columns that should be used.
""" """
self.columns = columns self.columns = columns
def get_columns(self): def get_columns(self):
"Returns the number of columns" """
Returns the number of columns
"""
return self.columns return self.columns
def set_column_widths(self, list): def set_column_widths(self, list):
"""Sets the width of all the columns at once, taking the percentages """
Sets the width of all the columns at once, taking the percentages
from the passed list. from the passed list.
""" """
self.columns = len(list) self.columns = len(list)
@@ -371,10 +379,11 @@ class TableStyle:
self.colwid[i] = list[i] self.colwid[i] = list[i]
def set_column_width(self,index,width): def set_column_width(self,index,width):
"""Sets the width of a specified column to the specified width. """
Sets the width of a specified column to the specified width.
index - column being set (index starts at 0) @param index: column being set (index starts at 0)
width - percentage of the table width assigned to the column @param width: percentage of the table width assigned to the column
""" """
self.colwid[index] = width self.colwid[index] = width
@@ -383,7 +392,7 @@ class TableStyle:
Returns the column width of the specified column as a percentage of Returns the column width of the specified column as a percentage of
the entire table width. the entire table width.
index - column to return (index starts at 0) @param index: column to return (index starts at 0)
""" """
return self.colwid[index] return self.colwid[index]
@@ -401,8 +410,8 @@ class TableCellStyle:
""" """
Creates a new TableCellStyle instance. Creates a new TableCellStyle instance.
obj - if not None, specifies that the values should be copied from @param obj: if not None, specifies that the values should be
the passed object instead of being initialized to empty. copied from the passed object instead of being initialized to empty.
""" """
if obj: if obj:
self.rborder = obj.rborder self.rborder = obj.rborder
@@ -427,7 +436,7 @@ class TableCellStyle:
""" """
Defines if a right border in used Defines if a right border in used
val - if 1, a right border is used, if 0, it is not @param val: if True, a right border is used, if False, it is not
""" """
self.rborder = val self.rborder = val
@@ -435,7 +444,7 @@ class TableCellStyle:
""" """
Defines if a left border in used Defines if a left border in used
val - if 1, a left border is used, if 0, it is not @param val: if True, a left border is used, if False, it is not
""" """
self.lborder = val self.lborder = val
@@ -443,7 +452,7 @@ class TableCellStyle:
""" """
Defines if a top border in used Defines if a top border in used
val - if 1, a top border is used, if 0, it is not @param val: if True, a top border is used, if False, it is not
""" """
self.tborder = val self.tborder = val
@@ -451,7 +460,7 @@ class TableCellStyle:
""" """
Defines if a bottom border in used Defines if a bottom border in used
val - if 1, a bottom border is used, if 0, it is not @param val: if 1, a bottom border is used, if 0, it is not
""" """
self.bborder = val self.bborder = val
@@ -493,10 +502,12 @@ class ParagraphStyle:
alignment, level, top border, bottom border, right border, left alignment, level, top border, bottom border, right border, left
border, padding, and background color. border, padding, and background color.
source - if not None, then the ParagraphStyle is created using the
values of the source instead of the default values.
""" """
def __init__(self,source=None): def __init__(self,source=None):
"""
@param source: if not None, then the ParagraphStyle is created
using the values of the source instead of the default values.
"""
if source: if source:
self.font = FontStyle(source.font) self.font = FontStyle(source.font)
self.rmargin = source.rmargin self.rmargin = source.rmargin
@@ -538,18 +549,18 @@ class ParagraphStyle:
""" """
Allows the values of the object to be set. Allows the values of the object to be set.
rmargin - right margin in centimeters @param rmargin: right margin in centimeters
lmargin - left margin in centimeters @param lmargin: left margin in centimeters
first_indent - first line indent in centimeters @param first_indent: first line indent in centimeters
align - alignment type (PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT, align - alignment type (PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT,
PARA_ALIGN_CENTER, or PARA_ALIGN_JUSTIFY) PARA_ALIGN_CENTER, or PARA_ALIGN_JUSTIFY)
tborder - non zero indicates that a top border should be used @param tborder: non zero indicates that a top border should be used
bborder - non zero indicates that a bottom border should be used @param bborder: non zero indicates that a bottom border should be used
rborder - non zero indicates that a right border should be used @param rborder: non zero indicates that a right border should be used
lborder - non zero indicates that a left border should be used @param lborder: non zero indicates that a left border should be used
pad - padding in centimeters @param pad: padding in centimeters
bgcolor - background color of the paragraph as an RGB tuple. @param bgcolor: background color of the paragraph as an RGB tuple.
font - FontStyle instance that defines the font @param font: FontStyle instance that defines the font
""" """
if font != None: if font != None:
self.font = FontStyle(font) self.font = FontStyle(font)
@@ -591,7 +602,7 @@ class ParagraphStyle:
""" """
Sets the font style of the paragraph. Sets the font style of the paragraph.
font - FontStyle object containing the font definition to use. @param font: FontStyle object containing the font definition to use.
""" """
self.font = FontStyle(font) self.font = FontStyle(font)
@@ -603,7 +614,7 @@ class ParagraphStyle:
""" """
Sets the paragraph padding in centimeters Sets the paragraph padding in centimeters
val - floating point value indicating the padding in centimeters @param val: floating point value indicating the padding in centimeters
""" """
self.pad = val self.pad = val
@@ -615,7 +626,8 @@ class ParagraphStyle:
""" """
Sets the presence or absence of top border. Sets the presence or absence of top border.
val - 1 indicates a border should be used, 0 indicates no border. @param val: True indicates a border should be used, False indicates
no border.
""" """
self.top_border = val self.top_border = val
@@ -627,7 +639,8 @@ class ParagraphStyle:
""" """
Sets the presence or absence of bottom border. Sets the presence or absence of bottom border.
val - 1 indicates a border should be used, 0 indicates no border. @param val: True indicates a border should be used, False
indicates no border.
""" """
self.bottom_border = val self.bottom_border = val
@@ -639,7 +652,8 @@ class ParagraphStyle:
""" """
Sets the presence or absence of left border. Sets the presence or absence of left border.
val - 1 indicates a border should be used, 0 indicates no border. @param val: True indicates a border should be used, False
indicates no border.
""" """
self.left_border = val self.left_border = val
@@ -651,7 +665,8 @@ class ParagraphStyle:
""" """
Sets the presence or absence of rigth border. Sets the presence or absence of rigth border.
val - 1 indicates a border should be used, 0 indicates no border. @param val: True indicates a border should be used, False
indicates no border.
""" """
self.right_border = val self.right_border = val
@@ -670,8 +685,8 @@ class ParagraphStyle:
""" """
Sets the background color of the paragraph. Sets the background color of the paragraph.
color - tuple representing the RGB components of a color (0,0,0) @param color: tuple representing the RGB components of a color
to (255,255,255) (0,0,0) to (255,255,255)
""" """
self.bgcolor = color self.bgcolor = color
@@ -679,8 +694,8 @@ class ParagraphStyle:
""" """
Sets the paragraph alignment. Sets the paragraph alignment.
align - PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, or @param align: PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER,
PARA_ALIGN_JUSTIFY or PARA_ALIGN_JUSTIFY
""" """
self.align = align self.align = align
@@ -859,7 +874,7 @@ class StyleSheet:
""" """
Creates a new empty StyleSheet. Creates a new empty StyleSheet.
obj - if not None, creates the StyleSheet from the values in @param obj: if not None, creates the StyleSheet from the values in
obj, instead of creating an empty StyleSheet obj, instead of creating an empty StyleSheet
""" """
self.style_list = {} self.style_list = {}
@@ -1065,13 +1080,13 @@ class BaseDoc:
interface. This class should never be instantiated directly, but interface. This class should never be instantiated directly, but
only through a derived class. only through a derived class.
styles - StyleSheet containing the paragraph styles used. @param styles: StyleSheet containing the paragraph styles used.
paper_type - PaperStyle instance containing information about @param paper_type: PaperStyle instance containing information about
the paper. If set to None, then the document is the paper. If set to None, then the document is not a page
not a page oriented document (e.g. HTML) oriented document (e.g. HTML)
template - Format template for document generators that are @param template: Format template for document generators that are
not page oriented. not page oriented.
orientation - page orientation, either PAPER_PORTRAIT or @param orientation: page orientation, either PAPER_PORTRAIT or
PAPER_LANDSCAPE PAPER_LANDSCAPE
""" """
self.orientation = orientation self.orientation = orientation
@@ -1119,7 +1134,7 @@ class BaseDoc:
""" """
Sets the name of the owner of the document. Sets the name of the owner of the document.
owner - User's name @param owner: User's name
""" """
self.owner = owner self.owner = owner
@@ -1127,11 +1142,11 @@ class BaseDoc:
""" """
Adds a photo of the specified width (in centimeters) Adds a photo of the specified width (in centimeters)
name - filename of the image to add @param name: filename of the image to add
align - alignment of the image. Valid values are 'left', 'right', @param align: alignment of the image. Valid values are 'left',
'center', and 'single' 'right', 'center', and 'single'
w_cm - width in centimeters @param w_cm: width in centimeters
h_cm - height in centimeters @param h_cm: height in centimeters
""" """
pass pass
@@ -1169,7 +1184,7 @@ class BaseDoc:
""" """
Sets the title of the document. Sets the title of the document.
name - Title of the document @param name: Title of the document
""" """
self.title = name self.title = name
@@ -1180,8 +1195,8 @@ class BaseDoc:
""" """
Adds the TableStyle with the specfied name. Adds the TableStyle with the specfied name.
name - name of the table style @param name: name of the table style
style - TableStyle instance to be added @param style: TableStyle instance to be added
""" """
self.table_styles[name] = TableStyle(style) self.table_styles[name] = TableStyle(style)
@@ -1189,8 +1204,8 @@ class BaseDoc:
""" """
Adds the TableCellStyle with the specfied name. Adds the TableCellStyle with the specfied name.
name - name of the table cell style @param name: name of the table cell style
style - TableCellStyle instance to be added @param style: TableCellStyle instance to be added
""" """
self.cell_styles[name] = TableCellStyle(style) self.cell_styles[name] = TableCellStyle(style)
@@ -1198,7 +1213,7 @@ class BaseDoc:
""" """
Opens the document. Opens the document.
filename - path name of the file to create @param filename: path name of the file to create
""" """
pass pass
@@ -1234,7 +1249,7 @@ class BaseDoc:
""" """
Starts a new listing block, using the specified style name. Starts a new listing block, using the specified style name.
style_name - name of the ParagraphStyle to use for the block. @param style_name: name of the ParagraphStyle to use for the block.
""" """
pass pass
@@ -1245,8 +1260,10 @@ class BaseDoc:
""" """
Starts a new paragraph, using the specified style name. Starts a new paragraph, using the specified style name.
style_name - name of the ParagraphStyle to use for the paragraph. @param style_name: name of the ParagraphStyle to use for the
leader - Leading text for a paragraph. Typically used for numbering. paragraph.
@param leader: Leading text for a paragraph. Typically used
for numbering.
""" """
pass pass
@@ -1258,8 +1275,8 @@ class BaseDoc:
""" """
Starts a new table. Starts a new table.
name - Unique name of the table. @param name: Unique name of the table.
style_name - TableStyle to use for the new table @param style_name: TableStyle to use for the new table
""" """
pass pass
@@ -1279,8 +1296,8 @@ class BaseDoc:
""" """
Starts a new table cell, using the paragraph style specified. Starts a new table cell, using the paragraph style specified.
style_name - TableCellStyle to use for the cell @param style_name: TableCellStyle to use for the cell
span - number of columns to span @param span: number of columns to span
""" """
pass pass
@@ -1297,9 +1314,8 @@ class BaseDoc:
Writes the note's text and take care of paragraphs, Writes the note's text and take care of paragraphs,
depending on the format. depending on the format.
text - text to write. @param text: text to write.
format - format to use for writing: @param format: format to use for writing. True for flowed text,
0 for flowed text,
1 for preformatted text. 1 for preformatted text.
""" """
pass pass
@@ -1309,7 +1325,7 @@ class BaseDoc:
Writes the text in the current paragraph. Should only be used after a Writes the text in the current paragraph. Should only be used after a
start_paragraph and before an end_paragraph. start_paragraph and before an end_paragraph.
text - text to write. @param text: text to write.
""" """
pass pass
@@ -1318,7 +1334,7 @@ class BaseDoc:
Writes the text in the current paragraph. Should only be used after a Writes the text in the current paragraph. Should only be used after a
start_paragraph and before an end_paragraph. start_paragraph and before an end_paragraph.
text - text to write. @param text: text to write.
""" """
pass pass

View File

@@ -152,7 +152,7 @@ class ChooseParents:
if self.family: if self.family:
self.type = self.family.get_relationship() self.type = self.family.get_relationship()
else: else:
self.type = const.FAMILY_MARRIED self.type = RelLib.Family.MARRIED
self.prel.set_active(self.type) self.prel.set_active(self.type)
self.redrawm() self.redrawm()
@@ -332,7 +332,7 @@ class ChooseParents:
self.father_list.set_model(self.father_model) self.father_list.set_model(self.father_model)
self.father_model.refilter() self.father_model.refilter()
if self.type == const.FAMILY_CIVIL_UNION: if self.type == RelLib.Family.CIVIL_UNION:
self.flabel.set_label("<b>%s</b>" % _("Par_ent")) self.flabel.set_label("<b>%s</b>" % _("Par_ent"))
else: else:
self.flabel.set_label("<b>%s</b>" % _("Fath_er")) self.flabel.set_label("<b>%s</b>" % _("Fath_er"))
@@ -358,7 +358,7 @@ class ChooseParents:
self.mother_list.set_model(self.mother_model) self.mother_list.set_model(self.mother_model)
self.mother_model.refilter() self.mother_model.refilter()
if self.type == const.FAMILY_CIVIL_UNION: if self.type == RelLib.Family.CIVIL_UNION:
self.mlabel.set_label("<b>%s</b>" % _("Pa_rent")) self.mlabel.set_label("<b>%s</b>" % _("Pa_rent"))
else: else:
self.mlabel.set_label("<b>%s</b>" % _("Mothe_r")) self.mlabel.set_label("<b>%s</b>" % _("Mothe_r"))
@@ -367,7 +367,7 @@ class ChooseParents:
"""Called everytime the parent relationship information is changed""" """Called everytime the parent relationship information is changed"""
self.old_type = self.type self.old_type = self.type
self.type = self.prel.get_active() self.type = self.prel.get_active()
if self.old_type == const.FAMILY_CIVIL_UNION or self.type == const.FAMILY_CIVIL_UNION: if self.old_type == RelLib.Family.CIVIL_UNION or self.type == RelLib.Family.CIVIL_UNION:
self.redrawf() self.redrawf()
self.redrawm() self.redrawm()
@@ -563,7 +563,7 @@ class ChooseParents:
name = person.get_primary_name().get_surname() name = person.get_primary_name().get_surname()
self.type = self.prel.get_active() self.type = self.prel.get_active()
if self.type == const.FAMILY_CIVIL_UNION: if self.type == RelLib.Family.CIVIL_UNION:
self.parent_relation_changed(self.prel) self.parent_relation_changed(self.prel)
elif person.get_gender() == RelLib.Person.male: elif person.get_gender() == RelLib.Person.male:
self.redrawf() self.redrawf()
@@ -671,7 +671,7 @@ class ModifyParents:
self.title.set_use_markup(gtk.TRUE) self.title.set_use_markup(gtk.TRUE)
if self.family.get_relationship() == const.FAMILY_CIVIL_UNION: if self.family.get_relationship() == RelLib.Family.CIVIL_UNION:
self.mlabel.set_label("<b>%s</b>" % _("Pa_rent")) self.mlabel.set_label("<b>%s</b>" % _("Pa_rent"))
self.flabel.set_label("<b>%s</b>" % _("Par_ent")) self.flabel.set_label("<b>%s</b>" % _("Par_ent"))
else: else:

View File

@@ -206,7 +206,7 @@ class Date:
def get_modifier(self): def get_modifier(self):
""" """
Returns an integer indicating the calendar selected. The valid Returns an integer indicating the calendar selected. The valid
values are: values are::
MOD_NONE = no modifier (default) MOD_NONE = no modifier (default)
MOD_BEFORE = before MOD_BEFORE = before
@@ -227,7 +227,7 @@ class Date:
def get_quality(self): def get_quality(self):
""" """
Returns an integer indicating the calendar selected. The valid Returns an integer indicating the calendar selected. The valid
values are: values are::
QUAL_NONE = normal (default) QUAL_NONE = normal (default)
QUAL_ESTIMATED = estimated QUAL_ESTIMATED = estimated
@@ -244,7 +244,7 @@ class Date:
def get_calendar(self): def get_calendar(self):
""" """
Returns an integer indicating the calendar selected. The valid Returns an integer indicating the calendar selected. The valid
values are: values are::
CAL_GREGORIAN - Gregorian calendar CAL_GREGORIAN - Gregorian calendar
CAL_JULIAN - Julian calendar CAL_JULIAN - Julian calendar
@@ -399,7 +399,7 @@ class Date:
def set(self,quality,modifier,calendar,value,text=None): def set(self,quality,modifier,calendar,value,text=None):
""" """
Sets the date to the specified value. Parameters are: Sets the date to the specified value. Parameters are::
quality - The date quality for the date (see get_quality quality - The date quality for the date (see get_quality
for more information) for more information)

View File

@@ -66,7 +66,6 @@ ANSEL = 1
UNICODE = 2 UNICODE = 2
UPDATE = 25 UPDATE = 25
db = None
callback = None callback = None
_title_string = _("GEDCOM") _title_string = _("GEDCOM")
@@ -823,7 +822,7 @@ class GedcomParser:
except: except:
event.set_name(matches[1]) event.set_name(matches[1])
if event.get_name() == "Marriage": if event.get_name() == "Marriage":
self.family.set_relationship(const.FAMILY_MARRIED) self.family.set_relationship(RelLib.Family.MARRIED)
self.db.add_event(event,self.trans) self.db.add_event(event,self.trans)
self.family.add_event_handle(event.get_handle()) self.family.add_event_handle(event.get_handle())
self.parse_family_event(event,2) self.parse_family_event(event,2)
@@ -1941,11 +1940,9 @@ def extract_temple(matches):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def readData(database,active_person,cb): def readData(database,active_person,cb):
global db
global callback global callback
global file_topa global file_topa
db = database
callback = cb callback = cb
choose = gtk.FileChooserDialog("%s - GRAMPS" % _title_string, choose = gtk.FileChooserDialog("%s - GRAMPS" % _title_string,
@@ -1971,7 +1968,7 @@ def readData(database,active_person,cb):
filename = choose.get_filename() filename = choose.get_filename()
choose.destroy() choose.destroy()
try: try:
importData(db,filename) importData(database,filename)
except: except:
import DisplayTrace import DisplayTrace
DisplayTrace.DisplayTrace() DisplayTrace.DisplayTrace()

View File

@@ -784,7 +784,7 @@ class GrampsParser:
if attrs.has_key("type"): if attrs.has_key("type"):
self.family.set_relationship(_FAMILY_TRANS.get(attrs["type"], self.family.set_relationship(_FAMILY_TRANS.get(attrs["type"],
const.FAMILY_UNKNOWN)) RelLib.Family.UNKNOWN))
if attrs.has_key("complete"): if attrs.has_key("complete"):
self.family.set_complete_flag(int(attrs['complete'])) self.family.set_complete_flag(int(attrs['complete']))
else: else:

File diff suppressed because it is too large Load Diff

View File

@@ -424,7 +424,7 @@ class EditRel:
"destroy_passed_object" : self.close "destroy_passed_object" : self.close
}) })
f = self.child.has_family(self.family.get_handle()) f = self.child.get_parent_family(self.family.get_handle())
if f: if f:
self.fentry.set_text(_(f[2])) self.fentry.set_text(_(f[2]))
self.mentry.set_text(_(f[1])) self.mentry.set_text(_(f[1]))

View File

@@ -444,12 +444,6 @@ def save_attr(st):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
FAMILY_MARRIED = 0
FAMILY_UNMARRIED = 1
FAMILY_CIVIL_UNION = 2
FAMILY_UNKNOWN = 3
FAMILY_OTHER = 4
family_relations = [ family_relations = [
(_("Married"), _("A legal or common-law relationship between a husband and wife")), (_("Married"), _("A legal or common-law relationship between a husband and wife")),

View File

@@ -272,9 +272,9 @@ class CheckIntegrity:
else: else:
fgender = father.get_gender() fgender = father.get_gender()
mgender = mother.get_gender() mgender = mother.get_gender()
if type != const.FAMILY_CIVIL_UNION: if type != RelLib.Family._CIVIL_UNION:
if fgender == mgender and fgender != RelLib.Person.unknown: if fgender == mgender and fgender != RelLib.Person.unknown:
family.set_relationship(const.FAMILY_CIVIL_UNION) family.set_relationship(RelLib.Family._CIVIL_UNION)
self.fam_rel.append(family_handle) self.fam_rel.append(family_handle)
self.db.commit_family(family,self.trans) self.db.commit_family(family,self.trans)
elif fgender == RelLib.Person.female or mgender == RelLib.Person.male: elif fgender == RelLib.Person.female or mgender == RelLib.Person.male:
@@ -283,7 +283,7 @@ class CheckIntegrity:
self.fam_rel.append(family_handle) self.fam_rel.append(family_handle)
self.db.commit_family(family,self.trans) self.db.commit_family(family,self.trans)
elif fgender != mgender: elif fgender != mgender:
family.set_relationship(const.FAMILY_UNKNOWN) family.set_relationship(RelLib.Family._UNKNOWN)
self.fam_rel.append(family_handle) self.fam_rel.append(family_handle)
if fgender == RelLib.Person.female or mgender == RelLib.Person.male: if fgender == RelLib.Person.female or mgender == RelLib.Person.male:
family.set_father_handle(mother_handle) family.set_father_handle(mother_handle)

View File

@@ -353,7 +353,7 @@ class GeneWebParser:
self.current_family.add_event_handle(sep.get_handle()) self.current_family.add_event_handle(sep.get_handle())
if not married: if not married:
self.current_family.set_relationship(const.FAMILY_UNMARRIED) self.current_family.set_relationship(RelLib.Family.UNMARRIED)
self.db.commit_family(self.current_family,self.trans) self.db.commit_family(self.current_family,self.trans)
return idx return idx

View File

@@ -482,7 +482,7 @@ class GeneWebWriter:
if eng_source != "": if eng_source != "":
ret = ret + "#ms %s " % self.rem_spaces( m_source) ret = ret + "#ms %s " % self.rem_spaces( m_source)
else: else:
if family.get_relationship() != const.FAMILY_MARRIED: if family.get_relationship() != RelLib.Family.MARRIED:
"""Not married or engaged""" """Not married or engaged"""
ret = ret + " #nm " ret = ret + " #nm "