* src/GrampsDb/_ReadGedcom.py: Formatting fixes.

* src/GrampsDb/_GrampsDbBase.py: Formatting fixes.
	* src/GrampsDb/_GrampsDbFactories.py: Formatting fixes.
	* src/GrampsDb/_WriteXML.py: Formatting fixes.
	* src/GrampsDb/_GrampsBSDDB.py: Formatting fixes.
	* src/RelLib/_UrlBase.py: Formatting fixes.
	* src/RelLib/_Url.py: Formatting fixes.
	* src/RelLib/_Person.py: Formatting fixes.
	* src/RelLib/_Family.py: Formatting fixes.
	* src/RelLib/_Place.py: Formatting fixes.
	* src/RelLib/_Repository.py: Formatting fixes.
	* src/BasicUtils.py: Formatting fixes.
	* src/DateHandler/_DateUtils.py: Formatting fixes.


svn: r7481
This commit is contained in:
Alex Roitman 2006-10-29 04:36:08 +00:00
parent ca700bd5c5
commit b9f2392f29
14 changed files with 142 additions and 129 deletions

View File

@ -1,4 +1,17 @@
2006-10-28 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: Formatting fixes.
* src/GrampsDb/_GrampsDbBase.py: Formatting fixes.
* src/GrampsDb/_GrampsDbFactories.py: Formatting fixes.
* src/GrampsDb/_WriteXML.py: Formatting fixes.
* src/GrampsDb/_GrampsBSDDB.py: Formatting fixes.
* src/RelLib/_UrlBase.py: Formatting fixes.
* src/RelLib/_Url.py: Formatting fixes.
* src/RelLib/_Person.py: Formatting fixes.
* src/RelLib/_Family.py: Formatting fixes.
* src/RelLib/_Place.py: Formatting fixes.
* src/RelLib/_Repository.py: Formatting fixes.
* src/BasicUtils.py: Formatting fixes.
* src/DateHandler/_DateUtils.py: Formatting fixes.
* NEWS: Update.
* src/ViewManager.py (ViewManager.about): Use const.py.
* src/const.py.in (url_manual): Add the link constant.

View File

@ -51,7 +51,7 @@ class UpdateCallback:
@param callback: a function with one arg to execute every so often
@type callback: function
@param interval: number of seconds at most between the updates
@type callback: int
@type interval: int
"""
if '__call__' in dir(callback): # callback is really callable
self.update = self.update_real

View File

@ -55,12 +55,12 @@ def set_date(date_base, text) :
"""
Sets the date of the DateBase instance.
The date is parsed into a L{Date} instance.
The date is parsed into a Date instance.
@param date: String representation of a date. The locale specific
L{DateParser} is used to parse the string into a GRAMPS L{Date}
object.
@type date: str
@param date_base: The DateBase instance to set the date to.
@type date_base: DateBase
@param text: The text to use for the text string in date
@type text: str
"""
parser.set_date(date_base.get_date_object(),text)
@ -69,7 +69,7 @@ def get_date(date_base) :
Returns a string representation of the date of the DateBase instance.
This representation is based off the default date display format
determined by the locale's L{DateDisplay} instance.
determined by the locale's DateDisplay instance.
@return: Returns a string representing the DateBase date
@rtype: str
"""
@ -80,8 +80,8 @@ def get_quote_date(date_base):
Returns a string representation of the date of the DateBase instance.
This representation is based off the default date display format
determined by the locale's L{DateDisplay} instance. The date is
enclosed in quotes if the L{Date} is not a valid date.
determined by the locale's DateDisplay instance. The date is
enclosed in quotes if the Date is not a valid date.
@return: Returns a string representing the DateBase date
@rtype: str

View File

@ -652,7 +652,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
Note that this is a generator function, it returns a iterator for
use in loops. If you want a list of the results use:
result_list = [i for i in find_backlink_handles(handle)]
> result_list = [i for i in find_backlink_handles(handle)]
"""
@ -961,8 +961,8 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
def _close_early(self):
"""
Bail out if the incompatible version is discovered:
* close cleanly to not damage data/env
* raise exception
* close cleanly to not damage data/env
* raise exception
"""
self.metadata.close()
self.env.close()

View File

@ -1313,9 +1313,8 @@ class GrampsDbBase(GrampsDBCallback):
or R%04d.
"""
self.rprefix = self._validated_id_prefix(val, "R")
def transaction_begin(self, msg="", batch=False, match=False,
no_magic=False):
def transaction_begin(self, msg="",batch=False,no_magic=False):
"""
Creates a new Transaction tied to the current UNDO database. The
transaction has no effect until it is committed using the
@ -2064,7 +2063,7 @@ class GrampsDbBase(GrampsDBCallback):
Note that this is a generator function, it returns a iterator for
use in loops. If you want a list of the results use:
result_list = [i for i in find_backlink_handles(handle)]
> result_list = [i for i in find_backlink_handles(handle)]
"""
# Make a dictionary of the functions and classes that we need for

