From 9aee82d6d02111ee6303565e43ec403380bf3c4e Mon Sep 17 00:00:00 2001 From: Raphael Ackermann Date: Mon, 18 Feb 2008 15:52:40 +0000 Subject: [PATCH] 2008-02-18 Raphael Ackermann * src/DataViews/EventView.py * src/DataViews/FamilyList.py * src/DataViews/PedigreeView.py * src/DataViews/PersonView.py * src/GrampsCfg.py * src/Editors/_EditPrimary.py * src/DisplayTabs/_EmbeddedList.py * src/DisplayTabs/_BackRefList.py * src/plugins/RelCalc.py * src/QuickReports.py * src/Relationship.py * src/Selectors/_BaseSelector.py * src/GrampsWidgets.py * src/DbManager.py * src/DisplayState.py * src/DisplayModels/_BaseModel.py * src/DisplayModels/_PeopleModel.py * src/GrampsDbUtils/_GrampsDbWriteXML.py * src/gramps_main.py * src/Filters/Rules/_MatchesFilterBase.py * src/ManagedWindow.py pep8 updates. replace ''' with """ for comments * src/GrampsDbUtils/_WriteGedcom.py: doc fixes added support for exportin source, notes and repos that are not linked to other records. 0001707: export to gedcom doesn't include source, if source is the only thing in the db svn: r10051 --- src/DataViews/EventView.py | 4 +- src/DataViews/FamilyList.py | 4 +- src/DataViews/PedigreeView.py | 2 +- src/DataViews/PersonView.py | 4 +- src/DbManager.py | 16 +- src/DisplayModels/_BaseModel.py | 12 +- src/DisplayModels/_PeopleModel.py | 12 +- src/DisplayState.py | 12 +- src/DisplayTabs/_BackRefList.py | 4 +- src/DisplayTabs/_EmbeddedList.py | 8 +- src/Editors/_EditPrimary.py | 4 +- src/Filters/Rules/_MatchesFilterBase.py | 4 +- src/GrampsCfg.py | 8 +- src/GrampsDbUtils/_GrampsDbWriteXML.py | 4 +- src/GrampsDbUtils/_WriteGedcom.py | 407 +++++++++++++----------- src/GrampsWidgets.py | 92 +++--- src/ManagedWindow.py | 4 +- src/QuickReports.py | 4 +- src/Relationship.py | 14 +- src/Selectors/_BaseSelector.py | 10 +- src/gramps_main.py | 6 +- src/plugins/RelCalc.py | 4 +- 22 files changed, 329 insertions(+), 310 deletions(-) diff --git a/src/DataViews/EventView.py b/src/DataViews/EventView.py index 7c705d9f2..69ad4516b 100644 --- a/src/DataViews/EventView.py +++ b/src/DataViews/EventView.py @@ -262,9 +262,9 @@ class EventView(PageView.ListView): pass def dummy_report(self, obj): - ''' For the xml UI definition of popup to work, the submenu + """ For the xml UI definition of popup to work, the submenu Quick Report must have an entry in the xml As this submenu will be dynamically built, we offer a dummy action - ''' + """ pass diff --git a/src/DataViews/FamilyList.py b/src/DataViews/FamilyList.py index 8ba2136f2..97dbc0224 100644 --- a/src/DataViews/FamilyList.py +++ b/src/DataViews/FamilyList.py @@ -219,8 +219,8 @@ class FamilyListView(PageView.ListView): pass def dummy_report(self, obj): - ''' For the xml UI definition of popup to work, the submenu + """ For the xml UI definition of popup to work, the submenu Quick Report must have an entry in the xml As this submenu will be dynamically built, we offer a dummy action - ''' + """ pass diff --git a/src/DataViews/PedigreeView.py b/src/DataViews/PedigreeView.py index 100f51bfa..87be67f1e 100644 --- a/src/DataViews/PedigreeView.py +++ b/src/DataViews/PedigreeView.py @@ -287,7 +287,7 @@ class PersonBoxWidget( gtk.DrawingArea, _PersonWidget_base): self.set_size_request(max(xmin,120),max(ymin,25)) def on_enter_cb(self,widget,event): - ''' On mouse-over hightlight border''' + """ On mouse-over hightlight border""" self.border_gc.line_width = 3 self.queue_draw() diff --git a/src/DataViews/PersonView.py b/src/DataViews/PersonView.py index ccdd4f77d..deb086649 100644 --- a/src/DataViews/PersonView.py +++ b/src/DataViews/PersonView.py @@ -994,9 +994,9 @@ class PersonView(PageView.PersonNavView): ofile.close() def dummy_report(self, obj): - ''' For the xml UI definition of popup to work, the submenu + """ For the xml UI definition of popup to work, the submenu Quick Report must have an entry in the xml As this submenu will be dynamically built, we offer a dummy action - ''' + """ pass diff --git a/src/DbManager.py b/src/DbManager.py index c9cced604..4a871a04c 100644 --- a/src/DbManager.py +++ b/src/DbManager.py @@ -112,13 +112,13 @@ class CLIDbManager: self._populate_cli() def empty(self, val): - '''Callback that does nothing - ''' + """Callback that does nothing + """ pass def _populate_cli(self): - ''' Get the list of current names in the database dir - ''' + """ Get the list of current names in the database dir + """ # make the default directory if it does not exist dbdir = os.path.expanduser(Config.get(Config.DATABASE_PATH)) make_dbdir(dbdir) @@ -145,18 +145,18 @@ class CLIDbManager: self.current_names.sort() def family_tree(self, name): - '''Given a name, return None if name not existing or + """Given a name, return None if name not existing or filename, filetype, name if a known database name - ''' + """ for data in self.current_names: if data[0] == name: return data[1], 'x-directory/normal', name return None def family_tree_list(self): - '''Return a list of name, dirname of the known family trees - ''' + """Return a list of name, dirname of the known family trees + """ lst = [(x[0], x[1]) for x in self.current_names] return lst diff --git a/src/DisplayModels/_BaseModel.py b/src/DisplayModels/_BaseModel.py index 5cd297e5b..9838fa6ad 100644 --- a/src/DisplayModels/_BaseModel.py +++ b/src/DisplayModels/_BaseModel.py @@ -295,15 +295,15 @@ class BaseModel(gtk.GenericTreeModel): self.row_changed(index,node) def on_get_flags(self): - '''returns the GtkTreeModelFlags for this particular type of model''' + """returns the GtkTreeModelFlags for this particular type of model""" return gtk.TREE_MODEL_LIST_ONLY | gtk.TREE_MODEL_ITERS_PERSIST def on_get_n_columns(self): return 1 def on_get_path(self, node): - '''returns the tree path (a tuple of indices at the various - levels) for a particular node.''' + """returns the tree path (a tuple of indices at the various + levels) for a particular node.""" return self.node_map.get_path(node) def on_get_column_type(self,index): @@ -327,7 +327,7 @@ class BaseModel(gtk.GenericTreeModel): return u'' def on_iter_next(self, node): - '''returns the next node at this level of the tree''' + """returns the next node at this level of the tree""" return self.node_map.find_next_handle(node) def on_iter_children(self,node): @@ -337,7 +337,7 @@ class BaseModel(gtk.GenericTreeModel): return None def on_iter_has_child(self, node): - '''returns true if this node has children''' + """returns true if this node has children""" if node == None: return len(self.node_map) > 0 return False @@ -353,5 +353,5 @@ class BaseModel(gtk.GenericTreeModel): return None def on_iter_parent(self, node): - '''returns the parent of this node''' + """returns the parent of this node""" return None diff --git a/src/DisplayModels/_PeopleModel.py b/src/DisplayModels/_PeopleModel.py index 941704d06..c8036f0f2 100644 --- a/src/DisplayModels/_PeopleModel.py +++ b/src/DisplayModels/_PeopleModel.py @@ -417,15 +417,15 @@ class PeopleModel(gtk.GenericTreeModel): self.mapper.assign_data() def on_get_flags(self): - '''returns the GtkTreeModelFlags for this particular type of model''' + """returns the GtkTreeModelFlags for this particular type of model""" return gtk.TREE_MODEL_ITERS_PERSIST def on_get_n_columns(self): return len(PeopleModel.COLUMN_DEFS) def on_get_path(self, node): - '''returns the tree path (a tuple of indices at the various - levels) for a particular node.''' + """returns the tree path (a tuple of indices at the various + levels) for a particular node.""" return self.mapper.get_path(node) def is_visable(self, handle): @@ -465,7 +465,7 @@ class PeopleModel(gtk.GenericTreeModel): return None def on_iter_next(self, node): - '''returns the next node at this level of the tree''' + """returns the next node at this level of the tree""" return self.mapper.find_next_node(node) def on_iter_children(self, node): @@ -473,7 +473,7 @@ class PeopleModel(gtk.GenericTreeModel): return self.mapper.first_child(node) def on_iter_has_child(self, node): - '''returns true if this node has children''' + """returns true if this node has children""" return self.mapper.has_child(node) def on_iter_n_children(self, node): @@ -483,7 +483,7 @@ class PeopleModel(gtk.GenericTreeModel): return self.mapper.get_nth_child(node, n) def on_iter_parent(self, node): - '''returns the parent of this node''' + """returns the parent of this node""" return self.mapper.get_parent_of(node) def column_sort_name(self, data, node): diff --git a/src/DisplayState.py b/src/DisplayState.py index 6f6e808f9..bc07992bc 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -147,9 +147,9 @@ class History(gen.utils.GrampsDBCallback): return u"" def present(self): - ''' + """ return the person handle that is now active in the history - ''' + """ try : if self.history : return self.history[self.index] @@ -354,7 +354,7 @@ class DisplayState(gen.utils.GrampsDBCallback): self.relationship.set_depth(value) def display_relationship(self, dbstate): - ''' Construct the relationship in order to show it in the statusbar + """ Construct the relationship in order to show it in the statusbar This can be a time intensive calculation, so we only want to do it if persons are different than before. Eg: select a person, then double click, will result in calling @@ -362,7 +362,7 @@ class DisplayState(gen.utils.GrampsDBCallback): to obtain relationship once! This means the relationship part of statusbar only changes on change of row. - ''' + """ self.relationship.connect_db_signals(dbstate) default_person = dbstate.db.get_default_person() active = dbstate.get_active_person() @@ -384,11 +384,11 @@ class DisplayState(gen.utils.GrampsDBCallback): return u"" def clear_history(self, handle=None): - '''Clear the history. If handle is given, then the history is + """Clear the history. If handle is given, then the history is immediately initialized with a first entry (you'd eg want active person you view there as History contains the present object too!) - ''' + """ self.phistory.clear() if handle : self.phistory.push(handle) diff --git a/src/DisplayTabs/_BackRefList.py b/src/DisplayTabs/_BackRefList.py index 649764a73..7434701d3 100644 --- a/src/DisplayTabs/_BackRefList.py +++ b/src/DisplayTabs/_BackRefList.py @@ -81,11 +81,11 @@ class BackRefList(EmbeddedList): return self.model.count == 0 def create_buttons(self, share=False, move=False, jump=False): - ''' + """ Creates a button box consisting of one button: Edit. This button box is then appended hbox (self). Method has signature of, and overrides create_buttons from _ButtonTab.py - ''' + """ self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked) self.tooltips = gtk.Tooltips() self.tooltips.set_tip(self.edit_btn, _('Edit reference')) diff --git a/src/DisplayTabs/_EmbeddedList.py b/src/DisplayTabs/_EmbeddedList.py index 129ce690c..36a89b11f 100644 --- a/src/DisplayTabs/_EmbeddedList.py +++ b/src/DisplayTabs/_EmbeddedList.py @@ -263,10 +263,10 @@ class EmbeddedList(ButtonTab): self.rebuild() def _move_up(self, row_from, obj,selmethod=None): - ''' + """ Move the item a position up in the EmbeddedList. Eg: 0,1,2,3 needs to become 0,2,1,3, here row_from = 2 - ''' + """ if selmethod : dlist = selmethod() else : @@ -280,10 +280,10 @@ class EmbeddedList(ButtonTab): self.tree.get_selection().select_path(path) def _move_down(self, row_from, obj,selmethod=None): - ''' + """ Move the item a position down in the EmbeddedList. Eg: 0,1,2,3 needs to become 0,2,1,3, here row_from = 1 - ''' + """ if selmethod : dlist = selmethod() else : diff --git a/src/Editors/_EditPrimary.py b/src/Editors/_EditPrimary.py index c24353bdc..e73fb974f 100644 --- a/src/Editors/_EditPrimary.py +++ b/src/Editors/_EditPrimary.py @@ -198,9 +198,9 @@ class EditPrimary(ManagedWindow.ManagedWindow): pass def set_contexteventbox(self, eventbox): - '''Set the contextbox that grabs button presses if not grabbed + """Set the contextbox that grabs button presses if not grabbed by overlying widgets. - ''' + """ self.contexteventbox = eventbox self.contexteventbox.connect('button-press-event', self._contextmenu_button_press) diff --git a/src/Filters/Rules/_MatchesFilterBase.py b/src/Filters/Rules/_MatchesFilterBase.py index 72280e9cb..db4f362c4 100644 --- a/src/Filters/Rules/_MatchesFilterBase.py +++ b/src/Filters/Rules/_MatchesFilterBase.py @@ -89,9 +89,9 @@ class MatchesFilterBase(Rule): return False def find_filter(self): - ''' helper function that can be usefull, returning the filter + """ helper function that can be usefull, returning the filter selected or None - ''' + """ if Filters.SystemFilters: for filt in Filters.SystemFilters.get_filters(self.namespace): if filt.get_name() == self.list[0]: diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 50ffdd473..562345afd 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -765,11 +765,11 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): def add_path_box(self, table, label, index, entry, path, callback_label, callback_sel): - ''' Add an entry to give in path and a select button to open a + """ Add an entry to give in path and a select button to open a dialog. Changing entry calls callback_label Clicking open button call callback_sel - ''' + """ lwidget = BasicLabel("%s: " %label) hbox = gtk.HBox() if path: @@ -797,8 +797,8 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): table.attach(entry, 1, 2, index, index+1, yoptions=0) def add_pos_int_entry(self, table, label, index, constant, callback=None): - ''' entry field for positive integers - ''' + """ entry field for positive integers + """ lwidget = BasicLabel("%s: " % label) entry = gtk.Entry() entry.set_text(str(Config.get(constant))) diff --git a/src/GrampsDbUtils/_GrampsDbWriteXML.py b/src/GrampsDbUtils/_GrampsDbWriteXML.py index f83525406..37c7cac78 100644 --- a/src/GrampsDbUtils/_GrampsDbWriteXML.py +++ b/src/GrampsDbUtils/_GrampsDbWriteXML.py @@ -727,10 +727,10 @@ class GrampsDbXmlWriter(UpdateCallback): (' '*indent,tagname,self.fix(value),tagname)) def write_line_nofix(self,tagname,value,indent=1): - '''Writes a line, but does not escape characters. + """Writes a line, but does not escape characters. Use this instead of write_line is the value is already fixed, this avoids & becoming &amp; - ''' + """ if value: self.g.write('%s<%s>%s\n' % (' '*indent, tagname, value, tagname)) diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index 2675efb15..5ed35019d 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -154,7 +154,7 @@ QUALITY_MAP = { #------------------------------------------------------------------------- def sort_by_gramps_id(first, second): """ - Sorts objects by their GRAMPS ID + Sort objects by their GRAMPS ID. """ return cmp(first.gramps_id, second.gramps_id) @@ -165,9 +165,11 @@ def sort_by_gramps_id(first, second): #------------------------------------------------------------------------- def sort_handles_by_id(handle_list, handle_to_object): """ - Sorts a list of handles by the GRAMPS ID. The function that returns the - object from the handle needs to be supplied so that we get the right - object. + Sort a list of handles by the GRAMPS ID. + + The function that returns the object from the handle needs to be supplied + so that we get the right object. + """ sorted_list = [] for handle in handle_list: @@ -184,7 +186,7 @@ def sort_handles_by_id(handle_list, handle_to_object): #------------------------------------------------------------------------- def make_date(subdate, calendar, mode, quality): """ - Converts a GRAMPS date structure into a GEDCOM compatible date + Convert a GRAMPS date structure into a GEDCOM compatible date. """ retval = "" (day, mon, year) = subdate[0:3] @@ -221,7 +223,7 @@ def make_date(subdate, calendar, mode, quality): #------------------------------------------------------------------------- def __build_date_string(day, mon, year, bce, mmap): """ - Builds a date string from the supplied information + Build a date string from the supplied information. """ if day == 0: if mon == 0: @@ -246,7 +248,7 @@ def __build_date_string(day, mon, year, bce, mmap): #------------------------------------------------------------------------- def breakup(txt, limit): """ - Breaks a line of text into a list of strings that conform to the + Break a line of text into a list of strings that conform to the maximum length specified, while breaking words in the middle of a word to avoid issues with spaces. """ @@ -283,10 +285,6 @@ class GedcomWriter(BasicUtils.UpdateCallback): self.dirname = None self.gedcom_file = None - self.slist = set() - self.rlist = set() - self.nlist = set() - self.setup(option_box) def setup(self, option_box): @@ -316,7 +314,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): def write_gedcom_file(self, filename): """ - Writes the actual GEDCOM file to the specfied filename + Write the actual GEDCOM file to the specfied filename. """ self.dirname = os.path.dirname (filename) @@ -336,17 +334,16 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __writeln(self, level, token, textlines="", limit=72): """ - Writes a line of text to the output file in the form of: + Write a line of text to the output file in the form of: - LEVEL TOKEN text + LEVEL TOKEN text If the line contains newlines, it is broken into multiple lines using the CONT token. If any line is greater than the limit, it will broken into multiple lines using CONC. + """ - assert(token) - if textlines: # break the line into multiple lines if a newline is found textlist = textlines.split('\n') @@ -365,35 +362,36 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __header(self, filename): """ - Writes the GEDCOM header. + Write the GEDCOM header. - HEADER:= - n HEAD {1:1} - +1 SOUR {1:1} - +2 VERS {0:1} - +2 NAME {0:1} - +2 CORP {0:1} # Not used - +3 <> {0:1} # Not used - +2 DATA {0:1} # Not used - +3 DATE {0:1} # Not used - +3 COPR {0:1} # Not used - +1 DEST {0:1*} # Not used - +1 DATE {0:1} - +2 TIME {0:1} - +1 SUBM @XREF:SUBM@ {1:1} - +1 SUBN @XREF:SUBN@ {0:1} - +1 FILE {0:1} - +1 COPR {0:1} - +1 GEDC {1:1} - +2 VERS {1:1} - +2 FORM {1:1} - +1 CHAR {1:1} - +2 VERS {0:1} - +1 LANG {0:1} - +1 PLAC {0:1} - +2 FORM {1:1} - +1 NOTE {0:1} - +2 [CONT|CONC] {0:M} + HEADER:= + n HEAD {1:1} + +1 SOUR {1:1} + +2 VERS {0:1} + +2 NAME {0:1} + +2 CORP {0:1} # Not used + +3 <> {0:1} # Not used + +2 DATA {0:1} # Not used + +3 DATE {0:1} # Not used + +3 COPR {0:1} # Not used + +1 DEST {0:1*} # Not used + +1 DATE {0:1} + +2 TIME {0:1} + +1 SUBM @XREF:SUBM@ {1:1} + +1 SUBN @XREF:SUBN@ {0:1} + +1 FILE {0:1} + +1 COPR {0:1} + +1 GEDC {1:1} + +2 VERS {1:1} + +2 FORM {1:1} + +1 CHAR {1:1} + +2 VERS {0:1} + +1 LANG {0:1} + +1 PLAC {0:1} + +2 FORM {1:1} + +1 NOTE {0:1} + +2 [CONT|CONC] {0:M} + """ local_time = time.localtime(time.time()) (year, mon, day, hour, minutes, sec) = local_time[0:6] @@ -426,14 +424,14 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __submitter(self): """ - n @@ SUBM {1:1} - +1 NAME {1:1} - +1 <> {0:1} - +1 <> {0:M} # not used - +1 LANG {0:3} # not used - +1 RFN {0:1} # not used - +1 RIN {0:1} # not used - +1 <> {0:1} # not used + n @@ SUBM {1:1} + +1 NAME {1:1} + +1 <> {0:1} + +1 <> {0:M} # not used + +1 LANG {0:3} # not used + +1 RFN {0:1} # not used + +1 RIN {0:1} # not used + +1 <> {0:1} # not used """ owner = self.dbase.get_researcher() name = owner.get_name() @@ -472,10 +470,12 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __individuals(self): """ - Writes the individual people to the gedcom file. Since people like to - have the list sorted by ID value, we need to go through a sorting step. - We need to reset the progress bar, otherwise, people will be confused - when the progress bar is idle. + Write the individual people to the gedcom file. + + Since people like to have the list sorted by ID value, we need to go + through a sorting step. We need to reset the progress bar, otherwise, + people will be confused when the progress bar is idle. + """ phandles = self.dbase.get_person_handles() @@ -499,31 +499,31 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __person(self, person): """ - Writes out a single person + Write out a single person. - n @XREF:INDI@ INDI {1:1} - +1 RESN {0:1} # not used - +1 <> {0:M} - +1 SEX {0:1} - +1 <> {0:M} - +1 <> {0:M} - +1 <> {0:M} - +1 <> {0:M} - +1 <> {0:M} - +1 SUBM @@ {0:M} - +1 <> {0:M} - +1 ALIA @@ {0:M} - +1 ANCI @@ {0:M} - +1 DESI @@ {0:M} - +1 <> {0:M} - +1 <> {0:M} ,* - +1 <> {0:M} - +1 RFN {0:1} - +1 AFN {0:1} - +1 REFN {0:M} - +2 TYPE {0:1} - +1 RIN {0:1} - +1 <> {0:1} + n @XREF:INDI@ INDI {1:1} + +1 RESN {0:1} # not used + +1 <> {0:M} + +1 SEX {0:1} + +1 <> {0:M} + +1 <> {0:M} + +1 <> {0:M} + +1 <> {0:M} + +1 <> {0:M} + +1 SUBM @@ {0:M} + +1 <> {0:M} + +1 ALIA @@ {0:M} + +1 ANCI @@ {0:M} + +1 DESI @@ {0:M} + +1 <> {0:M} + +1 <> {0:M} ,* + +1 <> {0:M} + +1 RFN {0:1} + +1 AFN {0:1} + +1 REFN {0:M} + +2 TYPE {0:1} + +1 RIN {0:1} + +1 <> {0:1} """ self.__writeln(0, "@%s@" % person.get_gramps_id(), "INDI") @@ -546,10 +546,10 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __assoc(self, person, level): """ - n ASSO @@ {0:M} - +1 RELA {1:1} - +1 <> {0:M} - +1 <> {0:M} + n ASSO @@ {0:M} + +1 RELA {1:1} + +1 <> {0:M} + +1 <> {0:M} """ for ref in person.get_person_ref_list(): person = self.dbase.get_person_from_handle(ref.ref) @@ -560,20 +560,19 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __note_references(self, notelist, level): """ - Write out the list of note handles to the current level. We use the - GRAMPS ID as the XREF for the GEDCOM file. + Write out the list of note handles to the current level. + + We use the GRAMPS ID as the XREF for the GEDCOM file. - Add the note_handle to the nlist set so what we know which notes to - write to the output GEDCOM file. """ for note_handle in notelist: note = self.dbase.get_note_from_handle(note_handle) self.__writeln(level, 'NOTE', '@%s@' % note.get_gramps_id()) - self.nlist.add(note_handle) def __names(self, person): """ - Write the names associated with the person to the current level. + Write the names associated with the person to the current level. + Since nicknames are now separate from the name structure, we search the attribute list to see if we can find a nickname. Because we do not know the mappings, we just take the first nickname we find, and @@ -581,6 +580,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): All other names are assumed to not have a nickname, even if other nicknames exist in the attribute list. + """ nicknames = [ attr.get_value() for attr in person.get_attribute_list() if int(attr.get_type()) == gen.lib.AttributeType.NICKNAME ] @@ -595,9 +595,12 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __gender(self, person): """ - Writes out the gender of the person to the file. If the gender is not - male or female, simply do not output anything. The only valid values are - M (male) or F (female). So if the geneder is unknown, we output nothing. + Write out the gender of the person to the file. + + If the gender is not male or female, simply do not output anything. + The only valid values are M (male) or F (female). So if the geneder is + unknown, we output nothing. + """ if person.get_gender() == gen.lib.Person.MALE: self.__writeln(1, "SEX", "M") @@ -607,7 +610,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __lds_ords(self, obj, level): """ Simply loop through the list of LDS ordinances, and call the function - that write the LDS ordinance structure. + that writes the LDS ordinance structure. """ for lds_ord in obj.get_lds_ord_list(): self.write_ord(lds_ord, level) @@ -615,8 +618,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __remaining_events(self, person): """ Output all events associated with the person that are not BIRTH or - DEATH events. Because all we have are event references, we have to + DEATH events. + + Because all we have are event references, we have to extract the real event to discover the event type. + """ for event_ref in person.get_event_ref_list(): event = self.dbase.get_event_from_handle(event_ref.ref) @@ -657,12 +663,13 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __adoption_records(self, person): """ - Writes Adoption events for each child that has been adopted. + Write Adoption events for each child that has been adopted. - n ADOP + n ADOP +1 <> +1 FAMC @@ - +2 ADOP + +2 ADOP + """ adoptions = [] @@ -687,12 +694,14 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __attributes(self, person): """ - Writes out the attributes to the GEDCOM file. Since we have already - looked at nicknames when we generated the names, we filter them out - here. + Write out the attributes to the GEDCOM file. + + Since we have already looked at nicknames when we generated the names, + we filter them out here. We use the GEDCOM 5.5.1 FACT command to write out attributes not built in to GEDCOM. + """ # filter out the nicknames @@ -798,11 +807,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __url_list(self, obj, level): """ - n OBJE {1:1} - +1 FORM {1:1} - +1 TITL {0:1} - +1 FILE {1:1} - +1 <> {0:M} + n OBJE {1:1} + +1 FORM {1:1} + +1 TITL {0:1} + +1 FILE {1:1} + +1 <> {0:M} """ for url in obj.get_url_list(): self.__writeln(level, 'OBJE') @@ -814,7 +823,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __families(self): """ - Writes out the list of families, sorting by GRAMPS ID + Write out the list of families, sorting by GRAMPS ID. """ # generate a list of (GRAMPS_ID, HANDLE) pairs. This list @@ -830,16 +839,16 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family(self, family): """ - n @@ FAM {1:1} - +1 RESN {0:1) - +1 <> {0:M} - +1 HUSB @@ {0:1} - +1 WIFE @@ {0:1} - +1 CHIL @@ {0:M} - +1 NCHI {0:1} - +1 SUBM @@ {0:M} - +1 <> {0:M} - +1 REFN {0:M} + n @@ FAM {1:1} + +1 RESN {0:1) + +1 <> {0:M} + +1 HUSB @@ {0:1} + +1 WIFE @@ {0:1} + +1 CHIL @@ {0:M} + +1 NCHI {0:1} + +1 SUBM @@ {0:M} + +1 <> {0:M} + +1 REFN {0:M} """ gramps_id = family.get_gramps_id() @@ -860,8 +869,10 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family_child_list(self, child_ref_list): """ - Write the child XREF values to the GEDCOM file. Sorts the child - list by ID value before writing. + Write the child XREF values to the GEDCOM file. + + Sorts the child list by ID value before writing. + """ # sort the childlist by GRAMPS ID @@ -875,8 +886,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family_reference(self, token, person_handle): """ - Write the family reference to the file. This is either 'WIFE' or - 'HUSB'. As usual, we use the GRAMPS ID as the XREF value. + Write the family reference to the file. + + This is either 'WIFE' or 'HUSB'. As usual, we use the GRAMPS ID as the + XREF value. + """ if person_handle: person = self.dbase.get_person_from_handle(person_handle) @@ -884,8 +898,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family_events(self, family): """ - Output the events associated with the family. Because all we have are event - references, we have to extract the real event to discover the event type. + Output the events associated with the family. + + Because all we have are event references, we have to extract the real + event to discover the event type. + """ for event_ref in [ ref for ref in family.get_event_ref_list()]: event = self.dbase.get_event_from_handle(event_ref.ref) @@ -920,9 +937,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family_event_attrs(self, attr_list, level): """ - Writes the attributes assocated 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. + Write the attributes assocated 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. + """ for attr in attr_list: if attr.get_type() == gen.lib.AttributeType.FATHER_AGE: @@ -934,12 +953,14 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __family_attributes(self, attr_list, level): """ - Writes out the attributes associated with a family to the GEDCOM file. + Write out the attributes associated with a family to the GEDCOM file. + Since we have already looked at nicknames when we generated the names, we filter them out here. We use the GEDCOM 5.5.1 FACT command to write out attributes not built in to GEDCOM. + """ for attr in attr_list: @@ -965,9 +986,9 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __sources(self): """ - Writes out the list of sources, sorting by GRAMPS ID + Write out the list of sources, sorting by GRAMPS ID. """ - sorted_list = sort_handles_by_id(self.slist, + sorted_list = sort_handles_by_id(self.dbase.get_source_handles(), self.dbase.get_source_from_handle) for (source_id, handle) in sorted_list: @@ -996,9 +1017,9 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __notes(self): """ - Writes out the list of notes, sorting by GRAMPS ID + Write out the list of notes, sorting by GRAMPS ID. """ - sorted_list = sort_handles_by_id(self.nlist, + sorted_list = sort_handles_by_id(self.dbase.get_note_handles(), self.dbase.get_note_from_handle) for note_handle in [hndl[1] for hndl in sorted_list]: @@ -1007,32 +1028,32 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __note_record(self, note): """ - n @@ NOTE {1:1} - +1 [ CONC | CONT] {0:M} - +1 <> {0:M} - +1 REFN {0:M} - +2 TYPE {0:1} - +1 RIN {0:1} - +1 <> {0:1} + n @@ NOTE {1:1} + +1 [ CONC | CONT] {0:M} + +1 <> {0:M} + +1 REFN {0:M} + +2 TYPE {0:1} + +1 RIN {0:1} + +1 <> {0:1} """ self.__writeln(0, '@%s@' % note.get_gramps_id(), 'NOTE ' + note.get()) def __repos(self): """ - Writes out the list of repositories, sorting by GRAMPS ID + Write out the list of repositories, sorting by GRAMPS ID. REPOSITORY_RECORD:= - n @@ REPO {1:1} - +1 NAME {1:1} - +1 <> {0:1} - +1 <> {0:M} - +1 REFN {0:M} - +2 TYPE {0:1} - +1 RIN {0:1} - +1 <> {0:1} + n @@ REPO {1:1} + +1 NAME {1:1} + +1 <> {0:1} + +1 <> {0:M} + +1 REFN {0:M} + +2 TYPE {0:1} + +1 RIN {0:1} + +1 <> {0:1} """ - sorted_list = sort_handles_by_id(self.rlist, + sorted_list = sort_handles_by_id(self.dbase.get_repository_handles(), self.dbase.get_repository_from_handle) # GEDCOM only allows for a single repository per source @@ -1058,18 +1079,15 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __reporef(self, reporef, level): """ - n REPO [ @XREF:REPO@ | ] {1:1} - +1 <> {0:M} - +1 CALN {0:M} - +2 MEDI {0:1} + n REPO [ @XREF:REPO@ | ] {1:1} + +1 <> {0:M} + +1 CALN {0:M} + +2 MEDI {0:1} """ if reporef.ref == None: return - # Append handle to the list for exporting REPOs later - self.rlist.add(reporef.ref) - repo = self.dbase.get_repository_from_handle(reporef.ref) repo_id = repo.get_gramps_id() @@ -1084,7 +1102,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __person_event_ref(self, key, event_ref): """ - Writes out the BIRTH and DEATH events for the person. + Write out the BIRTH and DEATH events for the person. """ if event_ref: event = self.dbase.get_event_from_handle(event_ref.ref) @@ -1099,8 +1117,8 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __change(self, timeval, level): """ - CHANGE_DATE:= - n CHAN {1:1} + CHANGE_DATE:= + n CHAN {1:1} +1 DATE {1:1} +2 TIME {0:1} +1 <> # not used @@ -1114,9 +1132,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __dump_event_stats(self, event, event_ref): """ - Writes the event details for the event, using the event and event - reference information. GEDCOM does not make a distinction between the - two. + Write the event details for the event, using the event and event + reference information. + + GEDCOM does not make a distinction between the two. + """ dateobj = event.get_date_object() self.__date(2, dateobj) @@ -1205,7 +1225,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __date(self, level, date): """ - Writes the 'DATE' GEDCOM token, along with the date in GEDCOM's + Write the 'DATE' GEDCOM token, along with the date in GEDCOM's expected formta. """ start = date.get_start_date() @@ -1229,15 +1249,15 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __person_name(self, name, nick): """ - n NAME {1:1} - +1 NPFX {0:1} - +1 GIVN {0:1} - +1 NICK {0:1} - +1 SPFX {0:1} - +1 NSFX {0:1} - +1 <> {0:M} - +1 <> {0:M} + n NAME {1:1} + +1 NPFX {0:1} + +1 GIVN {0:1} + +1 NICK {0:1} + +1 SPFX {0:1} + +1 NSFX {0:1} + +1 <> {0:M} + +1 <> {0:M} """ firstname = name.get_first_name().strip() patron = name.get_patronymic().strip() @@ -1280,17 +1300,17 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __source_ref_record(self, level, ref): """ - n SOUR @@ /* pointer to source record */ {1:1} - +1 PAGE {0:1} - +1 EVEN {0:1} - +2 ROLE {0:1} - +1 DATA {0:1} - +2 DATE {0:1} - +2 TEXT {0:M} - +3 [ CONC | CONT ] {0:M} - +1 QUAY {0:1} - +1 <> {0:M} ,* - +1 <> {0:M} + n SOUR @@ /* pointer to source record */ {1:1} + +1 PAGE {0:1} + +1 EVEN {0:1} + +2 ROLE {0:1} + +1 DATA {0:1} + +2 DATE {0:1} + +2 TEXT {0:M} + +3 [ CONC | CONT ] {0:M} + +1 QUAY {0:1} + +1 <> {0:M} ,* + +1 <> {0:M} """ src_handle = ref.get_reference_handle() @@ -1298,7 +1318,6 @@ class GedcomWriter(BasicUtils.UpdateCallback): return src = self.dbase.get_source_from_handle(src_handle) - self.slist.add(src_handle) # Reference to the source self.__writeln(level, "SOUR", "@%s@" % src.get_gramps_id()) @@ -1335,11 +1354,11 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __photo(self, photo, level): """ - n OBJE {1:1} - +1 FORM {1:1} - +1 TITL {0:1} - +1 FILE {1:1} - +1 <> {0:M} + n OBJE {1:1} + +1 FORM {1:1} + +1 TITL {0:1} + +1 FILE {1:1} + +1 <> {0:M} """ photo_obj_id = photo.get_reference_handle() photo_obj = self.dbase.get_object_from_handle(photo_obj_id) @@ -1359,16 +1378,16 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __place(self, place, level): """ - PLACE_STRUCTURE:= - n PLAC {1:1} + PLACE_STRUCTURE:= + n PLAC {1:1} +1 FORM {0:1} +1 FONE {0:M} # not used - +2 TYPE {1:1} + +2 TYPE {1:1} +1 ROMN {0:M} # not used - +2 TYPE {1:1} + +2 TYPE {1:1} +1 MAP {0:1} - +2 LATI {1:1} - +2 LONG {1:1} + +2 LATI {1:1} + +2 LONG {1:1} +1 <> {0:M} """ place_name = place.get_title() diff --git a/src/GrampsWidgets.py b/src/GrampsWidgets.py index 083c5abe7..da284e58a 100644 --- a/src/GrampsWidgets.py +++ b/src/GrampsWidgets.py @@ -744,7 +744,7 @@ class ObjEntry: """ def __init__(self, dbstate, uistate, track, label, set_val, get_val, add_edt, share): - '''Pass the dbstate and uistate and present track. + """Pass the dbstate and uistate and present track. label is a gtk.Label that shows the persent value set_val is function that is called when handle changes, use it to update the calling module @@ -753,7 +753,7 @@ class ObjEntry: share is the gtk.Button to call the object selector or del connect add_edt is the gtk.Button with add or edit value. Pass None if this button should not be present. - ''' + """ self.label = label self.add_edt = add_edt self.share = share @@ -808,25 +808,25 @@ class ObjEntry: self.label.set_text(name) def _init_dnd(self): - '''inheriting objects must set this - ''' + """inheriting objects must set this + """ pass def _init_object(self): - '''inheriting objects can use this to set extra variables - ''' + """inheriting objects can use this to set extra variables + """ pass def get_from_handle(self, handle): - ''' return the object given the hande + """ return the object given the hande inheriting objects must set this - ''' + """ pass def get_label(self, object): - ''' return the label + """ return the label inheriting objects must set this - ''' + """ pass def after_edit(self, obj): @@ -834,8 +834,8 @@ class ObjEntry: self.label.set_text(name) def add_edt_clicked(self, obj): - ''' if value, edit, if no value, call editor on new object - ''' + """ if value, edit, if no value, call editor on new object + """ if self.get_val(): obj = self.get_from_handle(self.get_val()) self.call_editor(obj) @@ -843,13 +843,13 @@ class ObjEntry: self.call_editor() def call_editor(self, obj): - '''inheriting objects must set this - ''' + """inheriting objects must set this + """ pass def call_selector(self): - '''inheriting objects must set this - ''' + """inheriting objects must set this + """ pass def drag_data_received(self, widget, context, x, y, selection, info, time): @@ -859,14 +859,14 @@ class ObjEntry: self.obj_added(data) def obj_added(self, data): - ''' callback from adding an object to the entry''' + """ callback from adding an object to the entry""" self.set_val(data.handle) self.label.set_text(self.get_label(data)) self.set_button(True) def share_clicked(self, obj): - ''' if value, delete connect, in no value, select existing object - ''' + """ if value, delete connect, in no value, select existing object + """ if self.get_val(): self.set_val(None) self.label.set_text(self.EMPTY_TEXT) @@ -879,10 +879,10 @@ class ObjEntry: self.obj_added(obj) def set_button(self, use_add): - ''' This sets the correct image to the two buttons. + """ This sets the correct image to the two buttons. If False: select icon and add icon If True: remove icon and edit icon - ''' + """ if self.add_edt is not None: for i in self.add_edt.get_children(): self.add_edt.remove(i) @@ -933,15 +933,15 @@ class PlaceEntry(ObjEntry): get_val, add_edt, share) def _init_dnd(self): - '''connect drag and drop of places - ''' + """connect drag and drop of places + """ self.label.drag_dest_set(gtk.DEST_DEFAULT_ALL, [DdTargets.PLACE_LINK.target()], gtk.gdk.ACTION_COPY) self.label.connect('drag_data_received', self.drag_data_received) def get_from_handle(self, handle): - ''' return the object given the hande - ''' + """ return the object given the hande + """ return self.db.get_place_from_handle(handle) def get_label(self, place): @@ -987,15 +987,15 @@ class MediaEntry(ObjEntry): get_val, add_edt, share) def _init_dnd(self): - '''connect drag and drop of places - ''' + """connect drag and drop of places + """ self.label.drag_dest_set(gtk.DEST_DEFAULT_ALL, [DdTargets.MEDIAOBJ.target()], gtk.gdk.ACTION_COPY) self.label.connect('drag_data_received', self.drag_data_received) def get_from_handle(self, handle): - ''' return the object given the hande - ''' + """ return the object given the hande + """ return self.db.get_object_from_handle(handle) def get_label(self, object): @@ -1042,25 +1042,25 @@ class NoteEntry(ObjEntry): self.notetype = None def set_notetype(self, type): - ''' set a notetype to use in new notes - ''' + """ set a notetype to use in new notes + """ self.notetype = type def get_notetype(self): - ''' return the set notetype - ''' + """ return the set notetype + """ return self.notetype def _init_dnd(self): - '''connect drag and drop of places - ''' + """connect drag and drop of places + """ self.label.drag_dest_set(gtk.DEST_DEFAULT_ALL, [DdTargets.NOTE_LINK.target()], gtk.gdk.ACTION_COPY) self.label.connect('drag_data_received', self.drag_data_received) def get_from_handle(self, handle): - ''' return the object given the hande - ''' + """ return the object given the hande + """ return self.db.get_note_from_handle(handle) def get_label(self, note): @@ -1142,16 +1142,16 @@ class Statusbar(gtk.HBox): # Virtual methods def do_get_property(self, prop): - '''Return the gproperty's value. - ''' + """Return the gproperty's value. + """ if prop.name == 'has-resize-grip': return self.__has_resize_grip else: raise AttributeError, 'unknown property %s' % prop.name def do_set_property(self, prop, value): - '''Set the property of writable properties. - ''' + """Set the property of writable properties. + """ if prop.name == 'has-resize-grip': self.__has_resize_grip = value self._set_resize_grip() @@ -1389,7 +1389,7 @@ if gtk.pygtk_version < (2, 8, 0): gobject.type_register(FadeOut) class Tooltip(gtk.Window): - '''Tooltip for the Icon in the MaskedEntry''' + """Tooltip for the Icon in the MaskedEntry""" DEFAULT_DELAY = 500 BORDER_WIDTH = 4 @@ -2191,14 +2191,14 @@ class MaskedEntry(gtk.Entry): return def set_completion_mode(self, popup=None, inline=None): - ''' + """ Set the way how completion is presented. @param popup: enable completion in popup window @type popup: boolean @param inline: enable inline completion @type inline: boolean - ''' + """ completion = self._get_completion() if popup is not None: completion.set_popup_completion(popup) @@ -2683,7 +2683,7 @@ class ValidatableMaskedEntry(MaskedEntry): self.validate() def do_get_property(self, prop): - '''Return the gproperty's value.''' + """Return the gproperty's value.""" if prop.name == 'data-type': return self.data_type @@ -2693,7 +2693,7 @@ class ValidatableMaskedEntry(MaskedEntry): raise AttributeError, 'unknown property %s' % prop.name def do_set_property(self, prop, value): - '''Set the property of writable properties.''' + """Set the property of writable properties.""" if prop.name == 'data-type': if value is None: diff --git a/src/ManagedWindow.py b/src/ManagedWindow.py index 59b48e1e6..12d76c80f 100644 --- a/src/ManagedWindow.py +++ b/src/ManagedWindow.py @@ -419,7 +419,7 @@ class ManagedWindow: self.window.show_all() def modal_call(self, after_ok_func=None): - ''' + """ Method to do modal run of the ManagedWindow. Connect the OK button to a method that checks if all is ok, Do not call close, close is called here. @@ -432,7 +432,7 @@ class ManagedWindow: Do not generete RESPONSE_OK/CANCEL/DELETE_EVENT on button clicks of other buttons after_ok_func is called on ok click in this method - ''' + """ #self.show() while True: response = self.window.run() diff --git a/src/QuickReports.py b/src/QuickReports.py index e7ca3aac0..dc9f8750f 100644 --- a/src/QuickReports.py +++ b/src/QuickReports.py @@ -63,7 +63,7 @@ from ReportBase import CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY,\ def create_quickreport_menu(category,dbstate,uistate,handle) : #import present version of the from PluginUtils import quick_report_list - ''' This functions querries the registered quick reports with + """ This functions querries the registered quick reports with quick_report_list of _PluginMgr.py It collects the reports of the requested category, which must be one of CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY, @@ -74,7 +74,7 @@ def create_quickreport_menu(category,dbstate,uistate,handle) : handle as input method. A tuple is returned, containing the ui string of the quick report menu, and its associated actions - ''' + """ actions = [] ofile = StringIO() diff --git a/src/Relationship.py b/src/Relationship.py index 51ffa4c86..b141a2902 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id$ +# $Id:Relationship.py 9912 2008-01-22 09:17:46Z acraphae $ #------------------------------------------------------------------------- # @@ -395,16 +395,16 @@ class RelationshipCalculator: pass def set_depth(self, depth): - ''' set how deep relationships must be searched. Input must be an + """ set how deep relationships must be searched. Input must be an integer > 0 - ''' + """ if not depth == self.depth: self.depth = depth self.dirtymap = True def get_depth(self): - ''' obtain depth of relationship search - ''' + """ obtain depth of relationship search + """ return self.depth @@ -877,7 +877,7 @@ class RelationshipCalculator: def __apply_filter(self, db, person, rel_str, rel_fam, pmap, depth=1, stoprecursemap=None): - '''Typically this method is called recursively in two ways: + """Typically this method is called recursively in two ways: First method is stoprecursemap= None In this case a recursemap is builded by storing all data. @@ -888,7 +888,7 @@ class RelationshipCalculator: of first contains loops, and parents will be looked up anyway an stored if common. At end the doubles are filtered out - ''' + """ if person == None or not person.handle : return diff --git a/src/Selectors/_BaseSelector.py b/src/Selectors/_BaseSelector.py index fa686c8ba..bf20f593f 100644 --- a/src/Selectors/_BaseSelector.py +++ b/src/Selectors/_BaseSelector.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id$ +# $Id:_BaseSelector.py 9912 2008-01-22 09:17:46Z acraphae $ #------------------------------------------------------------------------- # @@ -54,11 +54,11 @@ class BaseSelector(ManagedWindow.ManagedWindow): def __init__(self, dbstate, uistate, track=[], filter=None, skip=set(), show_search_bar = True): - '''Set up the dialog with the dbstate and uistate, track of parent + """Set up the dialog with the dbstate and uistate, track of parent windows for ManagedWindow, initial filter for the model, skip with set of handles to skip in the view, and search_bar to show the SearchBar at the top or not. - ''' + """ self.title = self.get_window_title() ManagedWindow.ManagedWindow.__init__(self, uistate, track, self) @@ -179,8 +179,8 @@ class BaseSelector(ManagedWindow.ManagedWindow): assert False, "Must be defined in the subclass" def set_show_search_bar(self, value): - '''make the search bar at the top shown - ''' + """make the search bar at the top shown + """ self.show_search_bar = value if not self.search_bar : return diff --git a/src/gramps_main.py b/src/gramps_main.py index e860632bb..377bb9a46 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id$ +# $Id:gramps_main.py 9912 2008-01-22 09:17:46Z acraphae $ #------------------------------------------------------------------------- # @@ -63,10 +63,10 @@ from QuestionDialog import ErrorDialog def register_stock_icons (): - ''' + """ Add the gramps names for its icons (eg gramps-person) to the GTK icon factory. This allows all gramps modules to call up the icons by their name - ''' + """ #iconpath to the base image. The front of the list has highest priority if platform.system() == "Windows": diff --git a/src/plugins/RelCalc.py b/src/plugins/RelCalc.py index 94a40cbf8..58e54d807 100644 --- a/src/plugins/RelCalc.py +++ b/src/plugins/RelCalc.py @@ -148,9 +148,9 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): self.show() def close(self, *obj): - ''' Close relcalc tool. Remove non-gtk connections so garbage + """ Close relcalc tool. Remove non-gtk connections so garbage collection can do its magic. - ''' + """ self.relationship.disconnect_db_signals(self.dbstate) self.sel.disconnect(self.changedkey) ManagedWindow.ManagedWindow.close(self, *obj)