diff --git a/gramps2/example/gramps/data.gramps b/gramps2/example/gramps/data.gramps index f0d1b873a..42a9b52b5 100644 Binary files a/gramps2/example/gramps/data.gramps and b/gramps2/example/gramps/data.gramps differ diff --git a/gramps2/gramps.sh.in b/gramps2/gramps.sh.in index a8ad8d11f..f91c9f02b 100644 --- a/gramps2/gramps.sh.in +++ b/gramps2/gramps.sh.in @@ -45,4 +45,4 @@ if [ "$preload" != "" ]; then export LD_PRELOAD="$preload" fi -@PYTHON@ $GRAMPSDIR/gramps.py $* +exec @PYTHON@ $GRAMPSDIR/gramps.py $* diff --git a/gramps2/src/docgen/PSDrawDoc.py b/gramps2/src/docgen/PSDrawDoc.py index 3044c0b46..c71d05fcf 100644 --- a/gramps2/src/docgen/PSDrawDoc.py +++ b/gramps2/src/docgen/PSDrawDoc.py @@ -77,6 +77,8 @@ class PSDrawDoc(DrawDoc): self.f.write('%%LanguageLevel: 2\n') self.f.write('%%Pages: (atend)\n') self.f.write('%%PageOrder: Ascend\n') + if self.orientation != PAPER_PORTRAIT: + self.f.write('%%Orientation: Landscape\n') self.f.write('%%EndComments\n') self.f.write('/cm { 28.34 mul } def\n') @@ -100,6 +102,8 @@ class PSDrawDoc(DrawDoc): self.page = self.page + 1 self.f.write("%%Page:") self.f.write("%d %d\n" % (self.page,self.page)) + if self.orientation != PAPER_PORTRAIT: + self.f.write('90 rotate %5.2f cm %5.2f cm translate\n' % (0,-1*self.height)) def end_page(self): self.f.write('showpage\n') diff --git a/gramps2/src/docgen/SvgDrawDoc.py b/gramps2/src/docgen/SvgDrawDoc.py index 2c50ec989..36c71c849 100644 --- a/gramps2/src/docgen/SvgDrawDoc.py +++ b/gramps2/src/docgen/SvgDrawDoc.py @@ -63,19 +63,25 @@ class SvgDrawDoc(DrawDoc): name = "%s.svg" % self.root self.f = open(name,"w") - self.f.write('\n') - self.f.write('\n') - self.f.write('\n') - + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + if self.orientation != PAPER_PORTRAIT: + self.f.write('\n' % self.height) + def end_page(self): + if self.orientation != PAPER_PORTRAIT: + self.f.write('\n') self.f.write('\n') self.f.close() def draw_line(self,style,x1,y1,x2,y2): - self.f.write('\n') + self.f.write(' style="stroke:#000000;stroke-width=1"/>\n') def draw_box(self,style,text,x,y): box_style = self.draw_styles[style] diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 4df47d2f4..d558ff3d8 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -211,19 +211,19 @@ class Gramps: self.default_list = self.pl_page[-1] self.alpha_page = { - 'a' : self.pl_page[0], 'b' : self.pl_page[0], - 'c' : self.pl_page[1], 'd' : self.pl_page[1], - 'e' : self.pl_page[2], 'f' : self.pl_page[2], - 'g' : self.pl_page[3], 'h' : self.pl_page[3], - 'i' : self.pl_page[4], 'j' : self.pl_page[4], - 'k' : self.pl_page[5], 'l' : self.pl_page[5], - 'm' : self.pl_page[6], 'n' : self.pl_page[6], - 'o' : self.pl_page[7], 'p' : self.pl_page[7], - 'q' : self.pl_page[8], 'r' : self.pl_page[8], - 's' : self.pl_page[9], 't' : self.pl_page[9], - 'u' : self.pl_page[10], 'v' : self.pl_page[10], - 'w' : self.pl_page[11], 'x' : self.pl_page[11], - 'y' : self.pl_page[12], 'z' : self.pl_page[12], + 'A' : self.pl_page[0], 'B' : self.pl_page[0], + 'C' : self.pl_page[1], 'D' : self.pl_page[1], + 'E' : self.pl_page[2], 'F' : self.pl_page[2], + 'G' : self.pl_page[3], 'H' : self.pl_page[3], + 'I' : self.pl_page[4], 'J' : self.pl_page[4], + 'K' : self.pl_page[5], 'L' : self.pl_page[5], + 'M' : self.pl_page[6], 'N' : self.pl_page[6], + 'O' : self.pl_page[7], 'P' : self.pl_page[7], + 'Q' : self.pl_page[8], 'R' : self.pl_page[8], + 'S' : self.pl_page[9], 'T' : self.pl_page[9], + 'U' : self.pl_page[10], 'V' : self.pl_page[10], + 'W' : self.pl_page[11], 'X' : self.pl_page[11], + 'Y' : self.pl_page[12], 'Z' : self.pl_page[12], } self.model2page = { @@ -1200,8 +1200,8 @@ class Gramps: def add_to_person_list(self,person,change): key = person.getId() val = self.db.getPersonDisplay(person.getId()) - pg = val[0] - pg = pg[0].lower() + pg = val[5] + pg = pg[0] if self.DataFilter.compare(person): if pg and self.alpha_page.has_key(pg): model = self.alpha_page[pg] @@ -1364,9 +1364,9 @@ class Gramps: for key in self.db.getPersonKeys(): person = self.db.getPerson(key) val = self.db.getPersonDisplay(key) - pg = val[0] + pg = val[5] if pg: - pg = pg[0].lower() + pg = pg[0] if datacomp(person): if self.id2col.has_key(key): continue diff --git a/gramps2/src/sort.py b/gramps2/src/sort.py index 8672091e4..02974f24e 100644 --- a/gramps2/src/sort.py +++ b/gramps2/src/sort.py @@ -39,15 +39,28 @@ import Date #------------------------------------------------------------------------- su = string.upper +sp = string.split + + +_plist = [ 'de', 'van', 'von', 'la', 'di', 'le', 'du' ] + +_prefix = {} +for i in _plist: + _prefix[i] = 1 def build_sort_name(n): """Builds a name from a RelLib.Name instance that is suitable for use as a sort key in a GtkCList. The name is converted to upper case to provide for case-insenstive sorting""" - if n.Surname: - return "%-25s%-30s%s" % (su(n.Surname),su(n.FirstName),su(n.Suffix)) + l = string.split(n.Surname) + if len(l) > 1 and _prefix.has_key(l[0].lower()): + return "%-25s%-30s%s" % (su(l[1]),su(n.FirstName),su(n.Suffix)) else: - return "%s" % chr(255) + if n.Surname: + return "%-25s%-30s%s" % (su(n.Surname),su(n.FirstName),su(n.Suffix)) + else: + return "%s" % chr(255) + def build_sort_date(n): """Builds a date from a Date.Date instance that is suitable for