View File

@ -28,14 +28,14 @@ for a database backend.
The app_* constants in const.py can be used to indicate which backend is
required e.g.:
# To get the class for the grdb backend
db_class = GrampsDb.gramps_db_factory(db_type = const.app_gramps)
# To get a XML writer
GrampsDb.gramps_db_writer_factory(db_type = const.app_gramps_xml)
# To get a Gedcom reader
GrampsDb.gramps_db_reader_factory(db_type = const.app_gedcom)
> # To get the class for the grdb backend
> db_class = GrampsDb.gramps_db_factory(db_type = const.app_gramps)
>
> # To get a XML writer
> GrampsDb.gramps_db_writer_factory(db_type = const.app_gramps_xml)
>
> # To get a Gedcom reader
> GrampsDb.gramps_db_reader_factory(db_type = const.app_gedcom)
"""
import const

View File

@ -1585,29 +1585,29 @@ class GedcomParser(UpdateCallback):
"""
Handling of the GEDCOM INDI tag.
n @XREF:INDI@ INDI {1:1}
+1 RESN <RESTRICTION_NOTICE> {0:1}
+1 <<PERSONAL_NAME_STRUCTURE>> {0:M}
+1 SEX <SEX_VALUE> {0:1}
+1 <<INDIVIDUAL_EVENT_STRUCTURE>> {0:M}
+1 <<INDIVIDUAL_ATTRIBUTE_STRUCTURE>> {0:M}
+1 <<LDS_INDIVIDUAL_ORDINANCE>> {0:M}
+1 <<CHILD_TO_FAMILY_LINK>> {0:M}
+1 <<SPOUSE_TO_FAMILY_LINK>> {0:M}
+1 SUBM @<XREF:SUBM>@ {0:M}
+1 <<ASSOCIATION_STRUCTURE>> {0:M}
+1 ALIA @<XREF:INDI>@ {0:M}
+1 ANCI @<XREF:SUBM>@ {0:M}
+1 DESI @<XREF:SUBM>@ {0:M}
+1 <<SOURCE_CITATION>> {0:M}
+1 <<MULTIMEDIA_LINK>> {0:M}
+1 <<NOTE_STRUCTURE>> {0:M}
+1 RFN <PERMANENT_RECORD_FILE_NUMBER> {0:1}
+1 AFN <ANCESTRAL_FILE_NUMBER> {0:1}
+1 REFN <USER_REFERENCE_NUMBER> {0:M}
+2 TYPE <USER_REFERENCE_TYPE> {0:1}
+1 RIN <AUTOMATED_RECORD_ID> {0:1}
+1 <<CHANGE_DATE>> {0:1}
n @XREF:INDI@ INDI {1:1}
+1 RESN <RESTRICTION_NOTICE> {0:1}
+1 <<PERSONAL_NAME_STRUCTURE>> {0:M}
+1 SEX <SEX_VALUE> {0:1}
+1 <<INDIVIDUAL_EVENT_STRUCTURE>> {0:M}
+1 <<INDIVIDUAL_ATTRIBUTE_STRUCTURE>> {0:M}
+1 <<LDS_INDIVIDUAL_ORDINANCE>> {0:M}
+1 <<CHILD_TO_FAMILY_LINK>> {0:M}
+1 <<SPOUSE_TO_FAMILY_LINK>> {0:M}
+1 SUBM @<XREF:SUBM>@ {0:M}
+1 <<ASSOCIATION_STRUCTURE>> {0:M}
+1 ALIA @<XREF:INDI>@ {0:M}
+1 ANCI @<XREF:SUBM>@ {0:M}
+1 DESI @<XREF:SUBM>@ {0:M}
+1 <<SOURCE_CITATION>> {0:M}
+1 <<MULTIMEDIA_LINK>> {0:M}
+1 <<NOTE_STRUCTURE>> {0:M}
+1 RFN <PERMANENT_RECORD_FILE_NUMBER> {0:1}
+1 AFN <ANCESTRAL_FILE_NUMBER> {0:1}
+1 REFN <USER_REFERENCE_NUMBER> {0:M}
+2 TYPE <USER_REFERENCE_TYPE> {0:1}
+1 RIN <AUTOMATED_RECORD_ID> {0:1}
+1 <<CHANGE_DATE>> {0:1}
"""
# find the person
@ -2471,21 +2471,21 @@ class GedcomParser(UpdateCallback):
"""
Parsers the NAME token in a GEDCOM file. The text is in the format
of (according to the GEDCOM Spec):
<TEXT>|/<TEXT>/|<TEXT>/<TEXT>/|/<TEXT>/<TEXT>|<TEXT>/<TEXT>/<TEXT>
> <TEXT>|/<TEXT>/|<TEXT>/<TEXT>/|/<TEXT>/<TEXT>|<TEXT>/<TEXT>/<TEXT>
We have encountered some variations that use:
<TEXT>/
> <TEXT>/
The basic Name structure is:
n NAME <NAME_PERSONAL> {1:1}
+1 NPFX <NAME_PIECE_PREFIX> {0:1}
+1 GIVN <NAME_PIECE_GIVEN> {0:1}
+1 NICK <NAME_PIECE_NICKNAME> {0:1}
+1 SPFX <NAME_PIECE_SURNAME_PREFIX {0:1}
+1 SURN <NAME_PIECE_SURNAME> {0:1}
+1 NSFX <NAME_PIECE_SUFFIX> {0:1}
+1 <<SOURCE_CITATION>> {0:M}
+1 <<NOTE_STRUCTURE>> {0:M}
> n NAME <NAME_PERSONAL> {1:1}
> +1 NPFX <NAME_PIECE_PREFIX> {0:1}
> +1 GIVN <NAME_PIECE_GIVEN> {0:1}
> +1 NICK <NAME_PIECE_NICKNAME> {0:1}
> +1 SPFX <NAME_PIECE_SURNAME_PREFIX {0:1}
> +1 SURN <NAME_PIECE_SURNAME> {0:1}
> +1 NSFX <NAME_PIECE_SUFFIX> {0:1}
> +1 <<SOURCE_CITATION>> {0:M}
> +1 <<NOTE_STRUCTURE>> {0:M}
"""
# build a RelLib.Name structure from the text
@ -2535,10 +2535,10 @@ class GedcomParser(UpdateCallback):
"""
CHANGE_DATE:=
n CHAN {1:1}
+1 DATE <CHANGE_DATE> {1:1}
+2 TIME <TIME_VALUE> {0:1}
+1 <<NOTE_STRUCTURE>> {0:M}
> n CHAN {1:1}
> +1 DATE <CHANGE_DATE> {1:1}
> +2 TIME <TIME_VALUE> {0:1}
> +1 <<NOTE_STRUCTURE>> {0:M}
The Note structure is ignored, since we have nothing
corresponding in GRAMPS.
@ -2585,15 +2585,15 @@ class GedcomParser(UpdateCallback):
are currently parsing. The GEDCOM spec indicates that valid ASSOC tag
is:
n ASSO @<XREF:INDI>@ {0:M}
> n ASSO @<XREF:INDI>@ {0:M}
And the the sub tags are:
ASSOCIATION_STRUCTURE:=
+1 TYPE <RECORD_TYPE> {1:1}
+1 RELA <RELATION_IS_DESCRIPTOR> {1:1}
+1 <<NOTE_STRUCTURE>> {0:M}
+1 <<SOURCE_CITATION>> {0:M}
> ASSOCIATION_STRUCTURE:=
> +1 TYPE <RECORD_TYPE> {1:1}
> +1 RELA <RELATION_IS_DESCRIPTOR> {1:1}
> +1 <<NOTE_STRUCTURE>> {0:M}
> +1 <<SOURCE_CITATION>> {0:M}
GRAMPS only supports ASSO records to people, so if the TYPE is
something other than INDI, the record is ignored.
@ -2663,15 +2663,15 @@ class GedcomParser(UpdateCallback):
Embedded form
n OBJE @<XREF:OBJE>@ {1:1}
> n OBJE @<XREF:OBJE>@ {1:1}
Linked form
Linked form
n OBJE {1:1}
+1 FORM <MULTIMEDIA_FORMAT> {1:1}
+1 TITL <DESCRIPTIVE_TITLE> {0:1}
+1 FILE <MULTIMEDIA_FILE_REFERENCE> {1:1}
+1 <<NOTE_STRUCTURE>> {0:M}
> n OBJE {1:1}
> +1 FORM <MULTIMEDIA_FORMAT> {1:1}
> +1 TITL <DESCRIPTIVE_TITLE> {0:1}
> +1 FILE <MULTIMEDIA_FILE_REFERENCE> {1:1}
> +1 <<NOTE_STRUCTURE>> {0:M}
"""
if matches[2] and matches[2][0] == '@':
ref = RelLib.MediaRef()
@ -2717,12 +2717,12 @@ class GedcomParser(UpdateCallback):
def func_person_sex(self,matches,state):
"""
+1 SEX <SEX_VALUE> {0:1}
> +1 SEX <SEX_VALUE> {0:1}
Valid values for <SEX_VALUE> are:
M = Male
F = Female
> M = Male
> F = Female
"""
if matches[2] == '':
state.person.set_gender(RelLib.Person.UNKNOWN)
@ -2799,16 +2799,16 @@ class GedcomParser(UpdateCallback):
"""
The RESI tag follows the EVENT_DETAIL structure, which is:
n TYPE <EVENT_DESCRIPTOR> {0:1}
n DATE <DATE_VALUE> {0:1}
n <<PLACE_STRUCTURE>> {0:1}
n <<ADDRESS_STRUCTURE>> {0:1}
n AGE <AGE_AT_EVENT> {0:1}
n AGNC <RESPONSIBLE_AGENCY> {0:1}
n CAUS <CAUSE_OF_EVENT> {0:1}
n <<SOURCE_CITATION>> {0:M}
n <<MULTIMEDIA_LINK>> {0:M}
n <<NOTE_STRUCTURE>> {0:M}
> n TYPE <EVENT_DESCRIPTOR> {0:1}
> n DATE <DATE_VALUE> {0:1}
> n <<PLACE_STRUCTURE>> {0:1}
> n <<ADDRESS_STRUCTURE>> {0:1}
> n AGE <AGE_AT_EVENT> {0:1}
> n AGNC <RESPONSIBLE_AGENCY> {0:1}
> n CAUS <CAUSE_OF_EVENT> {0:1}
> n <<SOURCE_CITATION>> {0:M}
> n <<MULTIMEDIA_LINK>> {0:M}
> n <<NOTE_STRUCTURE>> {0:M}
Currently, the TYPE, AGE, CAUSE, STAT, and other tags which
do not apply to an address are ignored.
@ -2862,9 +2862,9 @@ class GedcomParser(UpdateCallback):
def func_person_birt(self,matches,state):
"""
n BIRT [Y|<NULL>] {1:1}
+1 <<EVENT_DETAIL>> {0:1} p.*
+1 FAMC @<XREF:FAM>@ {0:1} p.*
> n BIRT [Y|<NULL>] {1:1}
> +1 <<EVENT_DETAIL>> {0:1} p.*
> +1 FAMC @<XREF:FAM>@ {0:1} p.*
I'm not sure what value the FAMC actually offers here, since
the FAMC record should handle this. Why it is a valid sub value
@ -3119,15 +3119,15 @@ class GedcomParser(UpdateCallback):
def func_repo_addr(self, matches, repo, level):
"""
n ADDR <ADDRESS_LINE> {0:1}
+1 CONT <ADDRESS_LINE> {0:M}
+1 ADR1 <ADDRESS_LINE1> {0:1}
+1 ADR2 <ADDRESS_LINE2> {0:1}
+1 CITY <ADDRESS_CITY> {0:1}
+1 STAE <ADDRESS_STATE> {0:1}
+1 POST <ADDRESS_POSTAL_CODE> {0:1}
+1 CTRY <ADDRESS_COUNTRY> {0:1}
n PHON <PHONE_NUMBER> {0:3}
n ADDR <ADDRESS_LINE> {0:1}
+1 CONT <ADDRESS_LINE> {0:M}
+1 ADR1 <ADDRESS_LINE1> {0:1}
+1 ADR2 <ADDRESS_LINE2> {0:1}
+1 CITY <ADDRESS_CITY> {0:1}
+1 STAE <ADDRESS_STATE> {0:1}
+1 POST <ADDRESS_POSTAL_CODE> {0:1}
+1 CTRY <ADDRESS_COUNTRY> {0:1}
n PHON <PHONE_NUMBER> {0:3}
Some repositories do not try to break up the address,
instead they put everything on a single line. Try to determine

