pep8 fixes

fixing typos


svn: r12934
This commit is contained in:
Raphael Ackermann 2009-08-09 17:09:32 +00:00
parent ce53145dfe
commit 65f72560d1
32 changed files with 153 additions and 149 deletions

View File

@ -142,7 +142,7 @@ class MediaView(PageView.ListView):
"""
Provide the drag_data_get function, which passes a tuple consisting of:
1) Drag type defined by the .drag_type field specfied by the value
1) Drag type defined by the .drag_type field specified by the value
assigned to _DND_TYPE
2) The id value of this object, used for the purpose of determining
the source of the object. If the source of the object is the same

View File

@ -25,7 +25,7 @@
Date editing module for GRAMPS.
The DateEdit.DateEdit provides visual feedback to the user via a pixamp
to indicate if the assocated GtkEntry box contains a valid date. Green
to indicate if the associated GtkEntry box contains a valid date. Green
means complete and regular date. Yellow means a valid, but not a regular date.
Red means that the date is not valid, and will be viewed as a text string
instead of a date.

View File

@ -80,10 +80,10 @@ LANG_TO_DISPLAY = {
def register_datehandler(locales,parse_class,display_class):
"""
Registers the passed date parser class and date displayer
classes with the specfied language locales.
classes with the specified language locales.
@param locales: tuple of strings containing language codes.
The character encoding is not included, so the langauge
The character encoding is not included, so the language
should be in the form of fr_FR, not fr_FR.utf8
@type locales: tuple
@param parse_class: Class to be associated with parsing

View File

@ -189,7 +189,7 @@ class EmbeddedList(ButtonTab):
"""
Provide the drag_data_get function, which passes a tuple consisting of:
1) Drag type defined by the .drag_type field specfied by the value
1) Drag type defined by the .drag_type field specified by the value
assigned to _DND_TYPE
2) The id value of this object, used for the purpose of determining
the source of the object. If the source of the object is the same

View File

@ -370,7 +370,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
"""
Provide the drag_data_get function, which passes a tuple consisting of:
1) Drag type defined by the .drag_type field specfied by the value
1) Drag type defined by the .drag_type field specified by the value
assigned to _DND_TYPE
2) The id value of this object, used for the purpose of determining
the source of the object. If the source of the object is the same

View File

@ -123,7 +123,7 @@ class GroupEmbeddedList(EmbeddedList):
"""
Provide the drag_data_get function, which passes a tuple consisting of:
1) Drag type defined by the .drag_type field specfied by the value
1) Drag type defined by the .drag_type field specified by the value
assigned to _DND_TYPE
2) The id value of this object, used for the purpose of determining
the source of the object. If the source of the object is the same

View File

@ -2753,7 +2753,7 @@ class GedcomParser(UpdateCallback):
"""
Parse the place portion of a event. A special case has to be made for
Family Tree Maker, which violates the GEDCOM spec. It uses the PLAC
field to store the description or value assocated with the event.
field to store the description or value associated with the event.
n PLAC <PLACE_VALUE> {1:1}
+1 FORM <PLACE_HIERARCHY> {0:1}

View File

@ -49,7 +49,7 @@ class LRU(object):
def __getitem__(self, obj):
"""
Return item assocated with Obj
Return item associated with Obj
"""
return self.data[obj].value[1]

View File

@ -60,7 +60,7 @@ def _is_good_command(cmd):
return True
def get_description(type):
"""Return the description of the specfied mime type"""
"""Return the description of the specified mime type"""
try:
return mime_get_description(type)
except:

View File

@ -49,7 +49,7 @@ def get_application(mime_type):
return None
def get_description(mime_type):
"""Return the description of the specfied mime type"""
"""Return the description of the specified mime type"""
return _type_map.get(mime_type,_("unknown"))
def get_type(filename):

View File

