* src/RelLib.py (sortbysource): Low-level implementation;

(sortbyplace): Typo.
* src/Sources.py (by_title): Remove function (superseded by
RelLib.GrampsDB.sortbysource).


svn: r2909
This commit is contained in:
Alex Roitman 2004-02-24 20:53:58 +00:00
parent f2272091d7
commit df1f3120cc
3 changed files with 10 additions and 17 deletions

View File

@ -1,3 +1,9 @@
2004-02-24 Alex Roitman <shura@alex.neuro.umn.edu>
* src/RelLib.py (sortbysource): Low-level implementation;
(sortbyplace): Typo.
* src/Sources.py (by_title): Remove function (superseded by
RelLib.GrampsDB.sortbysource).
2004-02-23 Alex Roitman <shura@alex.neuro.umn.edu> 2004-02-23 Alex Roitman <shura@alex.neuro.umn.edu>
* src/AddrEdit.py, src/AttrEdit.py, src/EditPerson.py, * src/AddrEdit.py, src/AttrEdit.py, src/EditPerson.py,
src/EditSource.py, src/EventEdit.py, src/ImageSelect.py, src/EditSource.py, src/EventEdit.py, src/ImageSelect.py,

View File

@ -2899,7 +2899,7 @@ class GrampsDB:
def sortbyplace(self,f,s): def sortbyplace(self,f,s):
fp = self.place_map[f][0].upper() fp = self.place_map[f][0].upper()
sp = self.place_map[f][0].upper() sp = self.place_map[s][0].upper()
return cmp(fp,sp) return cmp(fp,sp)
def sort_place_keys(self): def sort_place_keys(self):
@ -2929,19 +2929,9 @@ class GrampsDB:
return self.media_map.keys() return self.media_map.keys()
def sortbysource(self,f,s): def sortbysource(self,f,s):
if self.source_map.get(str(f)): f1 = self.source_map[f][1].upper()
f1 = Source() s1 = self.source_map[s][1].upper()
f1.unserialize(self.source_map.get(str(f))) return cmp(f1,s1)
else:
return 0
if self.source_map.get(str(s)):
s1 = Source()
s1.unserialize(self.source_map.get(str(s)))
else:
return 0
f2 = f1.get_title().upper()
s2 = s1.get_title().upper()
return cmp(f2,s2)
def set_source_keys(self): def set_source_keys(self):
keys = self.source_map.keys() keys = self.source_map.keys()

View File

@ -502,6 +502,3 @@ class SourceEditor:
import EditSource import EditSource
EditSource.EditSource(RelLib.Source(),self.db, self,self.sourceDisplay, self.update_display) EditSource.EditSource(RelLib.Source(),self.db, self,self.sourceDisplay, self.update_display)
def by_title(first,second):
return cmp(first.get_title(),second.get_title())