View File

@ -122,9 +122,9 @@ class XmlWriter(UpdateCallback):
db - database to write
callback - function to provide progress indication
strip_photos - remove paths off of media object paths
0: do not touch the paths
1: remove everything expect the filename
2: remove leading slash
> 0: do not touch the paths
> 1: remove everything expect the filename
> 2: remove leading slash
compress - attempt to compress the database
"""
UpdateCallback.__init__(self,callback)

View File

@ -353,8 +353,8 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
Adds the database handle for L{Person} to the Family's list
of children.
@param person_handle: L{Person} database handle
@type person_handle: str
@param child_ref: Child Reference instance
@type child_ref: ChildRef
"""
if not isinstance(child_ref,ChildRef):
raise ValueError("expecting ChildRef instance")
@ -365,8 +365,8 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
Removes the database handle for L{Person} to the Family's list
of children if the L{Person} is already in the list.
@param person_handle: L{Person} database handle
@type person_handle: str
@param child_ref: Child Reference instance
@type child_ref: ChildRef
@return: True if the handle was removed, False if it was not
in the list.
@rtype: bool
@ -382,8 +382,8 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
Removes the database handle for L{Person} to the Family's list
of children if the L{Person} is already in the list.
@param person_handle: L{Person} database handle
@type person_handle: str
@param child_handle: L{Person} database handle
@type child_handle: str
@return: True if the handle was removed, False if it was not
in the list.
@rtype: bool
@ -394,10 +394,10 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
def get_child_ref_list(self):
"""
Returns the list of L{Person} handles identifying the children
Returns the list of L{ChildRef} handles identifying the children
of the Family.
@return: Returns the list of L{Person} handles assocated with
@return: Returns the list of L{ChildRef} handles assocated with
the Family.
@rtype: list
"""
@ -407,9 +407,9 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
"""
Assigns the passed list to the Family's list children.
@param child_list: List of L{Person} handles to ba associated
as the Family's list of children.
@type child_list: list of L{Person} handles
@param child_ref_list: List of Child Reference instances to be
associated as the Family's list of children.
@type child_ref_list: list of L{ChildRef} instances
"""
self.child_ref_list = child_ref_list