@ -165,7 +165,7 @@ class OptionListCollection(object):
def set_option_list(self, name, option_list):
"""
Add or replaces an option_list in the OptionListCollection.
@param name: name assocated with the module to add or replace.
@param name: name associated with the module to add or replace.
@type name: str
@param option_list: list of options
@type option_list: str

View File

@ -178,7 +178,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
name, require_active)
def build_plugin_tree(self, item_list, categories):
"""Populates a GtkTree with each menu item assocated with a entry
"""Populates a GtkTree with each menu item associated with a entry
in the lists. The list must consist of a tuples with the following
format:

View File

@ -31,7 +31,7 @@ import _PluginWindows as PluginWindows
# This needs to go above Tool and MenuOption as it needs both
class MenuToolOptions(GuiMenuOptions,Tool.ToolOptions):
"""
The MenuToolOptions class implementes the ToolOptions
The MenuToolOptions class implements the ToolOptions
functionality in a generic way so that the user does not need to
be concerned with the graphical representation of the options.

View File

@ -577,7 +577,7 @@ class OptionHandler(_Options.OptionHandler):
Specific initialization for reports.
"""
# These are needed for running reports.
# We will not need to save/retreive them, just keep around.
# We will not need to save/retrieve them, just keep around.
self.doc = EmptyDoc() # Nasty hack. Text reports replace this
self.output = None
@ -795,7 +795,7 @@ class ReportOptions(_Options.Options):
class MenuReportOptions(GuiMenuOptions, ReportOptions):
"""
The MenuReportOptions class implementes the ReportOptions
The MenuReportOptions class implements the ReportOptions
functionality in a generic way so that the user does not need to
be concerned with the graphical representation of the options.

View File

@ -636,9 +636,9 @@ class SimpleAccess(object):
@param obj: Person or Family
@type obj: L{gen.lib.Person} or L{gen.lib.Family}
@param restrict: Optional list of strings that will limit the types
of events to those of the specfied types.
of events to those of the specified types.
@type restrict: list
@return: list of events assocated with the object
@return: list of events associated with the object
@rtype: list
"""
assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, NoneType)))
@ -663,7 +663,7 @@ class SimpleAccess(object):
@param obj: Person or Family
@type obj: L{gen.lib.Person} or L{gen.lib.Family}
@return: list of events assocated with the object
@return: list of events associated with the object
@rtype: list
"""
assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, gen.lib.Event, NoneType)))

View File

