From 1ec6b99059933daba3a4c7b84c7623ca765cb71f Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 1 Dec 2002 03:40:47 +0000 Subject: [PATCH] Surname prefix support, landscape support for SVG and PS svn: r1215 --- gramps2/example/gramps/data.gramps | Bin 3734 -> 3779 bytes gramps2/gramps.sh.in | 2 +- gramps2/src/docgen/PSDrawDoc.py | 4 ++++ gramps2/src/docgen/SvgDrawDoc.py | 20 +++++++++++------ gramps2/src/gramps_main.py | 34 ++++++++++++++--------------- gramps2/src/sort.py | 19 +++++++++++++--- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/gramps2/example/gramps/data.gramps b/gramps2/example/gramps/data.gramps index f0d1b873a27675608c4488955dbe4890d8674cfd..42a9b52b513222926a5311df368be4a42729af29 100644 GIT binary patch delta 3758 zcmV;f4pH%z9m5?5ABzYG6QJdh2RnZqYj4{)@_T;;&mRtVKx~V8SQ5_7UgD-r)20dH zeV{lT7K}y5Y9-O24z6PD7cI86Or~Y-N$0A!mm3B-QaRKhgxQjlAcQ#AcL{q^h;_3k)Hm-!$nq8|Fsf1zvLHYhtY0;{kSOBE*s{=c zfG$a#p=mLY9c4qK<18*7kEef29%py+m?n|zBwsc<T4 z_~Y?!(~}ZL^}Eq!$zW7+jBUsDWS{Cqv&({I^w@EnzUO)U(6{ZfqkP@yM^h3f$G7Y@ z7bN(1&QkgSRHB277IH+{p`_w)n~dY(hMD7%H7KHUvPz1#y^oIHtA>9qft4&naRhJe zptnYUM>8?{{dibC)e3?MsCZlgr%z*EEYKHtu^tB<<}uHUGH0J=|h2y{B2x#MDG0gz}z%=#vCwEErjRE9~1&EmP&vgs34-=Wl!0*xfXZ zhZ6L&h~9zBw;&2_zi)rp@JETrQR7(>4nILmWzY8*uXn((=GBVNXXrSq9Y; z;R!kezu^$dDF}bVKDPTX{|<`$B?iL_`xfrof!Z=zy6Vr-VF)(Ikn?XONeMp;I~+kK z2fs2qg3y(Yg4YF42X5HrxN!*@G0qOc49DtY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3M%MU&CX{I!<8{~7E$0LD z2PtNpR-OIwyQZ1HYF2+k>i~U{w_Q@gijpJ-jH4BWbMp8=L~?+RGm_JUY{4mBH9UXi zdA?w2`Kazp-#(TU^pv5~83;{kFk$y;meCekZnz$PPK%O@`HKhQuCe&-6rE7C!>3A=;n5 zjG*I-o0G33=!O>r7;(n)ZK|Zg>AHVynnP!2Bxf)0_F9SF3z~CQnyRw9X*e!;L6yyb zQJiK(Z0-J9^UnDr8D4NkhUYvbTRQAH8*Fa~^cmQ2#aDiWdt0~HO8f`sNd}9=0s6|b zZ5GarHcgzdg>#!7o(LlSIAvXz&zp=7hih9c9Wy#9mv+1QrKn!X4=Rd@d>DU}Kgu4; z(;OI-^hYV%r>ut>r+eP^ielBfCY5MOB^unZMGhutvLr?3^DM2t-aGu!Uzcu>B?+0A zbn-0i(USIPknm^8=EVanrB6t{6J%Qcc_R1(EFt|fZlu#U$cIbv;b5LjpChkcZ_pl> zR2pmfg&;eC;9wes6M%-Hf^4z?JsHj zMzlA#h+61+OS;|*`dptVX(8(_$+~7_!Dp+Hs6I2;LK-hgV\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