View File

@ -425,7 +425,7 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
@param event_ref: the L{EventRef} object associated with
the Person's birth.
@type event_handle: EventRef
@type event_ref: EventRef
"""
if event_ref and not isinstance(event_ref, EventRef):
raise ValueError("Expecting EventRef instance")
@ -446,7 +446,7 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
@param event_ref: the L{EventRef} object associated with
the Person's death.
@type event_handle: EventRef
@type event_ref: EventRef
"""
if event_ref and not isinstance(event_ref, EventRef):
raise ValueError("Expecting EventRef instance")
@ -736,7 +736,7 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
"""
Sets the Person instance's L{PersonRef} list to the passed list.
@param event_ref_list: List of valid L{PersonRef} objects
@type event_ref_list: list
@param person_ref_list: List of valid L{PersonRef} objects
@type person_ref_list: list
"""
self.person_ref_list = person_ref_list

View File

@ -286,11 +286,12 @@ class Place(PrimaryObject,SourceBase,NoteBase,MediaBase,UrlBase):
This includes the information that is used for display and for sorting.
Returns a list consisting of 13 strings. These are:
Place Title, Place ID, Main Location Parish, Main Location County,
Main Location City, Main Location State/Province,
Main Location Country, upper case Place Title, upper case Parish,
upper case city, upper case county, upper case state,
upper case country
Place Title, Place ID, Main Location Parish, Main Location County,
Main Location City, Main Location State/Province,
Main Location Country, upper case Place Title, upper case Parish,
upper case city, upper case county, upper case state,
upper case country
"""
if self.main_loc:

View File

@ -131,8 +131,8 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
def set_type(self,the_type):
"""
@param type: descriptive type of the Repository
@type type: str
@param the_type: descriptive type of the Repository
@type the_type: str
"""
self.type.set(the_type)

View File

@ -97,8 +97,8 @@ class Url(SecondaryObject,PrivacyBase):
def set_type(self,the_type):
"""
@param type: descriptive type of the Url
@type type: str
@param the_type: descriptive type of the Url
@type the_type: str
"""
self.type.set(the_type)

View File

@ -96,8 +96,8 @@ class UrlBase:
If the instance does not exist in the list, the operation has
no effect.
@param attribute: L{Url} instance to remove from the list
@type attribute: L{Url}
@param url: L{Url} instance to remove from the list
@type url: L{Url}
@return: True if the url was removed, False if it was not in the list.
@rtype: bool