@ -56,9 +56,9 @@ from ReportBase import CATEGORY_BOOK, CATEGORY_CODE, cl_report
#-------------------------------------------------------------------------
class ArgHandler(object):
"""
This class is responsible for the non GUI handling of commands
This class is responsible for the non GUI handling of commands.
The handler is passed a parser object, sanitizes it, and can execute the
actions requested working on a DbState
actions requested working on a DbState.
"""
def __init__(self, dbstate, parser, sessionmanager,
@ -89,7 +89,7 @@ class ArgHandler(object):
def __error(self, string):
"""
Output an error. Uses errorfunc if given, otherwise a simple print
Output an error. Uses errorfunc if given, otherwise a simple print.
"""
if self.errorfunc:
self.errorfunc(string)
@ -101,12 +101,12 @@ class ArgHandler(object):
#-------------------------------------------------------------------------
def sanitize_args(self, importlist, exportlist):
"""
check the lists with open, exports, imports, and actions options.
Check the lists with open, exports, imports, and actions options.
"""
for (value, format) in importlist:
self.__handle_import_option(value, format)
for (value, format) in exportlist:
self.__handle_export_option(value, format)
for (value, family_tree_format) in importlist:
self.__handle_import_option(value, family_tree_format)
for (value, family_tree_format) in exportlist:
self.__handle_export_option(value, family_tree_format)
def __handle_open_option(self, value):
"""
@ -129,10 +129,10 @@ class ArgHandler(object):
"import into a family tree instead.") % value)
sys.exit(0)
def __handle_import_option(self, value, format):
def __handle_import_option(self, value, family_tree_format):
"""
Handle the "-i" or "--import" option.
Only Files supported by a plugin can be imported, so not Family Trees
Only Files supported by a plugin can be imported, so not Family Trees.
"""
fname = value
fullpath = os.path.abspath(os.path.expanduser(fname))
@ -140,31 +140,31 @@ class ArgHandler(object):
self.__error(_('Error: Import file %s not found.') % fname)
sys.exit(0)
if format is None:
if family_tree_format is None:
# Guess the file format based on the file extension.
# This will get the lower case extension without a period,
# or an empty string.
format = os.path.splitext(fname)[-1][1:].lower()
family_tree_format = os.path.splitext(fname)[-1][1:].lower()
pmgr = PluginManager.get_instance()
plugin_found = False
for plugin in pmgr.get_import_plugins():
if format == plugin.get_extension():
if family_tree_format == plugin.get_extension():
plugin_found = True
if plugin_found:
self.imports.append((fname, format))
self.imports.append((fname, family_tree_format))
else:
self.__error(_('Error: Unrecognized type: "%(format)s" for '
'import file: %(filename)s') \
% {'format' : format,
% {'format' : family_tree_format,
'filename' : fname})
sys.exit(0)
def __handle_export_option(self, value, format):
def __handle_export_option(self, value, family_tree_format):
"""
Handle the "-e" or "--export" option.
Note: this can only happen in the CLI version
Note: this can only happen in the CLI version.
"""
if self.gui:
return
@ -183,20 +183,20 @@ class ArgHandler(object):
else:
sys.exit(0)
if format is None:
if family_tree_format is None:
# Guess the file format based on the file extension.
# This will get the lower case extension without a period,
# or an empty string.
format = os.path.splitext(fname)[-1][1:].lower()
family_tree_format = os.path.splitext(fname)[-1][1:].lower()
pmgr = PluginManager.get_instance()
plugin_found = False
for plugin in pmgr.get_export_plugins():
if format == plugin.get_extension():
if family_tree_format == plugin.get_extension():
plugin_found = True
if plugin_found:
self.exports.append((fullpath, format))
self.exports.append((fullpath, family_tree_format))
else:
self.__error(_("ERROR: Unrecognized format for export file %s")
% fname)
@ -231,7 +231,7 @@ class ArgHandler(object):
def handle_args_gui(self):
"""
method to handle the arguments that can be given for a GUI session.
Returns the filename of the family tree that should be openend if
Returns the filename of the family tree that should be opened if
user just passed a famtree or a filename
1/no options: a family tree can be given, if so, this name is tested
and returned. If a filename, it is imported in a new db
@ -399,13 +399,13 @@ class ArgHandler(object):
# Import handler
#
#-------------------------------------------------------------------------
def cl_import(self, filename, format):
def cl_import(self, filename, family_tree_format):
"""
Command-line import routine. Try to import filename using the format.
Command-line import routine. Try to import filename using the family_tree_format.
"""
pmgr = PluginManager.get_instance()
for plugin in pmgr.get_import_plugins():
if format == plugin.get_extension():
if family_tree_format == plugin.get_extension():
import_function = plugin.get_import_function()
import_function(self.dbstate.db, filename, None)
@ -420,14 +420,14 @@ class ArgHandler(object):
# Export handler
#
#-------------------------------------------------------------------------
def cl_export(self, filename, format):
def cl_export(self, filename, family_tree_format):
"""
Command-line export routine.
Try to write into filename using the format.
Try to write into filename using the family_tree_format.
"""
pmgr = PluginManager.get_instance()
for plugin in pmgr.get_export_plugins():
if format == plugin.get_extension():
if family_tree_format == plugin.get_extension():
export_function = plugin.get_export_function()
export_function(self.dbstate.db, filename)

View File

@ -59,7 +59,7 @@ Application options
-O, --open=FAMILY_TREE Open family tree
-i, --import=FILENAME Import file
-e, --export=FILENAME Export file
-f, --format=FORMAT Specify format
-f, --format=FORMAT Specify family tree format
-a, --action=ACTION Specify action
-p, --options=OPTIONS_STRING Specify options
-d, --debug=LOGGER_NAME Enable debug logs
@ -80,14 +80,14 @@ class ArgParser(object):
Possible:
1/ FAMTREE : Just the family tree (name or database dir)
2/ -O, --open=FAMTREE, Open of a family tree
3/ -i, --import=FILE, Import of any format understood by an importer, optionally
provide- f to indicate format
4/ -e, --export=FILE, export a family tree in required format, optionally provide
-f to indicate format
3/ -i, --import=FILE, Import a family tree of any format understood by an
importer, optionally provide- f to indicate format
4/ -e, --export=FILE, export a family tree in required format, optionally
provide -f to indicate format
5/ -f, --format=FORMAT : format after a -i or -e option
5/ -a, --action: An action (possible: 'check', 'summary', 'report',
6/ -a, --action: An action (possible: 'check', 'summary', 'report',
'tool')
6/ -u, --force-unlock: A locked database can be unlocked by giving this
7/ -u, --force-unlock: A locked database can be unlocked by giving this
argument when opening it
If the filename (no flags) is specified, the interactive session is
@ -108,7 +108,7 @@ class ArgParser(object):
def __init__(self, args):
"""
pass the command line arguments on creation
Pass the command line arguments on creation.
"""
self.args = args
@ -137,14 +137,15 @@ class ArgParser(object):
Possible:
1/ Just the family tree (name or database dir)
2/ -O, Open of a family tree
3/ -i, Import of any format understood by an importer, optionally
provide-f to indicate format
4/ -e, export a family tree in required format, optionally provide
2/ -O, --open: Open of a family tree
3/ -i, --import: Import a family tree of any format understood by an importer,
optionally provide-f to indicate format
4/ -e, --export: export a family tree in required format, optionally provide
-f to indicate format
5/ -a, --action: An action (possible: 'check', 'summary', 'report',
5/ -f, --format=FORMAT : format after a -i or -e option
6/ -a, --action: An action (possible: 'check', 'summary', 'report',
'tool')
6/ -u, --force-unlock: A locked database can be unlocked by giving this
7/ -u, --force-unlock: A locked database can be unlocked by giving this
argument when opening it
"""
@ -179,17 +180,17 @@ class ArgParser(object):
if option in ( '-O', '--open'):
self.open = value
elif option in ( '-i', '--import'):
format = None
family_tree_format = None
if opt_ix < len(options) - 1 \
and options[opt_ix + 1][0] in ( '-f', '--format'):
format = options[opt_ix + 1][1]
self.imports.append((value, format))
family_tree_format = options[opt_ix + 1][1]
self.imports.append((value, family_tree_format))
elif option in ( '-e', '--export' ):
format = None
family_tree_format = None
if opt_ix < len(options) - 1 \
and options[opt_ix + 1][0] in ( '-f', '--format'):
format = options[opt_ix + 1][1]
self.exports.append((value, format))
family_tree_format = options[opt_ix + 1][1]
self.exports.append((value, family_tree_format))
elif option in ( '-a', '--action' ):
action = value
if action not in ( 'check', 'summary', 'report', 'tool' ):
@ -258,7 +259,7 @@ class ArgParser(object):
def print_help(self):
"""
If the user gives the --help or -h option, print the output to terminal
If the user gives the --help or -h option, print the output to terminal.
"""
if self.help:
print _HELP

View File

@ -1669,7 +1669,7 @@ class GrampsDbBase(Callback):
def transaction_commit(self, transaction, msg):
"""
Commit the transaction to the assocated UNDO database.
Commit the transaction to the associated UNDO database.
"""
if self._LOG_ALL:
LOG.debug("%s: Transaction commit '%s'\n"
@ -2009,28 +2009,28 @@ class GrampsDbBase(Callback):
def get_person_event_types(self):
"""
Return a list of all Event types assocated with Person instances in
Return a list of all Event types associated with Person instances in
the database.
"""
return list(self.individual_event_names)
def get_person_attribute_types(self):
"""
Return a list of all Attribute types assocated with Person instances
Return a list of all Attribute types associated with Person instances
in the database.
"""
return list(self.individual_attributes)
def get_family_attribute_types(self):
"""
Return a list of all Attribute types assocated with Family instances
Return a list of all Attribute types associated with Family instances
in the database.
"""
return list(self.family_attributes)
def get_family_event_types(self):
"""
Return a list of all Event types assocated with Family instances in
Return a list of all Event types associated with Family instances in
the database.
"""
return list(self.family_event_names)
@ -2043,63 +2043,63 @@ class GrampsDbBase(Callback):
def get_media_attribute_types(self):
"""
Return a list of all Attribute types assocated with Media and MediaRef
Return a list of all Attribute types associated with Media and MediaRef
instances in the database.
"""
return list(self.media_attributes)
def get_family_relation_types(self):
"""
Return a list of all relationship types assocated with Family
Return a list of all relationship types associated with Family
instances in the database.
"""
return list(self.family_rel_types)
def get_child_reference_types(self):
"""
Return a list of all child reference types assocated with Family
Return a list of all child reference types associated with Family
instances in the database.
"""
return list(self.child_ref_types)
def get_event_roles(self):
"""
Return a list of all custom event role names assocated with Event
Return a list of all custom event role names associated with Event
instances in the database.
"""
return list(self.event_role_names)
def get_name_types(self):
"""
Return a list of all custom names types assocated with Person
Return a list of all custom names types associated with Person
instances in the database.
"""
return list(self.name_types)
def get_repository_types(self):
"""
Return a list of all custom repository types assocated with Repository
Return a list of all custom repository types associated with Repository
instances in the database.
"""
return list(self.repository_types)
def get_note_types(self):
"""
Return a list of all custom note types assocated with Note instances
Return a list of all custom note types associated with Note instances
in the database.
"""
return list(self.note_types)
def get_source_media_types(self):
"""
Return a list of all custom source media types assocated with Source
Return a list of all custom source media types associated with Source
instances in the database.
"""
return list(self.source_media_types)
def get_url_types(self):
"""
Return a list of all custom names types assocated with Url instances
Return a list of all custom names types associated with Url instances
in the database.
"""
return list(self.url_types)

View File

@ -425,7 +425,7 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
Return the list of :class:`~gen.lib.childref.ChildRef` handles identifying the children of the
Family.
:returns: Returns the list of :class:`~gen.lib.childref.ChildRef` handles assocated with
:returns: Returns the list of :class:`~gen.lib.childref.ChildRef` handles associated with
the Family.
:rtype: list
"""

View File

@ -243,11 +243,11 @@ class LdsOrd(SecondaryObject, SourceBase, NoteBase,
return self.status
def set_temple(self, temple):
"""Set the temple assocated with the ordinance."""
"""Set the temple associated with the ordinance."""
self.temple = temple
def get_temple(self):
"""Get the temple assocated with the ordinance."""
"""Get the temple associated with the ordinance."""
return self.temple
def is_empty(self):

View File

@ -59,7 +59,7 @@ class PlaceBase(object):
def get_place_handle(self):
"""
Return the database handle of the :class:`~gen.lib.place.Place` assocated with the Event.
Return the database handle of the :class:`~gen.lib.place.Place` associated with the Event.
:returns: :class:`~gen.lib.place.Place` database handle
:rtype: str

View File

@ -79,7 +79,7 @@ class SourceBase(object):
"""
Return the list of source references associated with the object.
:returns: Returns the list of :class:`~gen.lib.srcref.SourceRef` objects assocated with
:returns: Returns the list of :class:`~gen.lib.srcref.SourceRef` objects associated with
the object.
:rtype: list
"""

View File

@ -22,7 +22,7 @@
"""
The core of the GRAMPS plugin system. This module provides capability to load
plugins from specfied directories and provide information about the loaded
plugins from specified directories and provide information about the loaded
plugins.
Plugins are divided into several categories. These are: reports, tools,
@ -567,6 +567,6 @@ class PluginManager(gen.utils.Callback):
def get_relationship_calculator(self):
"""
Return the relationship calculator for the current language
Return the relationship calculator for the current language.
"""
return self.__relcalc_class()

View File

@ -137,7 +137,7 @@ class StyleSheetList(object):
Add or replaces a StyleSheet in the StyleSheetList. The
default style may not be replaced.
name - name assocated with the StyleSheet to add or replace.
name - name associated with the StyleSheet to add or replace.
style - definition of the StyleSheet
"""
style.set_name(name)

View File

@ -555,49 +555,49 @@ class DbBase(object):
def get_number_of_people(self):
"""
Return the number of people currently in the databse.
Return the number of people currently in the database.
"""
raise NotImplementedError
def get_number_of_families(self):
"""
Return the number of families currently in the databse.
Return the number of families currently in the database.
"""
raise NotImplementedError
def get_number_of_events(self):
"""
Return the number of events currently in the databse.
Return the number of events currently in the database.
"""
raise NotImplementedError
def get_number_of_places(self):
"""
Return the number of places currently in the databse.
Return the number of places currently in the database.
"""
raise NotImplementedError
def get_number_of_sources(self):
"""
Return the number of sources currently in the databse.
Return the number of sources currently in the database.
"""
raise NotImplementedError
def get_number_of_media_objects(self):
"""
Return the number of media objects currently in the databse.
Return the number of media objects currently in the database.
"""
raise NotImplementedError
def get_number_of_repositories(self):
"""
Return the number of source repositories currently in the databse.
Return the number of source repositories currently in the database.
"""
raise NotImplementedError
def get_number_of_notes(self):
"""
Return the number of notes currently in the databse.
Return the number of notes currently in the database.
"""
raise NotImplementedError
@ -806,7 +806,7 @@ class DbBase(object):
def transaction_commit(self, transaction, msg):
"""
Commits the transaction to the assocated UNDO database.
Commits the transaction to the associated UNDO database.
"""
raise NotImplementedError
@ -944,22 +944,22 @@ class DbBase(object):
raise NotImplementedError
def get_person_event_types(self):
"""returns a list of all Event types assocated with Person
"""returns a list of all Event types associated with Person
instances in the database"""
raise NotImplementedError
def get_person_attribute_types(self):
"""returns a list of all Attribute types assocated with Person
"""returns a list of all Attribute types associated with Person
instances in the database"""
raise NotImplementedError
def get_family_attribute_types(self):
"""returns a list of all Attribute types assocated with Family
"""returns a list of all Attribute types associated with Family
instances in the database"""
raise NotImplementedError
def get_family_event_types(self):
"""returns a list of all Event types assocated with Family
"""returns a list of all Event types associated with Family
instances in the database"""
raise NotImplementedError
@ -968,47 +968,47 @@ class DbBase(object):
raise NotImplementedError
def get_media_attribute_types(self):
"""returns a list of all Attribute types assocated with Media
"""returns a list of all Attribute types associated with Media
and MediaRef instances in the database"""
raise NotImplementedError
def get_family_relation_types(self):
"""returns a list of all relationship types assocated with Family
"""returns a list of all relationship types associated with Family
instances in the database"""
raise NotImplementedError
def get_child_reference_types(self):
"""returns a list of all child reference types assocated with Family
"""returns a list of all child reference types associated with Family
instances in the database"""
raise NotImplementedError
def get_event_roles(self):
"""returns a list of all custom event role names assocated with Event
"""returns a list of all custom event role names associated with Event
instances in the database"""
raise NotImplementedError
def get_name_types(self):
"""returns a list of all custom names types assocated with Person
"""returns a list of all custom names types associated with Person
instances in the database"""
raise NotImplementedError
def get_repository_types(self):
"""returns a list of all custom repository types assocated with
"""returns a list of all custom repository types associated with
Repository instances in the database"""
raise NotImplementedError
def get_note_types(self):
"""returns a list of all custom note types assocated with
"""returns a list of all custom note types associated with
Note instances in the database"""
raise NotImplementedError
def get_source_media_types(self):
"""returns a list of all custom source media types assocated with
"""returns a list of all custom source media types associated with
Source instances in the database"""
raise NotImplementedError
def get_url_types(self):
"""returns a list of all custom names types assocated with Url
"""returns a list of all custom names types associated with Url
instances in the database"""
raise NotImplementedError

View File

@ -249,49 +249,49 @@ class ProxyDbBase(DbBase):
def get_number_of_people(self):
"""
Return the number of people currently in the databse.
Return the number of people currently in the database.
"""
return self.db.get_number_of_people()
def get_number_of_families(self):
"""
Return the number of families currently in the databse.
Return the number of families currently in the database.
"""
return self.db.get_number_of_families()
def get_number_of_events(self):
"""
Return the number of events currently in the databse.
Return the number of events currently in the database.
"""
return self.db.get_number_of_events()
def get_number_of_places(self):
"""
Return the number of places currently in the databse.
Return the number of places currently in the database.
"""
return self.db.get_number_of_places()
def get_number_of_sources(self):
"""
Return the number of sources currently in the databse.
Return the number of sources currently in the database.
"""
return self.db.get_number_of_sources()
def get_number_of_media_objects(self):
"""
Return the number of media objects currently in the databse.
Return the number of media objects currently in the database.
"""
return self.db.get_number_of_media_objects()
def get_number_of_repositories(self):
"""
Return the number of source repositories currently in the databse.
Return the number of source repositories currently in the database.
"""
return self.db.get_number_of_repositories()
def get_number_of_notes(self):
"""
Return the number of notes currently in the databse.
Return the number of notes currently in the database.
"""
return self.db.get_number_of_notes()
@ -300,22 +300,22 @@ class ProxyDbBase(DbBase):
return self.db.get_save_path()
def get_person_event_types(self):
"""returns a list of all Event types assocated with Person
"""returns a list of all Event types associated with Person
instances in the database"""
return self.db.get_person_event_types()
def get_person_attribute_types(self):
"""returns a list of all Attribute types assocated with Person
"""returns a list of all Attribute types associated with Person
instances in the database"""
return self.db.get_person_attribute_types()
def get_family_attribute_types(self):
"""returns a list of all Attribute types assocated with Family
"""returns a list of all Attribute types associated with Family
instances in the database"""
return self.db.get_family_attribute_types()
def get_family_event_types(self):
"""returns a list of all Event types assocated with Family
"""returns a list of all Event types associated with Family
instances in the database"""
return self.db.get_family_event_types()
@ -324,47 +324,47 @@ class ProxyDbBase(DbBase):
return self.db.get_marker_types()
def get_media_attribute_types(self):
"""returns a list of all Attribute types assocated with Media
"""returns a list of all Attribute types associated with Media
and MediaRef instances in the database"""
return self.db.get_media_attribute_types()
def get_family_relation_types(self):
"""returns a list of all relationship types assocated with Family
"""returns a list of all relationship types associated with Family
instances in the database"""
return self.db.get_family_relation_types()
def get_child_reference_types(self):
"""returns a list of all child reference types assocated with Family
"""returns a list of all child reference types associated with Family
instances in the database"""
return self.db.get_child_reference_types()
def get_event_roles(self):
"""returns a list of all custom event role names assocated with Event
"""returns a list of all custom event role names associated with Event
instances in the database"""
return self.db.get_event_roles()
def get_name_types(self):
"""returns a list of all custom names types assocated with Person
"""returns a list of all custom names types associated with Person
instances in the database"""
return self.db.get_name_types()
def get_repository_types(self):
"""returns a list of all custom repository types assocated with
"""returns a list of all custom repository types associated with
Repository instances in the database"""
return self.db.get_repository_types()
def get_note_types(self):
"""returns a list of all custom note types assocated with
"""returns a list of all custom note types associated with
Note instances in the database"""
return self.db.get_note_types()
def get_source_media_types(self):
"""returns a list of all custom source media types assocated with
"""returns a list of all custom source media types associated with
Source instances in the database"""
return self.db.get_source_media_types()
def get_url_types(self):
"""returns a list of all custom names types assocated with Url
"""returns a list of all custom names types associated with Url
instances in the database"""
return self.db.get_url_types()

View File

@ -550,7 +550,7 @@ class DbManager(CLIDbManager):
def __really_delete_db(self):
"""
Delete the selected database. If the databse is open, close it first.
Delete the selected database. If the database is open, close it first.
Then scan the database directory, deleting the files, and finally
removing the directory.
"""
@ -581,7 +581,7 @@ class DbManager(CLIDbManager):
def __really_delete_version(self):
"""
Delete the selected database. If the databse is open, close it first.
Delete the selected database. If the database is open, close it first.
Then scan the database directory, deleting the files, and finally
removing the directory.
"""
@ -732,7 +732,7 @@ def drop_cb(wid, context, xpos, ypos, time_stamp):
def find_revisions(name):
"""
Finds all the revisions of the specfied RCS archive.
Finds all the revisions of the specified RCS archive.
"""
import re

View File

@ -194,7 +194,7 @@ class BookItem(object):
"""
Create a new empty BookItem.
name: the book item is retreived
name: the book item is retrieved
from the book item registry using name for lookup
"""
self.dbase = dbase
@ -413,7 +413,7 @@ class BookList(object):
"""
Add or replaces a Book in the BookList.
name: name assocated with the Book to add or replace.
name: name associated with the Book to add or replace.
book: definition of the Book
"""
self.bookmap[name] = book

View File

@ -408,7 +408,7 @@ class GedcomWriter(BasicUtils.UpdateCallback):
def write_gedcom_file(self, filename):
"""
Write the actual GEDCOM file to the specfied filename.
Write the actual GEDCOM file to the specified filename.
"""
self.dirname = os.path.dirname (filename)
@ -1021,7 +1021,7 @@ class GedcomWriter(BasicUtils.UpdateCallback):
def __family_event_attrs(self, attr_list, level):
"""
Write the attributes assocated with the family event.
Write the attributes associated with the family event.
The only ones we really care about are FATHER_AGE and MOTHER_AGE which
we translate to WIFE/HUSB AGE attributes.

View File

@ -106,7 +106,7 @@ class AncestorReport(Report):
# which is passed to the routine.
self.map[index] = person_handle
# retreive the Person instance from the database from the
# retrieve the Person instance from the database from the
# passed person_handle and find the parents from the list.
# Since this report is for natural parents (birth parents),
# we have to handle that parents may not

View File

@ -22,7 +22,9 @@
# $Id$
"""Reports/Text Reports/Descendant Report"""
"""
Reports/Text Reports/Descendant Report
"""
#------------------------------------------------------------------------
#
@ -63,7 +65,6 @@ class DescendantReport(Report):
The arguments are:
database - the GRAMPS database instance
person - currently selected person
options_class - instance of the Options class for this report
This report needs the following parameters (class variables)

View File

@ -21,7 +21,9 @@
# $Id$
"""Reports/Text Reports/Summary of the Database"""
"""
Reports/Text Reports/Database Summary Report.
"""
#------------------------------------------------------------------------
#
@ -61,7 +63,6 @@ class SummaryReport(Report):
The arguments are:
database - the GRAMPS database instance
person - currently selected person
options_class - instance of the Options class for this report
"""
@ -200,7 +201,7 @@ class SummaryReport(Report):
Write a summary of all the media in the database.
"""
total_media = 0
bytes = 0
size_in_bytes = 0
notfound = []
self.doc.start_paragraph("SR-Heading")
@ -211,8 +212,9 @@ class SummaryReport(Report):
for media_id in self.__db.get_media_object_handles():
media = self.__db.get_object_from_handle(media_id)
try:
bytes = bytes + posixpath.getsize(media_path_full(self.__db,
media.get_path()))
size_in_bytes = size_in_bytes + posixpath.getsize(
media_path_full(self.__db,
media.get_path()))
except:
notfound.append(media.get_path())
@ -222,7 +224,7 @@ class SummaryReport(Report):
self.doc.end_paragraph()
self.doc.start_paragraph("SR-Normal")
self.doc.write_text(_("Total size of media objects: %d bytes") % bytes)
self.doc.write_text(_("Total size of media objects: %d bytes") % size_in_bytes)
self.doc.end_paragraph()
if len(notfound) > 0: