Compare commits
600
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
562fdbb06a | ||
|
|
f83f4c8451 | ||
|
|
838f3adba7 | ||
|
|
7d15137109 | ||
|
|
c210a14acc | ||
|
|
92c5cceea3 | ||
|
|
5eea9ca023 | ||
|
|
19bfd81a9b | ||
|
|
296d7557b7 | ||
|
|
3eea6dc8dc | ||
|
|
d7200b028a | ||
|
|
a79e8f8860 | ||
|
|
fa60e78ee2 | ||
|
|
46979f512d | ||
|
|
1231c01b05 | ||
|
|
bdf97fabd0 | ||
|
|
a8a8b41210 | ||
|
|
1091c221ba | ||
|
|
ccfe2230ef | ||
|
|
e3bfa40a70 | ||
|
|
1bb2a2fec0 | ||
|
|
77cf544636 | ||
|
|
33daf99b33 | ||
|
|
20b3131237 | ||
|
|
1a11e6ba36 | ||
|
|
2dd4eb7526 | ||
|
|
be37e4cc45 | ||
|
|
f668c23cf2 | ||
|
|
90c0f43c9d | ||
|
|
5819fa672e | ||
|
|
40f7314699 | ||
|
|
e942c940fa | ||
|
|
9c0f5a96ef | ||
|
|
e01b04e117 | ||
|
|
e3e6a36f3b | ||
|
|
74968f9b5a | ||
|
|
200b4f3015 | ||
|
|
35763a3c29 | ||
|
|
8996d04cb9 | ||
|
|
36b418ec65 | ||
|
|
62d1419a83 | ||
|
|
89cf7676e1 | ||
|
|
22b13fc772 | ||
|
|
7150429195 | ||
|
|
741eedcbe1 | ||
|
|
a1ae8852cf | ||
|
|
9bc4a82007 | ||
|
|
a414670cec | ||
|
|
c1487b1e59 | ||
|
|
5af7f07875 | ||
|
|
8708c60f33 | ||
|
|
a87b267515 | ||
|
|
0884741057 | ||
|
|
f2f4d5974c | ||
|
|
b72ae432e7 | ||
|
|
13e1d5420e | ||
|
|
f5a8db75c2 | ||
|
|
bdd110de18 | ||
|
|
8b198624ef | ||
|
|
8f0bcd136b | ||
|
|
5e275bedfd | ||
|
|
5791d2d0d3 | ||
|
|
01aa78127e | ||
|
|
10342a03cc | ||
|
|
1fd757e6fa | ||
|
|
8af1f7e6f5 | ||
|
|
41d752a75b | ||
|
|
783619455f | ||
|
|
6e50919487 | ||
|
|
7a9fe58b48 | ||
|
|
69f1ec0508 | ||
|
|
a8aea11b07 | ||
|
|
09f20eaf9f | ||
|
|
a4ca60e98f | ||
|
|
12e19ef445 | ||
|
|
a12f166b09 | ||
|
|
170d7e4cdb | ||
|
|
328a9d329d | ||
|
|
277e91a1ca | ||
|
|
6ca6765458 | ||
|
|
bced98bd71 | ||
|
|
b5cd86498b | ||
|
|
7045418dec | ||
|
|
a5b5842ec3 | ||
|
|
20b39325b6 | ||
|
|
cbade510a9 | ||
|
|
82d7d7db9a | ||
|
|
f3d110f7ec | ||
|
|
6968dcdf97 | ||
|
|
243d02a6f5 | ||
|
|
1aa71cceaa | ||
|
|
d8b100757f | ||
|
|
80a6b71e13 | ||
|
|
dfa36127f8 | ||
|
|
f17a5125f3 | ||
|
|
c58ca7575b | ||
|
|
4f1943b180 | ||
|
|
b147cb2ca3 | ||
|
|
3a4a01ba9e | ||
|
|
f84de89864 | ||
|
|
adc4608ba5 | ||
|
|
fd363c528b | ||
|
|
e60da9001a | ||
|
|
b2ea7dea08 | ||
|
|
eea46c8875 | ||
|
|
4f44f6f98f | ||
|
|
62358e931b | ||
|
|
a7319dac47 | ||
|
|
dc0cd05ef8 | ||
|
|
76e66f6104 | ||
|
|
b94008e412 | ||
|
|
2acc96fa62 | ||
|
|
dcca22245c | ||
|
|
27ff0c989e | ||
|
|
0df382465c | ||
|
|
28f2bc8bac | ||
|
|
58e7af6ddf | ||
|
|
e0adfcbb7b | ||
|
|
bc0ce2aada | ||
|
|
9e7e513b13 | ||
|
|
e43da1a226 | ||
|
|
cd036d3ec7 | ||
|
|
a162c6796e | ||
|
|
2e8b234b94 | ||
|
|
5f51aeeb63 | ||
|
|
4742d33e26 | ||
|
|
f0ece22743 | ||
|
|
62b29c6e61 | ||
|
|
c6688c8927 | ||
|
|
38a6412aa5 | ||
|
|
7244448c51 | ||
|
|
5705dfe107 | ||
|
|
cd53f3a842 | ||
|
|
d5ccbb092d | ||
|
|
3affb0a3fd | ||
|
|
028e5caf03 | ||
|
|
8dd881dc2f | ||
|
|
c0bf571c62 | ||
|
|
3b5508d997 | ||
|
|
77455f2776 | ||
|
|
5ca248aa14 | ||
|
|
d1b9344373 | ||
|
|
081c300b75 | ||
|
|
35d494f49e | ||
|
|
658284d692 | ||
|
|
900edf379c | ||
|
|
4ceee5b350 | ||
|
|
3154bbaa50 | ||
|
|
e3147bc8a5 | ||
|
|
9fcf2bf560 | ||
|
|
626e1ec24d | ||
|
|
9bc9cf6a47 | ||
|
|
94efebf36c | ||
|
|
f91eb31d88 | ||
|
|
03d5e3f4bc | ||
|
|
5bc355ad0c | ||
|
|
47ff14af65 | ||
|
|
60a4ce9f4a | ||
|
|
959693bc84 | ||
|
|
395e46aaab | ||
|
|
c0b534fe1d | ||
|
|
bdd3a553c0 | ||
|
|
3418ac3bd2 | ||
|
|
aff06c9b49 | ||
|
|
bf7182ed8f | ||
|
|
dc5cfb7f91 | ||
|
|
ea9df739a4 | ||
|
|
e6f6d5d00c | ||
|
|
77d3cf1967 | ||
|
|
e80a74d72a | ||
|
|
1baf7070a3 | ||
|
|
f1e2d15ebb | ||
|
|
a8ab3b5f4e | ||
|
|
403bea5f2c | ||
|
|
ca3dba5dd9 | ||
|
|
3f87bdec6e | ||
|
|
848114ea4e | ||
|
|
ef37b3c6a6 | ||
|
|
0fe26ef415 | ||
|
|
2f9341dcb8 | ||
|
|
77f96037fa | ||
|
|
1cb6f2f3c8 | ||
|
|
43fa619ebc | ||
|
|
db4e0aafb8 | ||
|
|
09e9872206 | ||
|
|
796b778bf0 | ||
|
|
174886e40a | ||
|
|
dd1f244d24 | ||
|
|
0f7623be22 | ||
|
|
1a27f856c5 | ||
|
|
d3993f57ff | ||
|
|
af788956aa | ||
|
|
96efc4ee45 | ||
|
|
359192efb0 | ||
|
|
8e841be786 | ||
|
|
9d207fd48f | ||
|
|
924acb11ff | ||
|
|
e035fe57e6 | ||
|
|
985e42abe2 | ||
|
|
8bd6a16cf0 | ||
|
|
16f468654a | ||
|
|
6aef60a421 | ||
|
|
ec50af2785 | ||
|
|
c0f2ed96b2 | ||
|
|
8b7e7aed4e | ||
|
|
c5e1ee690d | ||
|
|
f08d4825e7 | ||
|
|
c414e34ceb | ||
|
|
3fb1e0fd4a | ||
|
|
ae8ba555eb | ||
|
|
479e70f835 | ||
|
|
c796db53c5 | ||
|
|
84898abaaf | ||
|
|
2f983fade2 | ||
|
|
f6a8fd888a | ||
|
|
1c1da5a8ea | ||
|
|
4679718cc2 | ||
|
|
a52072d79e | ||
|
|
c8a48b4b0e | ||
|
|
f479381bfd | ||
|
|
33de80e6fd | ||
|
|
46c9eb079c | ||
|
|
1df64c2609 | ||
|
|
9aa00be403 | ||
|
|
3096db842c | ||
|
|
86474a1cf6 | ||
|
|
fa246bc681 | ||
|
|
546e39d530 | ||
|
|
3b24bfc971 | ||
|
|
3e6fa30d60 | ||
|
|
c1137c79e5 | ||
|
|
e7749890f7 | ||
|
|
8a03b75b27 | ||
|
|
bf9a7efe37 | ||
|
|
4e4a95926a | ||
|
|
09069234d4 | ||
|
|
2cba6ed51c | ||
|
|
ab0ed284f1 | ||
|
|
8b24f681cb | ||
|
|
1ac68fb63d | ||
|
|
531f089f10 | ||
|
|
aff081d139 | ||
|
|
4f821bc75c | ||
|
|
6eb47e400c | ||
|
|
80a748109a | ||
|
|
140ce8077d | ||
|
|
81aaf690f3 | ||
|
|
65ac980dae | ||
|
|
6bb686ec2d | ||
|
|
0894288476 | ||
|
|
8cf2831c51 | ||
|
|
e52db3c15d | ||
|
|
8edf5690a4 | ||
|
|
37697f48a0 | ||
|
|
9c15d167b4 | ||
|
|
bf4295b5b3 | ||
|
|
1eb50ff295 | ||
|
|
0698a42f8e | ||
|
|
b3929af419 | ||
|
|
32f9ff1863 | ||
|
|
777c929f88 | ||
|
|
e39dedb453 | ||
|
|
fc3ed649f1 | ||
|
|
dce76ae6fe | ||
|
|
285c5e429c | ||
|
|
724e09dfc9 | ||
|
|
c09f8e4950 | ||
|
|
4bbc5c08f3 | ||
|
|
a31d95bd28 | ||
|
|
02dc2ce868 | ||
|
|
3d19491f40 | ||
|
|
c7d490f469 | ||
|
|
4690a03256 | ||
|
|
a35db4f70a | ||
|
|
42f5c62154 | ||
|
|
7e456e996c | ||
|
|
e0b02e80af | ||
|
|
51a9075613 | ||
|
|
51abf16ddb | ||
|
|
945f6e5b9f | ||
|
|
e7edfbdc0a | ||
|
|
3e81d9dd88 | ||
|
|
cfbb494612 | ||
|
|
52d5fbd042 | ||
|
|
f0e156a112 | ||
|
|
839b2ee4de | ||
|
|
4beb29464a | ||
|
|
c3ffffd943 | ||
|
|
15fc4fdf0f | ||
|
|
90c1f95ac5 | ||
|
|
713344f2f8 | ||
|
|
1f17db49c2 | ||
|
|
9e40603988 | ||
|
|
44f970baa8 | ||
|
|
dceb900362 | ||
|
|
1110c18ae1 | ||
|
|
e3f9f97864 | ||
|
|
10bd447ed5 | ||
|
|
bc9cdd3896 | ||
|
|
a36690aa26 | ||
|
|
1db7cd2051 | ||
|
|
2ff12bdbcf | ||
|
|
904cb8cf16 | ||
|
|
d0d8fd4af1 | ||
|
|
102189d77a | ||
|
|
bbaec4b5ed | ||
|
|
2cfa9299d4 | ||
|
|
515b9525dd | ||
|
|
a393d793fc | ||
|
|
aa8e6754c5 | ||
|
|
bd937a1842 | ||
|
|
a40d4c4482 | ||
|
|
7376843595 | ||
|
|
8a40eeafe6 | ||
|
|
42138f0c2e | ||
|
|
bdfce6bf1b | ||
|
|
8b463b8aae | ||
|
|
2d8dab099b | ||
|
|
5cba134809 | ||
|
|
1f41eddfea | ||
|
|
38c9e2800c | ||
|
|
eea4d3e0c9 | ||
|
|
4442a74690 | ||
|
|
5688c351f1 | ||
|
|
cbc5b831b7 | ||
|
|
c69eba2e4e | ||
|
|
9c6d5ea86b | ||
|
|
d323b5013f | ||
|
|
953a0ac8b5 | ||
|
|
1019617d0f | ||
|
|
6c1b155953 | ||
|
|
6a1d059e53 | ||
|
|
5f318a93b3 | ||
|
|
03e1ef85fc | ||
|
|
b931b9aa9b | ||
|
|
ff0cf470c5 | ||
|
|
18cebd92dd | ||
|
|
3430c34988 | ||
|
|
380490c6a2 | ||
|
|
4a25ab7a25 | ||
|
|
8812e82f49 | ||
|
|
96471a964b | ||
|
|
29ff7a386b | ||
|
|
2c7e58e187 | ||
|
|
1ff33d6377 | ||
|
|
5ff5769845 | ||
|
|
997cd04fe2 | ||
|
|
45be6866ad | ||
|
|
a5ac1da9fd | ||
|
|
d67271a2cf | ||
|
|
2fb7a5e048 | ||
|
|
5f69c64971 | ||
|
|
602aa8c1bd | ||
|
|
0c270f4862 | ||
|
|
053efc5f75 | ||
|
|
ff705565a4 | ||
|
|
b41598c645 | ||
|
|
b1d2ca5dc4 | ||
|
|
4a8414e5c8 | ||
|
|
6bfe45f079 | ||
|
|
38d8332970 | ||
|
|
97eff89616 | ||
|
|
2ae3583c3a | ||
|
|
612b1889d8 | ||
|
|
07e2fc2dd4 | ||
|
|
76ced42747 | ||
|
|
e06ba873f3 | ||
|
|
db67f8de2a | ||
|
|
32d363fb7f | ||
|
|
2465b88422 | ||
|
|
8cea9a51eb | ||
|
|
4550baab10 | ||
|
|
55f392869a | ||
|
|
00b0412fee | ||
|
|
13b5c5a524 | ||
|
|
e044b265d1 | ||
|
|
2e784b10dc | ||
|
|
1a0eb9ce07 | ||
|
|
f7bdf34e52 | ||
|
|
d4c8769f77 | ||
|
|
d771987d25 | ||
|
|
5576d5a29a | ||
|
|
8383d19e2c | ||
|
|
fe986d59e2 | ||
|
|
d473bc8704 | ||
|
|
4c1b073dac | ||
|
|
def3e1f1c1 | ||
|
|
33f27e5a9d | ||
|
|
dd585eeb14 | ||
|
|
3638758a6a | ||
|
|
a48189188f | ||
|
|
beec9a1e5b | ||
|
|
41c810d9ae | ||
|
|
cf6a378e0a | ||
|
|
5aa5782130 | ||
|
|
b7ca1ab432 | ||
|
|
62e4b4bc29 | ||
|
|
6ed480d1d9 | ||
|
|
6806b68d9d | ||
|
|
537c2cf71f | ||
|
|
54b87d8fc6 | ||
|
|
cc2a9b39fb | ||
|
|
67866b3be6 | ||
|
|
62bd563c9e | ||
|
|
4954b97248 | ||
|
|
75c9a2ef3b | ||
|
|
2a66d6b648 | ||
|
|
92dd34a742 | ||
|
|
d66ba3430a | ||
|
|
b38c9e5144 | ||
|
|
4f648c3c7e | ||
|
|
0754a00faf | ||
|
|
d60766d252 | ||
|
|
be1deaa875 | ||
|
|
00b02b19ed | ||
|
|
8f38b63312 | ||
|
|
ab138911f5 | ||
|
|
b88b68e3cf | ||
|
|
59f12247f5 | ||
|
|
690daa1783 | ||
|
|
8564556ddd | ||
|
|
99e8b2bb31 | ||
|
|
387e9537a5 | ||
|
|
290c7413ea | ||
|
|
84b35dcbd0 | ||
|
|
361a781b44 | ||
|
|
1b205c9d8d | ||
|
|
3ca9122aa9 | ||
|
|
62e612da4f | ||
|
|
8f3d0564d7 | ||
|
|
3f9096cac1 | ||
|
|
3eafa61ba7 | ||
|
|
d2a7319945 | ||
|
|
9de60a586a | ||
|
|
d54e4dadbe | ||
|
|
9445741cd1 | ||
|
|
dfdda43ed7 | ||
|
|
6e04d0c427 | ||
|
|
98b68e0d2c | ||
|
|
6ccb9e2fb7 | ||
|
|
8c429cdb4e | ||
|
|
abcc901da6 | ||
|
|
561f7fc040 | ||
|
|
163382d835 | ||
|
|
a3c6fa4e6f | ||
|
|
02ba3841f3 | ||
|
|
5a07dd88c6 | ||
|
|
3fbecd2480 | ||
|
|
a32f2d8d51 | ||
|
|
9c181346f0 | ||
|
|
3c7cbc9a49 | ||
|
|
bee3835ab6 | ||
|
|
e231990b74 | ||
|
|
8667244185 | ||
|
|
5297e676b0 | ||
|
|
a81f6956a5 | ||
|
|
aac19c3b31 | ||
|
|
ea49e88bb5 | ||
|
|
18dd8cac93 | ||
|
|
28306a0bf4 | ||
|
|
3430645c48 | ||
|
|
869cd9f118 | ||
|
|
e5dcf43212 | ||
|
|
7d1812fe7e | ||
|
|
9773eb5a15 | ||
|
|
8777a0ee1e | ||
|
|
f829b1bf91 | ||
|
|
b0d01d4c2c | ||
|
|
f1acb5e0d5 | ||
|
|
9655233957 | ||
|
|
1ea98777ca | ||
|
|
b21d78ef8b | ||
|
|
4053357d17 | ||
|
|
c57394f6aa | ||
|
|
c47b012160 | ||
|
|
a1d66d4e42 | ||
|
|
b9c55e9f41 | ||
|
|
d3b6d8c9f3 | ||
|
|
f52dc92ad0 | ||
|
|
6846dc43dd | ||
|
|
78dca2345a | ||
|
|
aaa5f81719 | ||
|
|
d8268a5c5e | ||
|
|
699b1415d3 | ||
|
|
8fdebc3f79 | ||
|
|
2b968797b5 | ||
|
|
c4f62cf446 | ||
|
|
3c4c8bae1c | ||
|
|
d3494a9429 | ||
|
|
318ffc4060 | ||
|
|
1fcfbe0cb3 | ||
|
|
b6be5cfbb5 | ||
|
|
13e14ab179 | ||
|
|
193de7d191 | ||
|
|
49f4af524c | ||
|
|
9c514656a2 | ||
|
|
fa97100070 | ||
|
|
429494fb13 | ||
|
|
d3012d9753 | ||
|
|
6d397343bd | ||
|
|
4083a4e95e | ||
|
|
0ab9fb1041 | ||
|
|
531a1670bd | ||
|
|
e114a33e8c | ||
|
|
39a211e6b6 | ||
|
|
07cf64904e | ||
|
|
1ea37388af | ||
|
|
a7e06a91aa | ||
|
|
9302411eb4 | ||
|
|
4aca694f11 | ||
|
|
eb052c160e | ||
|
|
8b0851a5d9 | ||
|
|
1518db862b | ||
|
|
1832a4335c | ||
|
|
17945cd5d2 | ||
|
|
994d8479ef | ||
|
|
a442eea8bb | ||
|
|
94a9262faf | ||
|
|
05af777974 | ||
|
|
0decb74ba2 | ||
|
|
02295c4b37 | ||
|
|
e0503bf667 | ||
|
|
3f1d184f9b | ||
|
|
096aeb789c | ||
|
|
b014c9d39d | ||
|
|
097200d512 | ||
|
|
fb93619c6e | ||
|
|
d286d6355a | ||
|
|
a897c63f31 | ||
|
|
766ea73c52 | ||
|
|
ed19bd7c71 | ||
|
|
06a2f38faa | ||
|
|
38be51fdc7 | ||
|
|
636ef25a7a | ||
|
|
4219566d11 | ||
|
|
08920e3f8c | ||
|
|
f5c1e9efcf | ||
|
|
2d78513cfe | ||
|
|
e43b659d50 | ||
|
|
97662e04e3 | ||
|
|
0d2eab4f07 | ||
|
|
66da4a7f96 | ||
|
|
2f9a6cef54 | ||
|
|
0563f93c97 | ||
|
|
d83b8d5675 | ||
|
|
1f0214abda | ||
|
|
b68b0be609 | ||
|
|
46abb12de5 | ||
|
|
6fde03c4a0 | ||
|
|
e73736b83c | ||
|
|
3db68542cd | ||
|
|
9d3352fd9f | ||
|
|
573f342462 | ||
|
|
df7afdf59f | ||
|
|
fcf37f7e42 | ||
|
|
8ec4760b8f | ||
|
|
7595be65f2 | ||
|
|
f0e4a17c99 | ||
|
|
643e6321c3 | ||
|
|
90f27a4b06 | ||
|
|
6a020331e4 | ||
|
|
339b7c7d24 | ||
|
|
0957aac8b0 | ||
|
|
999c8fb653 | ||
|
|
1bb7b75060 | ||
|
|
d4adeacaa4 | ||
|
|
07527ad229 | ||
|
|
2974f5034b | ||
|
|
56d940ca03 | ||
|
|
a521a5721a | ||
|
|
5f4700674e | ||
|
|
10a8de8f1f | ||
|
|
85cda5069b | ||
|
|
e009296c4e | ||
|
|
029d505706 | ||
|
|
b3e903f455 | ||
|
|
1a11905b03 | ||
|
|
60d4102d2b | ||
|
|
648f0c17e1 | ||
|
|
3311cb01a7 | ||
|
|
c3cf78513e | ||
|
|
321461ffac | ||
|
|
ae92094ccf | ||
|
|
21e99eb292 | ||
|
|
5ccfcd25d0 | ||
|
|
c6ace32787 | ||
|
|
cc022dc858 | ||
|
|
a0e510a210 | ||
|
|
d47852bfbe | ||
|
|
ee1185428a | ||
|
|
59457b5974 | ||
|
|
c49071215a | ||
|
|
1cf2b67ddd | ||
|
|
d84f35e449 | ||
|
|
a0082082f7 | ||
|
|
f07071178d | ||
|
|
bf83a938f6 | ||
|
|
3d56add348 | ||
|
|
8ade441c5c | ||
|
|
4e2c568c75 |
No files matched your search
@@ -1,4 +1,62 @@
|
||||
Version 3.2.0 (beta1) -- the "I am your father" release.
|
||||
Version 3.2.6 -- the "So far, so good." bug fix release.
|
||||
* fix memory leaks
|
||||
* fix corrupted reports
|
||||
* fix crash in cramplets
|
||||
* fix gedcom import and export
|
||||
* import speed improvements
|
||||
* NarrativeWeb fixes
|
||||
* prevent corrupting databases
|
||||
* many translation updates
|
||||
* other changes; see the changelog and the 3.2.6 roadmap: http://www.gramps-project.org/bugs/roadmap_page.php?version_id=23
|
||||
|
||||
Version 3.2.5 -- the "I intend to live forever" bug fix release.
|
||||
* fix Gramps so it again runs with Python 2.5
|
||||
* write all notes and sources to gedcom files
|
||||
* cli fixes
|
||||
* GeneWeb and LegacyGedcom fixes
|
||||
* NarrativeWeb fixes
|
||||
* memory leak fixes
|
||||
* various other small fixes
|
||||
* many translation updates
|
||||
|
||||
Version 3.2.4 -- the "Tententen" bug fix release.
|
||||
* fix a crash on newer distro's after an export is finished
|
||||
* styled notes cleanup and consistency improvement (nar web behaves like the pdf/html output of reports)
|
||||
* newlines in styled notes are written as newlines so users can make simple lists
|
||||
* many NarrativeWeb fixes
|
||||
* gedcom output fixes
|
||||
* non latin character fixes (mainly for windows)
|
||||
* recursive filter fixes
|
||||
* undo fixes
|
||||
* many translation updates
|
||||
|
||||
Version 3.2.3 -- the "I used to eat there. Really good noodles." release.
|
||||
* Bug fixes:
|
||||
-> several GLADE fixes
|
||||
-> several GEDCOM fixes (both export and import)
|
||||
-> several crash fixes
|
||||
-> encoding fix (Windows only)
|
||||
-> privacy/living fixes
|
||||
-> updates to NarrativeWeb and the css stylsheets
|
||||
* Translation updates: bg, ca, de, es, fr, he, nb, nl, pl, sk, sv
|
||||
|
||||
Version 3.2.2 -- the "Mea navis aëricumbens anguillis abundat" release.
|
||||
* This release is a quick fix to a problem introduced by NarrativeWeb in the previous release.
|
||||
* Also includes a few small fixes and translation updates to hr and it.
|
||||
* See the release notes from the 3.2.1 release for the full list of changes and translation updates.
|
||||
|
||||
Version 3.2.1 -- the "One of those men is my father" release.
|
||||
* Many bug fixes:
|
||||
-> fixed missing icons
|
||||
-> load/reload plugins must unload old plugins
|
||||
-> import/export fixes (date ranges, underscore, latitude/longitude)
|
||||
-> narrative web crash fixes and many updates, html notes, css updates
|
||||
-> geoview fixes and updates
|
||||
-> unicode error in soundex
|
||||
-> fixed crash on data entry
|
||||
* Translation updates: bg, ca, de, es, fr, he, hr, it, nb, nl, sk, sv
|
||||
|
||||
Version 3.2.0 -- the "I am your father" release.
|
||||
* New Plugin System:
|
||||
-> In the Help Menu -> Menu Status, all available plugins are visible. All
|
||||
plugins can be hidden, saving resources and hiding options you do not need.
|
||||
|
||||
+3
-3
@@ -5,13 +5,13 @@ dnl May need to run automake && aclocal first
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
dnl NOTE: arg to macro below becomes the "VERSION"
|
||||
AC_INIT(gramps, 3.2.0, [gramps-bugs@lists.sourceforge.net])
|
||||
AC_INIT(gramps, 3.2.7, [gramps-bugs@lists.sourceforge.net])
|
||||
AC_CONFIG_SRCDIR(configure.in)
|
||||
AM_INIT_AUTOMAKE([1.6.3 foreign])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
RELEASE=0beta.SVN$(svnversion -n .)
|
||||
RELEASE=0.SVN$(svnversion -n .)
|
||||
dnl RELEASE=0beta3
|
||||
dnl RELEASE=0rc1
|
||||
dnl RELEASE=1
|
||||
@@ -33,7 +33,7 @@ AC_SUBST(RELEASE)
|
||||
AC_SUBST(VERSIONSTRING)
|
||||
|
||||
dnl Add the languages which your application supports here.
|
||||
ALL_LINGUAS="hu zh_CN cs da de es fr it nb nl nn pl pt_BR ru sv eo fi lt sk bg hr sl ca sq"
|
||||
ALL_LINGUAS="hu zh_CN cs da de es fr it nb nl nn pl pt_BR ru sv fi lt sk bg hr sl ca sq he"
|
||||
GETTEXT_PACKAGE=gramps
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the Gettext package name.])
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: gramps
|
||||
Section: gnome
|
||||
Priority: optional
|
||||
Maintainer: Stéphane Charette <stephanecharette@gmail.com>
|
||||
Build-Depends-Indep: libxml-parser-perl, python-gtk2, gettext, libgconf2-dev, python-central (>= 0.5.6), python, intltool
|
||||
Build-Depends-Indep: libxml-parser-perl, python-gtk2, gettext, python-central (>= 0.5.6), python, intltool
|
||||
Build-Depends: debhelper (>= 7)
|
||||
Standards-Version: 3.8.3
|
||||
Homepage: http://www.gramps-project.org/
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#########################################
|
||||
The :class:`RelationshipCalculator` Class
|
||||
#########################################
|
||||
|
||||
Contents:
|
||||
|
||||
.. automodule:: Relationship
|
||||
.. autoclass:: RelationshipCalculator
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
+2447
-2020
File diff suppressed because it is too large.
Load diff
+3320
-3598
File diff suppressed because it is too large.
Load diff
+6
-16
@@ -22,28 +22,14 @@
|
||||
|
||||
""" Unittest for testing POTFILES.in and Makefile contents """
|
||||
|
||||
# PYTHONPATH=/../src python po_test.py
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import glob
|
||||
from test import test_util
|
||||
test_util.path_append_parent()
|
||||
|
||||
excluded_files = ["src/DataViews/_MapView.py",
|
||||
"src/plugins/PHPGedViewConnector.py",
|
||||
"src/plugins/phpgedview.glade",
|
||||
"src/plugins/Ancestors.py",
|
||||
"src/plugins/DesGraph.py",
|
||||
"src/plugins/FtmStyleAncestors.py",
|
||||
"src/plugins/FtmStyleDescendants.py",
|
||||
"src/plugins/IndivSummary.py",
|
||||
"src/date_test.py",
|
||||
"src/plugins/CmdRef.py",
|
||||
"src/plugins/DumpGenderStats.py",
|
||||
"src/plugins/Eval.py",
|
||||
"src/plugins/Leak.py",
|
||||
"src/plugins/TestcaseGenerator.py"
|
||||
]
|
||||
|
||||
def get_potfile(filename):
|
||||
fp = open(filename, "r")
|
||||
retvals = []
|
||||
@@ -53,6 +39,10 @@ def get_potfile(filename):
|
||||
fp.close()
|
||||
return retvals
|
||||
|
||||
# POTFILES.skip
|
||||
|
||||
excluded_files = get_potfile("../POTFILES.skip")
|
||||
|
||||
class TestPOT(unittest.TestCase):
|
||||
potfiles = get_potfile("../POTFILES.in")
|
||||
count = 1
|
||||
|
||||
+5556
-3163
File diff suppressed because it is too large.
Load diff
@@ -126,6 +126,7 @@ class Bookmarks :
|
||||
self.uistate.uimanager.remove_ui(self.active)
|
||||
self.uistate.uimanager.remove_action_group(self.action_group)
|
||||
self.action_group = gtk.ActionGroup('Bookmarks')
|
||||
self.uistate.uimanager.ensure_update()
|
||||
self.active = DISABLED
|
||||
|
||||
def redraw_and_report_change(self):
|
||||
|
||||
+4
-1
@@ -62,7 +62,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
from gen.lib import Date
|
||||
from gen.lib.date import Date, NextYear
|
||||
import DateHandler
|
||||
import const
|
||||
import GrampsDisplay
|
||||
@@ -150,6 +150,9 @@ class DateEdit(object):
|
||||
# if text could not be parsed it is assumed invalid
|
||||
if self.date_obj.get_modifier() == Date.MOD_TEXTONLY:
|
||||
return ValidationError(_('Bad Date'))
|
||||
elif (self.date_obj.to_calendar(calendar_name=Date.CAL_GREGORIAN) >>
|
||||
NextYear()):
|
||||
return ValidationError(_('Date more than one year in the future'))
|
||||
|
||||
def invoke_date_editor(self, obj):
|
||||
"""
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
# but that is not necessarily portable.
|
||||
# If not using GNU make, then list all .py files individually
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/DateHandler
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_Date_bg.py\
|
||||
_Date_ca.py\
|
||||
_Date_cs.py\
|
||||
@@ -22,6 +20,7 @@ pkgdata_PYTHON = \
|
||||
_Date_pt.py\
|
||||
_Date_ru.py\
|
||||
_Date_sk.py\
|
||||
_Date_sl.py\
|
||||
_Date_sr.py\
|
||||
_Date_sv.py\
|
||||
_DateDisplay.py\
|
||||
@@ -31,7 +30,7 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/DateHandler
|
||||
pkgpythondir = @pkgpythondir@/DateHandler
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/DateHandler
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -49,4 +48,4 @@ docs:
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -139,7 +139,12 @@ class DateDisplay(object):
|
||||
Formats the extra items (calendar, newyear) for a date.
|
||||
"""
|
||||
scal = self.calendar[cal]
|
||||
snewyear = self.newyear[newyear]
|
||||
if isinstance(newyear, int) and newyear <= len(self.newyear):
|
||||
snewyear = self.newyear[newyear]
|
||||
elif isinstance(newyear, (list, tuple)):
|
||||
snewyear = "%s-%s" % (newyear[0], newyear[1])
|
||||
else:
|
||||
snewyear = "Err"
|
||||
retval = ""
|
||||
for item in [scal, snewyear]:
|
||||
if item:
|
||||
|
||||
@@ -96,18 +96,20 @@ def julian_valid(date_tuple):
|
||||
|
||||
def swedish_valid(date_tuple):
|
||||
""" Checks if date_tuple is a valid date in Swedish Calendar """
|
||||
valid = gregorian_valid(date_tuple)
|
||||
# not sure how <= and >= works with tuples???
|
||||
valid_J = julian_valid(date_tuple)
|
||||
date_tuple = (date_tuple[2], date_tuple[1], date_tuple[0])
|
||||
if date_tuple <= (1700, 2, 28):
|
||||
valid = False
|
||||
if date_tuple == (1700, 2, 29): # leapday 1700 was skipped
|
||||
valid = False
|
||||
if date_tuple == (1712, 2, 30): # extra day was inserted 1712
|
||||
valid = True
|
||||
if date_tuple >= (1712, 3, 1): # back to julian
|
||||
valid = False
|
||||
return valid
|
||||
# Swedish calendar starts as Julian 1700-03-01 and ends 1712-03-01 as Julian
|
||||
if date_tuple >= (1700, 2, 29) and date_tuple < (1712, 3, 1):
|
||||
if date_tuple == (1712, 2, 30): # extra day was inserted 1712, not valid Julian
|
||||
return True
|
||||
if valid_J:
|
||||
if date_tuple == (1700, 2, 29): # leapday 1700 was skipped
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
|
||||
def french_valid(date_tuple):
|
||||
""" Checks if date_tuple is a valid date in French Calendar """
|
||||
@@ -154,11 +156,17 @@ class DateParser(object):
|
||||
modifier_after_to_int = {}
|
||||
|
||||
hebrew_to_int = {
|
||||
"tishri" : 1, "heshvan" : 2, "kislev" : 3,
|
||||
"tevet" : 4, "shevat" : 5, "adari" : 6,
|
||||
"adarii" : 7, "nisan" : 8, "iyyar" : 9,
|
||||
"sivan" : 10, "tammuz" : 11, "av" : 12,
|
||||
"elul" : 13,
|
||||
u"tishri" : 1, u"heshvan" : 2, u"kislev" : 3,
|
||||
u"tevet" : 4, u"shevat" : 5, u"adari" : 6,
|
||||
u"adarii" : 7, u"nisan" : 8, u"iyyar" : 9,
|
||||
u"sivan" : 10, u"tammuz" : 11, u"av" : 12,
|
||||
u"elul" : 13,
|
||||
#alternative spelling
|
||||
u"cheshvan": 2, u"adar sheni": 7, u"iyar" : 9,
|
||||
#GEDCOM months
|
||||
u"tsh" : 1, u"csh": 5, u"ksl": 3, u"tvt": 4, u"shv": 5, u"adr": 6,
|
||||
u"ads" : 7, u"nsn": 8, u"iyr": 9, u"svn":10, u"tmz":11, u"aav":12,
|
||||
u"ell":13,
|
||||
}
|
||||
|
||||
french_to_int = {
|
||||
@@ -168,7 +176,15 @@ class DateParser(object):
|
||||
u'germinal' : 7, u'floréal' : 8,
|
||||
u'prairial' : 9, u'messidor' : 10,
|
||||
u'thermidor' : 11, u'fructidor' : 12,
|
||||
u'extra' : 13
|
||||
u'extra' : 13,
|
||||
#GEDCOM months
|
||||
u'vend' : 1, u'brum' : 2,
|
||||
u'frim' : 3, u'nivo' : 4,
|
||||
u'pluv' : 5, u'vent' : 6,
|
||||
u'germ' : 7, u'flor' : 8,
|
||||
u'prai' : 9, u'mess' : 10,
|
||||
u'ther' : 11, u'fruc' : 12,
|
||||
u'comp' : 13,
|
||||
}
|
||||
|
||||
islamic_to_int = {
|
||||
@@ -202,7 +218,7 @@ class DateParser(object):
|
||||
"januari" : 1, "februari" : 2,
|
||||
"mars" : 3, "april" : 4,
|
||||
"maj" : 5, "juni" : 6,
|
||||
"juli" : 7, "augisti" : 8,
|
||||
"juli" : 7, "augusti" : 8,
|
||||
"september" : 9, "oktober" : 10,
|
||||
"november" : 11, "december" : 12,
|
||||
}
|
||||
@@ -430,7 +446,6 @@ class DateParser(object):
|
||||
m = 0
|
||||
else:
|
||||
m = mmap[groups[1].lower()]
|
||||
|
||||
d = self._get_int(groups[0])
|
||||
|
||||
if groups[2] is None:
|
||||
@@ -586,11 +601,15 @@ class DateParser(object):
|
||||
text_parser = self.parser[cal]
|
||||
(text1, bc1) = self.match_bce(match.group('start'))
|
||||
start = self._parse_subdate(text1, text_parser)
|
||||
if start == Date.EMPTY and text1 != "":
|
||||
return 0
|
||||
if bc1:
|
||||
start = self.invert_year(start)
|
||||
|
||||
(text2, bc2) = self.match_bce(match.group('stop'))
|
||||
stop = self._parse_subdate(text2, text_parser)
|
||||
if stop == Date.EMPTY and text2 != "":
|
||||
return 0
|
||||
if bc2:
|
||||
stop = self.invert_year(stop)
|
||||
|
||||
@@ -609,11 +628,15 @@ class DateParser(object):
|
||||
text_parser = self.parser[cal]
|
||||
(text1, bc1) = self.match_bce(match.group('start'))
|
||||
start = self._parse_subdate(text1, text_parser)
|
||||
if start == Date.EMPTY and text1 != "":
|
||||
return 0
|
||||
if bc1:
|
||||
start = self.invert_year(start)
|
||||
|
||||
(text2, bc2) = self.match_bce(match.group('stop'))
|
||||
stop = self._parse_subdate(text2, text_parser)
|
||||
if stop == Date.EMPTY and text2 != "":
|
||||
return 0
|
||||
if bc2:
|
||||
stop = self.invert_year(stop)
|
||||
|
||||
@@ -666,7 +689,10 @@ class DateParser(object):
|
||||
start = self._parse_subdate(grps[0], self.parser[cal])
|
||||
mod = self.modifier_after_to_int.get(grps[1].lower(),
|
||||
Date.MOD_NONE)
|
||||
if bc:
|
||||
if start == Date.EMPTY:
|
||||
date.set_modifier(Date.MOD_TEXTONLY)
|
||||
date.set_text_value(text)
|
||||
elif bc:
|
||||
date.set(qual, mod, cal, self.invert_year(start), newyear=ny)
|
||||
else:
|
||||
date.set(qual, mod, cal, start, newyear=ny)
|
||||
@@ -676,7 +702,10 @@ class DateParser(object):
|
||||
grps = match.groups()
|
||||
start = self._parse_subdate(grps[0])
|
||||
mod = Date.MOD_ABOUT
|
||||
if bc:
|
||||
if start == Date.EMPTY:
|
||||
date.set_modifier(Date.MOD_TEXTONLY)
|
||||
date.set_text_value(text)
|
||||
elif bc:
|
||||
date.set(qual, mod, cal, self.invert_year(start), newyear=ny)
|
||||
else:
|
||||
date.set(qual, mod, cal, start, newyear=ny)
|
||||
@@ -712,6 +741,8 @@ class DateParser(object):
|
||||
if subdate == Date.EMPTY and text != "":
|
||||
date.set_as_text(text)
|
||||
return
|
||||
#else:
|
||||
# print 'valid subdate', text, subdate
|
||||
except:
|
||||
date.set_as_text(text)
|
||||
return
|
||||
|
||||
@@ -194,12 +194,12 @@ class DateDisplayBG(DateDisplay):
|
||||
|
||||
calendar = (
|
||||
u"",
|
||||
u" (юлиански)",
|
||||
u" (еврейски)",
|
||||
u" (републикански)",
|
||||
u" (персийски)",
|
||||
u" (ислямски)",
|
||||
u" (шведски)"
|
||||
u"юлиански",
|
||||
u"еврейски",
|
||||
u"републикански",
|
||||
u"персийски",
|
||||
u"ислямски",
|
||||
u"шведски"
|
||||
)
|
||||
|
||||
_mod_str = ("", "преди ", "след ", "около ", "", "", "")
|
||||
@@ -282,6 +282,7 @@ class DateDisplayBG(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -292,14 +293,17 @@ class DateDisplayBG(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'от', d1, u'до', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'от', d1, u'до', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+15
-12
@@ -116,18 +116,17 @@ class DateDisplayCA(DateDisplay):
|
||||
"""
|
||||
Catalan language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = ( u"", u"Gener", u"Febrer", u"Març", u"Abril", u"Maig",
|
||||
u"Juny", u"Juliol", u"Agost", u"Setembre", u"Octubre",
|
||||
u"Novembre", u"Desembre" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"Gen", u"Feb", u"Mar", u"Abr", u"Mai", u"Jun",
|
||||
u"Jul", u"Ago", u"Set", u"Oct", u"Nov", u"Des" )
|
||||
|
||||
calendar = (
|
||||
"", u" (Julià)", u" (Hebreu)",
|
||||
u" (Revolucionari)", u" (Persa)", u" (Islàmic)",
|
||||
u" (Swedish)"
|
||||
"", u"Julià", u"Hebreu",
|
||||
u"Revolucionari", u"Persa", u"Islàmic",
|
||||
u"Suec"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"abans de ", u"després de ", u"cap a ", "", "", "")
|
||||
@@ -164,6 +163,7 @@ class DateDisplayCA(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -174,14 +174,17 @@ class DateDisplayCA(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'des de', d1, u'fins a', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'des de', d1, u'fins a', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'i', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'i', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+15
-12
@@ -102,18 +102,17 @@ class DateDisplayCZ(DateDisplay):
|
||||
"""
|
||||
Czech language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = ( u"", u"Leden", u"Únor", u"Březen", u"Duben", u"Květen",
|
||||
u"Červen", u"červenec", u"Srpen", u"Září", u"Říjen",
|
||||
u"Listopad", u"Prosinec" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"Led", u"Úno", u"Bře", u"Dub", u"Kvě", u"čer",
|
||||
u"Čvc", u"Srp", u"Zář", u"Říj", u"Lis", u"Pro" )
|
||||
|
||||
calendar = (
|
||||
"", u" (juliánský)", u" (hebrejský)",
|
||||
u" (republikánský)", u" (perský)", u" (islámský)",
|
||||
u" (swedish)"
|
||||
"", u"juliánský", u"hebrejský",
|
||||
u"republikánský", u"perský", u"islámský",
|
||||
u"švédský"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"před ", u"po ", u"kolem ", "", "", "")
|
||||
@@ -133,6 +132,7 @@ class DateDisplayCZ(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -143,17 +143,20 @@ class DateDisplayCZ(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d1,
|
||||
u'do', d2, self.calendar[cal])
|
||||
u'do', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'mezi',
|
||||
d1, u'a', d2, self.calendar[cal])
|
||||
d1, u'a', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod],
|
||||
text, self.calendar[cal])
|
||||
text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -206,9 +206,9 @@ class DateDisplayDE(DateDisplay):
|
||||
u"Jul", u"Aug", u"Sep", u"Okt", u"Nov", u"Dez" )
|
||||
|
||||
calendar = (
|
||||
"", u" (julianisch)", u" (hebräisch)",
|
||||
u" (französisch republikanisch)", u" (persisch)", u" (islamisch)",
|
||||
u" (schwedisch)"
|
||||
"", u"julianisch", u"hebräisch",
|
||||
u"französisch republikanisch", u"persisch", u"islamisch",
|
||||
u"schwedisch"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"vor ", u"nach ", u"etwa ", "", "", "")
|
||||
@@ -289,6 +289,7 @@ class DateDisplayDE(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -299,14 +300,17 @@ class DateDisplayDE(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'von', d1, u'bis', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'von', d1, u'bis', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%szwischen %s und %s%s" % (qual_str, d1, d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%szwischen %s und %s%s" % (qual_str, d1, d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -127,9 +127,9 @@ class DateDisplayES(DateDisplay):
|
||||
u"dic" )
|
||||
|
||||
calendar = (
|
||||
"", u" (Juliano)", u" (Hebreo)",
|
||||
u" (Revolucionario)", u" (Persa)", u" (Islámico)",
|
||||
u" (Swedish)"
|
||||
"", u"Juliano", u"Hebreo",
|
||||
u"Revolucionario", u"Persa", u"Islámico",
|
||||
u"Swedish"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"antes de ", u"después de ", u"hacia ", "", "", "")
|
||||
@@ -149,6 +149,7 @@ class DateDisplayES(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -159,14 +160,17 @@ class DateDisplayES(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'y', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'y', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+19
-16
@@ -116,22 +116,22 @@ class DateDisplayFI(DateDisplay):
|
||||
"""
|
||||
Finnish language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = (u"", u"Tammikuu", u"Helmikuu", u"Maaliskuu", u"Huhtikuu",
|
||||
u"Toukokuu", u"Kesäkuu", u"Heinäkuu", u"Elokuu",
|
||||
u"Syyskuu", u"Lokakuu", u"Marraskuu", u"Joulukuu")
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = (u"", u"Tammi", u"Helmi", u"Maali", u"Huhti", u"Touko",
|
||||
u"Kesäk", u"Heinä", u"Eloku", u"Syysk", u"Lokak", u"Marra",
|
||||
u"Joulu")
|
||||
|
||||
calendar = ("",
|
||||
u"(juliaaninen)",
|
||||
u"(heprealainen)",
|
||||
u"(ranskan v.)",
|
||||
u"(persialainen)",
|
||||
u"(islamilainen)",
|
||||
u" (svensk)"
|
||||
)
|
||||
u"juliaaninen",
|
||||
u"heprealainen",
|
||||
u"ranskan v.",
|
||||
u"persialainen",
|
||||
u"islamilainen",
|
||||
u"svensk"
|
||||
)
|
||||
|
||||
_qual_str = (u"", u"arviolta", u"laskettuna")
|
||||
|
||||
@@ -139,7 +139,7 @@ class DateDisplayFI(DateDisplay):
|
||||
|
||||
formats = (
|
||||
"VVVV-KK-PP (ISO)",
|
||||
"PP.KK.VVVV"
|
||||
"PP.KK.VVVV"
|
||||
)
|
||||
|
||||
def display(self, date):
|
||||
@@ -150,6 +150,7 @@ class DateDisplayFI(DateDisplay):
|
||||
qual = date.get_quality()
|
||||
cal = date.get_calendar()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
if mod == Date.MOD_TEXTONLY:
|
||||
return date.get_text()
|
||||
@@ -185,9 +186,11 @@ class DateDisplayFI(DateDisplay):
|
||||
if qual:
|
||||
# prepend quality
|
||||
text = u"%s %s" % (self._qual_str[qual], text)
|
||||
if cal:
|
||||
|
||||
if cal or newyear:
|
||||
# append calendar type
|
||||
text = u"%s %s" % (text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
text = u"%s %s" % (text, scal)
|
||||
|
||||
return text
|
||||
|
||||
|
||||
+23
-12
@@ -58,6 +58,15 @@ class DateParserFR(DateParser):
|
||||
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
# Custom short months not the same as long months
|
||||
|
||||
month_to_int[u"janv"] = 1
|
||||
month_to_int[u"févr"] = 2
|
||||
month_to_int[u"juil"] = 7
|
||||
month_to_int[u"sept"] = 9
|
||||
month_to_int[u"oct"] = 10
|
||||
month_to_int[u"déc"] = 12
|
||||
|
||||
# Add common value
|
||||
|
||||
month_to_int[u"bluviose"] = 5
|
||||
@@ -230,7 +239,6 @@ class DateParserFR(DateParser):
|
||||
self._stext2 = re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?' %
|
||||
self._smon_str, re.IGNORECASE)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# French display
|
||||
@@ -247,8 +255,8 @@ class DateDisplayFR(DateDisplay):
|
||||
short_months = ( u"", u"janv", u"févr", u"mars", u"avril", u"mai", u"juin",
|
||||
u"juil", u"août", u"sept", u"oct", u"nov", u"déc" )
|
||||
|
||||
calendar = ("", u" (Julien)", u" (Hébreu)", u" (Révolutionnaire)",
|
||||
u" (Perse)", u" (Islamique)", u" (Suédois)")
|
||||
calendar = ("", u"Julien", u"Hébreu", u"Révolutionnaire",
|
||||
u"Perse", u"Islamique", u"Suédois")
|
||||
|
||||
_mod_str = ("", u"avant ", u"après ", u"vers ", "", "", "")
|
||||
|
||||
@@ -383,6 +391,7 @@ class DateDisplayFR(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = (self._qual_str)[qual]
|
||||
|
||||
@@ -391,20 +400,22 @@ class DateDisplayFR(DateDisplay):
|
||||
elif start == Date.EMPTY:
|
||||
return ""
|
||||
elif mod == Date.MOD_SPAN:
|
||||
date1 = (self.display_cal)[cal](start)
|
||||
date2 = (self.display_cal)[cal](date.get_stop_date())
|
||||
date1 = self.display_cal[cal](start)
|
||||
date2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'de', date1, u'à',
|
||||
date2, (self.calendar)[cal])
|
||||
date2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
date1 = (self.display_cal)[cal](start)
|
||||
date2 = (self.display_cal)[cal](date.get_stop_date())
|
||||
date1 = self.display_cal[cal](start)
|
||||
date2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', date1, u'et',
|
||||
date2, (self.calendar)[cal])
|
||||
date2, scal)
|
||||
else:
|
||||
text = (self.display_cal)[date.get_calendar()](start)
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, (self._mod_str)[mod], text,
|
||||
(self.calendar)[cal])
|
||||
|
||||
scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -227,9 +227,9 @@ class DateDisplayHR(DateDisplay):
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", u" (julijanski)", u" (hebrejski)",
|
||||
u" (francuski republikanski)", u" (perzijski)", u" (islamski)",
|
||||
u" (swedish)"
|
||||
"", u"julijanski", u"hebrejski",
|
||||
u"francuski republikanski", u"perzijski", u"islamski",
|
||||
u"swedish"
|
||||
)
|
||||
|
||||
_mod_str = ("", "prije ", "poslije ", "okolo ", "", "", "")
|
||||
@@ -322,6 +322,7 @@ class DateDisplayHR(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -332,17 +333,20 @@ class DateDisplayHR(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -120,9 +120,9 @@ class DateDisplayIT(DateDisplay):
|
||||
u"lug", u"ago", u"set", u"ott", u"nov", u"dic" )
|
||||
|
||||
calendar = (
|
||||
"", u" (Giuliano)", u" (Ebraico)",
|
||||
u" (Rivoluzionario)", u" (Persiano)", u" (Islamico)",
|
||||
u" (Svedese)"
|
||||
"", u"Giuliano", u"Ebraico",
|
||||
u"Rivoluzionario", u"Persiano", u"Islamico",
|
||||
u"Svedese"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"prima del ", u"dopo del ", u"circa il ", "", "", "")
|
||||
@@ -159,6 +159,7 @@ class DateDisplayIT(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -169,14 +170,17 @@ class DateDisplayIT(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'dal', d1, u'al', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'dal', d1, u'al', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'tra', d1, u'e', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'tra', d1, u'e', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+140
-20
@@ -48,6 +48,59 @@ from _DateHandler import register_datehandler
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateParserLT(DateParser):
|
||||
"""
|
||||
Convert a text string into a Date object. If the date cannot be
|
||||
converted, the text string is assigned.
|
||||
"""
|
||||
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
# Custom months not the same as long months
|
||||
|
||||
month_to_int[u"sausis"] = 1
|
||||
month_to_int[u"vasaris"] = 2
|
||||
month_to_int[u"kovas"] = 3
|
||||
month_to_int[u"balandis"] = 4
|
||||
month_to_int[u"gegužė"] = 5
|
||||
month_to_int[u"gegužis"] = 5
|
||||
month_to_int[u"birželis"] = 6
|
||||
month_to_int[u"liepa"] = 7
|
||||
month_to_int[u"rugpjūtis"] = 8
|
||||
month_to_int[u"rugsėjis"] = 9
|
||||
month_to_int[u"spalis"] = 10
|
||||
month_to_int[u"lapkritis"] = 11
|
||||
month_to_int[u"gruodis"] = 12
|
||||
|
||||
# For not full months
|
||||
|
||||
month_to_int[u"saus"] = 1
|
||||
month_to_int[u"vasa"] = 2
|
||||
month_to_int[u"vasar"] = 2
|
||||
month_to_int[u"bala"] = 4
|
||||
month_to_int[u"balan"] = 4
|
||||
month_to_int[u"baland"] = 4
|
||||
month_to_int[u"gegu"] = 5
|
||||
month_to_int[u"geguž"] = 5
|
||||
month_to_int[u"birž"] = 6
|
||||
month_to_int[u"birže"] = 6
|
||||
month_to_int[u"biržel"] = 6
|
||||
month_to_int[u"liep"] = 7
|
||||
month_to_int[u"rugp"] = 8
|
||||
month_to_int[u"rugpj"] = 8
|
||||
month_to_int[u"rugpjū"] = 8
|
||||
month_to_int[u"rugpjūt"] = 8
|
||||
month_to_int[u"rugs"] = 9
|
||||
month_to_int[u"rugsė"] = 9
|
||||
month_to_int[u"rugsėj"] = 9
|
||||
month_to_int[u"rugsėjis"] = 9
|
||||
month_to_int[u"spal"] = 10
|
||||
month_to_int[u"lapk"] = 11
|
||||
month_to_int[u"lapkr"] = 11
|
||||
month_to_int[u"lapkri"] = 11
|
||||
month_to_int[u"lapkrit"] = 11
|
||||
month_to_int[u"gru"] = 12
|
||||
month_to_int[u"gruo"] = 12
|
||||
month_to_int[u"gruod"] = 12
|
||||
|
||||
modifier_to_int = {
|
||||
u'prieš' : Date.MOD_BEFORE,
|
||||
@@ -64,11 +117,11 @@ class DateParserLT(DateParser):
|
||||
u'h' : Date.CAL_HEBREW,
|
||||
u'islamo' : Date.CAL_ISLAMIC,
|
||||
u'i' : Date.CAL_ISLAMIC,
|
||||
u'prancuzų respublikos': Date.CAL_FRENCH,
|
||||
u'prancūzų respublikos': Date.CAL_FRENCH,
|
||||
u'r' : Date.CAL_FRENCH,
|
||||
u'persų' : Date.CAL_PERSIAN,
|
||||
u'p' : Date.CAL_PERSIAN,
|
||||
u'swedish' : Date.CAL_SWEDISH,
|
||||
u'švedų' : Date.CAL_SWEDISH,
|
||||
u's' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
@@ -92,6 +145,27 @@ class DateParserLT(DateParser):
|
||||
('|'.join(_range_1), '|'.join(_range_2)),
|
||||
re.IGNORECASE)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# FIXME: oficial long date format (ex, 2011 m. vasario 4 d.)
|
||||
# is not recognized correctly:
|
||||
# with self._text2 - day is recognized as year, year - as day
|
||||
# with self._iso - month not recognized, day recognized,
|
||||
# year increased by 1, date treated as double
|
||||
# TODO: in _DateParser.py in _parse_calendar modify groups
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# # gregorian and julian
|
||||
#
|
||||
# self._text2 = re.compile('(\d+)?\s*?m\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*?d?\.?' %
|
||||
# self._mon_str, re.IGNORECASE)
|
||||
#
|
||||
# self._iso = re.compile('(\d+)(/\d+)?\s*?m?\.?\s+?%s\.?\s*((\d+))?\s*?d?\.?' %
|
||||
# self._mon_str, re.IGNORECASE)
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Lithuanian displayer
|
||||
@@ -101,21 +175,25 @@ class DateDisplayLT(DateDisplay):
|
||||
"""
|
||||
Lithuanian language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
|
||||
long_months = ( u"", u"sausio", u"vasario", u"kovo", u"balandžio", u"gegužės",
|
||||
u"birželio", u"liepos", u"rugpjūčio", u"rugsėjo", u"spalio",
|
||||
u"lapkričio", u"gruodžio" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
long_months_vardininkas = ( u"", u"sausis", u"vasaris", u"kovas", u"balandis", u"gegužė",
|
||||
u"birželis", u"liepa", u"rugpjūtis", u"rugsėjis", u"spalis",
|
||||
u"lapkritis", u"gruodis" )
|
||||
|
||||
short_months = ( u"", u"Sau", u"Vas", u"Kov", u"Bal", u"Geg", u"Bir",
|
||||
u"Lie", u"Rgp", u"Rgs", u"Spa", u"Lap", u"Grd" )
|
||||
|
||||
calendar = (
|
||||
u"", u" (julijaus)",
|
||||
u" (hebrajų)",
|
||||
u" (prancuzų respublikos)",
|
||||
u" (persų)",
|
||||
u" (islamo)",
|
||||
u" (swedish)"
|
||||
u"", u"julijaus",
|
||||
u"hebrajų",
|
||||
u"prancūzų respublikos",
|
||||
u"persų",
|
||||
u"islamo",
|
||||
u"švedų"
|
||||
)
|
||||
|
||||
_mod_str = (u"",
|
||||
@@ -127,9 +205,47 @@ class DateDisplayLT(DateDisplay):
|
||||
_qual_str = (u"", u"apytikriai ", u"apskaičiuota ")
|
||||
|
||||
formats = (
|
||||
"YYYY-MM-DD (ISO)", "Skaitmeninis", "Mėnuo Diena, Metai",
|
||||
"Mėn DD, YYYY", "Diena Mėnuo Metai", "DD Mėn YYYY"
|
||||
)
|
||||
"mmmm-MM-DD (ISO)", "mmmm m. mėnesio diena d.", "Mėn diena, metai")
|
||||
|
||||
def _display_gregorian(self, date_val):
|
||||
"""
|
||||
display gregorian calendar date in different format
|
||||
"""
|
||||
year = self._slash_year(date_val[2], date_val[3])
|
||||
value = self.display_iso(date_val)
|
||||
|
||||
if self.format == 0:
|
||||
return self.display_iso(date_val)
|
||||
elif self.format == 1:
|
||||
|
||||
# mmmm m. mėnesio diena d. (YYYY m. month DD d.)
|
||||
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = year
|
||||
else:
|
||||
value = "%s m. %s" % (year, self.long_months_vardininkas[date_val[1]])
|
||||
else:
|
||||
value = "%s m. %s %d d." % (year, self.long_months[date_val[1]],
|
||||
date_val[0])
|
||||
elif self.format == 2:
|
||||
|
||||
# MON Day, Year
|
||||
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = year
|
||||
else:
|
||||
value = "%s %s" % (self.short_months[date_val[1]], year)
|
||||
else:
|
||||
value = "%s %d, %s" % (self.short_months[date_val[1]],
|
||||
date_val[0], year)
|
||||
|
||||
|
||||
if date_val[2] < 0:
|
||||
return self._bce_str % value
|
||||
else:
|
||||
return value
|
||||
|
||||
def display(self, date):
|
||||
"""
|
||||
@@ -139,6 +255,7 @@ class DateDisplayLT(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -149,17 +266,20 @@ class DateDisplayLT(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'nuo', d1, u'iki',
|
||||
d2, self.calendar[cal])
|
||||
d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'tarp', d1, u'ir',
|
||||
d2, self.calendar[cal])
|
||||
d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -124,12 +124,12 @@ class DateDisplayNb(DateDisplay):
|
||||
|
||||
calendar = (
|
||||
"",
|
||||
" (juliansk)",
|
||||
" (hebraisk)",
|
||||
" (fransk republikansk)",
|
||||
" (persisk)",
|
||||
" (islamisk)",
|
||||
" (svensk)"
|
||||
"juliansk",
|
||||
"hebraisk",
|
||||
"fransk republikansk",
|
||||
"persisk",
|
||||
"islamisk",
|
||||
"svensk"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"før ", u"etter ", u"ca ", "", "", "")
|
||||
@@ -146,6 +146,7 @@ class DateDisplayNb(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -156,16 +157,19 @@ class DateDisplayNb(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return u"%sfra %s til %s%s" % (qual_str, d1, d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%sfra %s til %s%s" % (qual_str, d1, d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%smellom %s og %s%s" % (qual_str, d1, d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%s%s%s%s" % (qual_str, self._mod_str[mod],
|
||||
text, self.calendar[cal])
|
||||
text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -65,6 +65,9 @@ class DateParserNL(DateParser):
|
||||
month_to_int[u"feber"] = 2
|
||||
month_to_int[u"februaris"] = 2
|
||||
month_to_int[u"merz"] = 3
|
||||
#make sure on all distro mrt and maa are accepted
|
||||
month_to_int[u"maa"] = 3
|
||||
month_to_int[u"mrt"] = 3
|
||||
month_to_int[u"aprilis"] = 4
|
||||
month_to_int[u"maius"] = 5
|
||||
month_to_int[u"junius"] = 6
|
||||
@@ -143,13 +146,13 @@ class DateDisplayNL(DateDisplay):
|
||||
u"juni", u"juli", u"augustus", u"september", u"oktober",
|
||||
u"november", u"december" )
|
||||
|
||||
short_months = ( u"", u"jan", u"feb", u"maa", u"apr", u"mei", u"jun",
|
||||
short_months = ( u"", u"jan", u"feb", u"mrt", u"apr", u"mei", u"jun",
|
||||
u"jul", u"aug", u"sep", u"okt", u"nov", u"dec" )
|
||||
|
||||
calendar = (
|
||||
"", u" (juliaans)", u" (hebreeuws)",
|
||||
u" (franse republiek)", u" (persisch)", u" (islamitisch)",
|
||||
u" (zweeds)" )
|
||||
"", u"juliaans", u"hebreeuws",
|
||||
u"franse republiek", u"persisch", u"islamitisch",
|
||||
u"zweeds" )
|
||||
|
||||
_mod_str = ("", u"voor ", u"na ", u"rond ", "", "", "")
|
||||
|
||||
@@ -231,6 +234,7 @@ class DateDisplayNL(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -241,17 +245,20 @@ class DateDisplayNL(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'van', d1,
|
||||
u'tot', d2, self.calendar[cal])
|
||||
u'tot', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%stussen %s en %s%s" % (qual_str, d1, d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+61
-23
@@ -20,6 +20,7 @@
|
||||
#
|
||||
|
||||
# Polish version 2007 by Piotr Czubaszek
|
||||
# Updated in 2010 by Łukasz Rymarczyk
|
||||
|
||||
"""
|
||||
Polish-specific classes for parsing and displaying dates.
|
||||
@@ -85,7 +86,31 @@ class DateParserPL(DateParser):
|
||||
month_to_int[u"grudzień"] = 12
|
||||
month_to_int[u"gru"] = 12
|
||||
month_to_int[u"XII"] = 12
|
||||
|
||||
# Alternative forms: declined nouns
|
||||
month_to_int[u"stycznia"] = 1
|
||||
month_to_int[u"lutego"] = 2
|
||||
month_to_int[u"marca"] = 3
|
||||
month_to_int[u"kwietnia"] = 4
|
||||
month_to_int[u"maja"] = 5
|
||||
month_to_int[u"czerwca"] = 6
|
||||
month_to_int[u"lipca"] = 7
|
||||
month_to_int[u"sierpnia"] = 8
|
||||
month_to_int[u"września"] = 9
|
||||
month_to_int[u"października"] = 10
|
||||
month_to_int[u"listopada"] = 11
|
||||
month_to_int[u"grudnia"] = 12
|
||||
# Alternative forms: nouns without polish accent letters
|
||||
# (misspellings sometimes used in emails)
|
||||
month_to_int[u"styczen"] = 1
|
||||
month_to_int[u"kwiecien"] = 4
|
||||
month_to_int[u"sierpien"] = 8
|
||||
month_to_int[u"wrzesien"] = 9
|
||||
month_to_int[u"pazdziernik"] = 10
|
||||
month_to_int[u"grudzien"] = 12
|
||||
month_to_int[u"wrzesnia"] = 9
|
||||
month_to_int[u"pazdziernika"] = 10
|
||||
month_to_int[u"paz"] = 10
|
||||
|
||||
modifier_to_int = {
|
||||
u'przed' : Date.MOD_BEFORE,
|
||||
u'po' : Date.MOD_AFTER,
|
||||
@@ -93,26 +118,34 @@ class DateParserPL(DateParser):
|
||||
u'ok.' : Date.MOD_ABOUT,
|
||||
u'circa' : Date.MOD_ABOUT,
|
||||
u'ca.' : Date.MOD_ABOUT,
|
||||
# Alternative forms: misspellings sometimes used in emails
|
||||
u'okolo' : Date.MOD_ABOUT,
|
||||
u'ok' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
calendar_to_int = {
|
||||
u'gregoriański' : Date.CAL_GREGORIAN,
|
||||
u'gregoriański' : Date.CAL_GREGORIAN,
|
||||
u'greg.' : Date.CAL_GREGORIAN,
|
||||
u'juliański' : Date.CAL_JULIAN,
|
||||
u'juliański' : Date.CAL_JULIAN,
|
||||
u'jul.' : Date.CAL_JULIAN,
|
||||
u'hebrajski' : Date.CAL_HEBREW,
|
||||
u'hebr.' : Date.CAL_HEBREW,
|
||||
u'islamski' : Date.CAL_ISLAMIC,
|
||||
u'islamski' : Date.CAL_ISLAMIC,
|
||||
u'isl.' : Date.CAL_ISLAMIC,
|
||||
u'francuski republikański': Date.CAL_FRENCH,
|
||||
u'franc.' : Date.CAL_FRENCH,
|
||||
u'perski' : Date.CAL_PERSIAN,
|
||||
u'swedish' : Date.CAL_SWEDISH,
|
||||
u's' : Date.CAL_SWEDISH,
|
||||
u'perski' : Date.CAL_PERSIAN,
|
||||
u'szwedzki' : Date.CAL_SWEDISH,
|
||||
u's' : Date.CAL_SWEDISH,
|
||||
# Alternative forms: nouns without polish accent letters
|
||||
# (misspellings sometimes used in emails)
|
||||
u'gregorianski' : Date.CAL_GREGORIAN,
|
||||
u'julianski' : Date.CAL_JULIAN,
|
||||
u'francuski republikanski': Date.CAL_FRENCH,
|
||||
}
|
||||
|
||||
quality_to_int = {
|
||||
u'szacowany' : Date.QUAL_ESTIMATED,
|
||||
u'szacowany' : Date.QUAL_ESTIMATED,
|
||||
u'szac.' : Date.QUAL_ESTIMATED,
|
||||
u'obliczony' : Date.QUAL_CALCULATED,
|
||||
u'obl.' : Date.QUAL_CALCULATED,
|
||||
@@ -123,11 +156,12 @@ class DateParserPL(DateParser):
|
||||
|
||||
def init_strings(self):
|
||||
DateParser.init_strings(self)
|
||||
self._span = re.compile("(od)\s+(?P<start>.+)\s+(do)\s+(?P<stop>.+)",re.IGNORECASE)
|
||||
self._range = re.compile(u"(między)\s+(?P<start>.+)\s+(a)\s+(?P<stop>.+)", re.IGNORECASE)
|
||||
self._span = re.compile("(od)\s+(?P<start>.+)\s+(do)\s+(?P<stop>.+)", re.IGNORECASE)
|
||||
# Also handle a common mistakes
|
||||
self._range = re.compile(u"((?:po)?mi(?:ę|e)dzy)\s+(?P<start>.+)\s+(a)\s+(?P<stop>.+)", re.IGNORECASE)
|
||||
self._text2 = re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?' % self._mon_str,
|
||||
re.IGNORECASE)
|
||||
self._jtext2= re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?' % self._jmon_str,
|
||||
self._jtext2 = re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?' % self._jmon_str,
|
||||
re.IGNORECASE)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -139,18 +173,18 @@ class DateDisplayPL(DateDisplay):
|
||||
"""
|
||||
Polish language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
|
||||
long_months = ( u"", u"Styczeń", u"Luty", u"Marzec", u"Kwiecień", u"Maj",
|
||||
u"Czerwiec", u"Lipiec", u"Sierpień", u"Wrzesień", u"Październik",
|
||||
u"Listopad", u"Grudzień" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"Sty", u"Lut", u"Mar", u"Kwi", u"Maj", u"Cze",
|
||||
u"Lip", u"Sie", u"Wrz", u"Paź", u"Lis", u"Gru" )
|
||||
|
||||
calendar = (
|
||||
"", u" (juliański)", u" (hebrajski)",
|
||||
u" (francuski republikański)", u" (perski)", u" (islamski)",
|
||||
u" (swedish)"
|
||||
"", u"juliański", u"hebrajski",
|
||||
u"francuski republikański", u"perski", u"islamski",
|
||||
u"swedish"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"przed ", u"po ", u"ok. ", "", "", "")
|
||||
@@ -246,6 +280,7 @@ class DateDisplayPL(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -256,17 +291,20 @@ class DateDisplayPL(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d1, u'do', d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'między', d1, u'a', d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+36
-27
@@ -52,20 +52,26 @@ from _DateHandler import register_datehandler
|
||||
class DateParserPT(DateParser):
|
||||
|
||||
modifier_to_int = {
|
||||
u'antes de' : Date.MOD_BEFORE,
|
||||
u'antes' : Date.MOD_BEFORE,
|
||||
u'ant.' : Date.MOD_BEFORE,
|
||||
u'ant' : Date.MOD_BEFORE,
|
||||
u'após' : Date.MOD_AFTER,
|
||||
u'aprox.' : Date.MOD_ABOUT,
|
||||
u'aprox' : Date.MOD_ABOUT,
|
||||
u'apr.' : Date.MOD_ABOUT,
|
||||
u'apr' : Date.MOD_ABOUT,
|
||||
u'cerca de' : Date.MOD_ABOUT,
|
||||
u'ca.' : Date.MOD_ABOUT,
|
||||
u'ca' : Date.MOD_ABOUT,
|
||||
u'c.' : Date.MOD_ABOUT,
|
||||
u'até' : Date.MOD_ABOUT,
|
||||
u'antes de' : Date.MOD_BEFORE,
|
||||
u'antes' : Date.MOD_BEFORE,
|
||||
u'ant.' : Date.MOD_BEFORE,
|
||||
u'ant' : Date.MOD_BEFORE,
|
||||
u'até' : Date.MOD_BEFORE,
|
||||
u'depois de' : Date.MOD_AFTER,
|
||||
u'depois' : Date.MOD_AFTER,
|
||||
u'dep.' : Date.MOD_AFTER,
|
||||
u'dep' : Date.MOD_AFTER,
|
||||
u'aprox.' : Date.MOD_ABOUT,
|
||||
u'aprox' : Date.MOD_ABOUT,
|
||||
u'apr.' : Date.MOD_ABOUT,
|
||||
u'apr' : Date.MOD_ABOUT,
|
||||
u'cerca de' : Date.MOD_ABOUT,
|
||||
u'ca.' : Date.MOD_ABOUT,
|
||||
u'ca' : Date.MOD_ABOUT,
|
||||
u'c.' : Date.MOD_ABOUT,
|
||||
u'por volta de' : Date.MOD_ABOUT,
|
||||
u'por volta' : Date.MOD_ABOUT,
|
||||
u'pvd.' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
calendar_to_int = {
|
||||
@@ -116,21 +122,20 @@ class DateDisplayPT(DateDisplay):
|
||||
"""
|
||||
Portuguese language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = ( u"", u"Janeiro", u"Fevereiro", u"Março", u"Abril", u"Maio",
|
||||
u"Junho", u"Julho", u"Agosto", u"Setembro", u"Outubro",
|
||||
u"Novembro", u"Dezembro" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"Jan", u"Fev", u"Mar", u"Abr", u"Mai", u"Jun",
|
||||
u"Jul", u"Ago", u"Set", u"Out", u"Nov", u"Dez" )
|
||||
|
||||
calendar = (
|
||||
"", u" (Juliano)", u" (Hebreu)",
|
||||
u" (Revolucionário)", u" (Persa)", u" (Islâmico)",
|
||||
u" (Swedish)"
|
||||
"", u"Juliano", u"Hebreu",
|
||||
u"Revolucionário", u"Persa", u"Islâmico",
|
||||
u"Sueco"
|
||||
)
|
||||
|
||||
_mod_str = ("",u"antes de ",u"depois de ",u"até ","","","")
|
||||
_mod_str = ("",u"antes de ",u"depois de ",u"por volta de ","","","")
|
||||
|
||||
_qual_str = ("","estimado ","calculado ")
|
||||
|
||||
@@ -147,6 +152,7 @@ class DateDisplayPT(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -157,14 +163,17 @@ class DateDisplayPT(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2,self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'e', d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'e', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+68
-65
@@ -187,22 +187,21 @@ class DateDisplayRU(DateDisplay):
|
||||
"""
|
||||
Russian language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = ( u"", u"января", u"февраля", u"марта", u"апреля", u"мая",
|
||||
u"июня", u"июля", u"августа", u"сентября", u"октября",
|
||||
u"ноября", u"декабря" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"янв", u"фев", u"мар", u"апр", u"мая", u"июн",
|
||||
u"июл", u"авг", u"сен", u"окт", u"ноя", u"дек" )
|
||||
|
||||
calendar = (
|
||||
u"",
|
||||
u" (юлианский)",
|
||||
u" (еврейский)",
|
||||
u" (республиканский)",
|
||||
u" (персидский)",
|
||||
u" (исламский)",
|
||||
u" (Swedish)"
|
||||
u"юлианский",
|
||||
u"еврейский",
|
||||
u"республиканский",
|
||||
u"персидский",
|
||||
u"исламский",
|
||||
u"шведский"
|
||||
)
|
||||
|
||||
_mod_str = (
|
||||
@@ -222,65 +221,65 @@ class DateDisplayRU(DateDisplay):
|
||||
)
|
||||
|
||||
hebrew = ( u"",
|
||||
u"Тишрей",
|
||||
u"Хешван",
|
||||
u"Кислев",
|
||||
u"Тевет",
|
||||
u"Шеват",
|
||||
u"Адар",
|
||||
u"Адар бет",
|
||||
u"Нисан",
|
||||
u"Ияр",
|
||||
u"Сиван",
|
||||
u"Таммуз",
|
||||
u"Ав",
|
||||
u"Элул",
|
||||
u"тишрея",
|
||||
u"хешвана",
|
||||
u"кислева",
|
||||
u"тевета",
|
||||
u"шевата",
|
||||
u"адара",
|
||||
u"адар бета",
|
||||
u"нисана",
|
||||
u"ияра",
|
||||
u"сивана",
|
||||
u"таммуза",
|
||||
u"ава",
|
||||
u"элула",
|
||||
)
|
||||
|
||||
islamic = ( u"",
|
||||
u"Мухаррам",
|
||||
u"Сафар",
|
||||
u"Раби-аль-авваль",
|
||||
u"Раби-ассани",
|
||||
u"Джумада-аль-уля",
|
||||
u"Джумада-аль-ахира",
|
||||
u"Раджаб",
|
||||
u"Шаабан",
|
||||
u"Рамадан",
|
||||
u"Шавваль",
|
||||
u"Зуль-каада",
|
||||
u"Зуль-хиджжа",
|
||||
u"мухаррама",
|
||||
u"сафара",
|
||||
u"раби-аль-авваля",
|
||||
u"раби-ассани",
|
||||
u"джумада-аль-уля",
|
||||
u"джумада-аль-ахира",
|
||||
u"раджаба",
|
||||
u"шаабана",
|
||||
u"рамадана",
|
||||
u"шаввальа",
|
||||
u"зуль-каада",
|
||||
u"зуль-хиджжа",
|
||||
)
|
||||
|
||||
persian = ( u"",
|
||||
u"Фарвардин",
|
||||
u"Урдбихишт",
|
||||
u"Хурдад",
|
||||
u"Тир",
|
||||
u"Мурдад",
|
||||
u"Шахривар",
|
||||
u"Михр",
|
||||
u"Абан",
|
||||
u"Азар",
|
||||
u"Дай",
|
||||
u"Бахман",
|
||||
u"Исфаидармуз",
|
||||
u"фарвардина",
|
||||
u"урдбихишта",
|
||||
u"хурдада",
|
||||
u"тира",
|
||||
u"мурдада",
|
||||
u"шахривара",
|
||||
u"михра",
|
||||
u"абана",
|
||||
u"азара",
|
||||
u"дайа",
|
||||
u"бахмана",
|
||||
u"исфаидармуза",
|
||||
)
|
||||
|
||||
french = ( u"",
|
||||
u"Вандемьер",
|
||||
u"Брюмер",
|
||||
u"Фример",
|
||||
u"Нивоз",
|
||||
u"Плювиоз",
|
||||
u"Вантоз",
|
||||
u"Жерминаль",
|
||||
u"Флореаль",
|
||||
u"Прериаль",
|
||||
u"Мессидор",
|
||||
u"Термидор",
|
||||
u"Фрюктидор",
|
||||
u"Дополнит."
|
||||
u"вандемьера",
|
||||
u"брюмера",
|
||||
u"фримера",
|
||||
u"нивоза",
|
||||
u"плювиоза",
|
||||
u"вантоза",
|
||||
u"жерминаля",
|
||||
u"флореаля",
|
||||
u"прериаля",
|
||||
u"мессидора",
|
||||
u"термидора",
|
||||
u"фрюктидора",
|
||||
u"дополнит."
|
||||
)
|
||||
|
||||
def display(self, date):
|
||||
@@ -291,6 +290,7 @@ class DateDisplayRU(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -301,17 +301,20 @@ class DateDisplayRU(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%sс %s %s %s%s" % (qual_str, d1, u'по', d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и',
|
||||
d2, self.calendar[cal])
|
||||
d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod],
|
||||
text, self.calendar[cal])
|
||||
text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
+15
-12
@@ -104,18 +104,17 @@ class DateDisplaySK(DateDisplay):
|
||||
"""
|
||||
Slovak language date display class.
|
||||
"""
|
||||
# TODO: Translate these month strings:
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
long_months = ( u"", u"január", u"február", u"marec", u"apríl", u"máj",
|
||||
u"jún", u"júl", u"august", u"september", u"október",
|
||||
u"november", u"december" )
|
||||
|
||||
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
|
||||
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
|
||||
short_months = ( u"", u"jan", u"feb", u"mar", u"apr", u"máj", u"jún",
|
||||
u"júl", u"aug", u"sep", u"okt", u"nov", u"dec" )
|
||||
|
||||
calendar = (
|
||||
"", u" (juliánský)", u" (hebrejský)",
|
||||
u" (republikánsky)", u" (perzský)", u" (islamský)",
|
||||
u" (swedish)"
|
||||
"", u"juliánský", u"hebrejský",
|
||||
u"republikánsky", u"perzský", u"islamský",
|
||||
u"swedish"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"pred ", u"po ", u"okolo ", "", "", "")
|
||||
@@ -135,6 +134,7 @@ class DateDisplaySK(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -145,17 +145,20 @@ class DateDisplaySK(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d1,
|
||||
u'do', d2, self.calendar[cal])
|
||||
u'do', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'medzi',
|
||||
d1, u'a', d2, self.calendar[cal])
|
||||
d1, u'a', d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod],
|
||||
text, self.calendar[cal])
|
||||
text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2004-2007 Donald N. Allingham
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# Slovenian version 2010 by Bernard Banko, based on croatian one by Josip
|
||||
|
||||
"""
|
||||
Slovenian-specific classes for parsing and displaying dates.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import re
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib import Date
|
||||
from _DateParser import DateParser
|
||||
from _DateDisplay import DateDisplay
|
||||
from _DateHandler import register_datehandler
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Slovenian parser
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateParserSL(DateParser):
|
||||
"""
|
||||
Converts a text string into a Date object
|
||||
"""
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
month_to_int[u"januar"] = 1
|
||||
month_to_int[u"januarja"] = 1
|
||||
month_to_int[u"januarjem"] = 1
|
||||
month_to_int[u"jan"] = 1
|
||||
month_to_int[u"i"] = 1
|
||||
|
||||
month_to_int[u"februar"] = 2
|
||||
month_to_int[u"februarjem"] = 2
|
||||
month_to_int[u"februarja"] = 2
|
||||
month_to_int[u"feb"] = 2
|
||||
month_to_int[u"ii"] = 2
|
||||
|
||||
month_to_int[u"mar"] = 3
|
||||
month_to_int[u"marcem"] = 3
|
||||
month_to_int[u"marec"] = 3
|
||||
month_to_int[u"marca"] = 3
|
||||
month_to_int[u"iii"] = 3
|
||||
|
||||
month_to_int[u"apr"] = 4
|
||||
month_to_int[u"april"] = 4
|
||||
month_to_int[u"aprilom"] = 4
|
||||
month_to_int[u"aprila"] = 4
|
||||
month_to_int[u"iv"] = 4
|
||||
|
||||
month_to_int[u"maj"] = 5
|
||||
month_to_int[u"maja"] = 5
|
||||
month_to_int[u"majem"] = 5
|
||||
month_to_int[u"v"] = 5
|
||||
|
||||
month_to_int[u"jun"] = 6
|
||||
month_to_int[u"junij"] = 6
|
||||
month_to_int[u"junijem"] = 6
|
||||
month_to_int[u"junija"] = 6
|
||||
month_to_int[u"vi"] = 6
|
||||
|
||||
month_to_int[u"jul"] = 7
|
||||
month_to_int[u"julij"] = 7
|
||||
month_to_int[u"julijem"] = 7
|
||||
month_to_int[u"julija"] = 7
|
||||
month_to_int[u"vii"] = 7
|
||||
|
||||
month_to_int[u"avg"] = 8
|
||||
month_to_int[u"avgust"] = 8
|
||||
month_to_int[u"avgustom"] = 8
|
||||
month_to_int[u"avgusta"] = 8
|
||||
month_to_int[u"viii"] = 8
|
||||
|
||||
month_to_int[u"sep"] = 9
|
||||
month_to_int[u"sept"] = 9
|
||||
month_to_int[u"september"] = 9
|
||||
month_to_int[u"septembrom"] = 9
|
||||
month_to_int[u"septembra"] = 9
|
||||
month_to_int[u"ix"] = 9
|
||||
|
||||
month_to_int[u"okt"] = 10
|
||||
month_to_int[u"oktober"] = 10
|
||||
month_to_int[u"oktobrom"] = 10
|
||||
month_to_int[u"oktobra"] = 10
|
||||
month_to_int[u"x"] = 10
|
||||
|
||||
month_to_int[u"nov"] = 11
|
||||
month_to_int[u"november"] = 11
|
||||
month_to_int[u"novembrom"] = 11
|
||||
month_to_int[u"novembra"] = 11
|
||||
month_to_int[u"xi"] = 11
|
||||
|
||||
month_to_int[u"dec"] = 12
|
||||
month_to_int[u"december"] = 12
|
||||
month_to_int[u"decembrom"] = 12
|
||||
month_to_int[u"decembra"] = 12
|
||||
month_to_int[u"xii"] = 12
|
||||
|
||||
modifier_to_int = {
|
||||
u'pred' : Date.MOD_BEFORE,
|
||||
u'pr.' : Date.MOD_BEFORE,
|
||||
u'po' : Date.MOD_AFTER,
|
||||
u'okoli' : Date.MOD_ABOUT,
|
||||
u'okrog' : Date.MOD_ABOUT,
|
||||
u'okr.' : Date.MOD_ABOUT,
|
||||
u'ok.' : Date.MOD_ABOUT,
|
||||
u'cca.' : Date.MOD_ABOUT,
|
||||
u'cca' : Date.MOD_ABOUT,
|
||||
u'circa' : Date.MOD_ABOUT,
|
||||
u'ca.' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
calendar_to_int = {
|
||||
u'gregorijanski' : Date.CAL_GREGORIAN,
|
||||
u'greg.' : Date.CAL_GREGORIAN,
|
||||
u'julijanski' : Date.CAL_JULIAN,
|
||||
u'jul.' : Date.CAL_JULIAN,
|
||||
u'hebrejski' : Date.CAL_HEBREW,
|
||||
u'hebr.' : Date.CAL_HEBREW,
|
||||
u'islamski' : Date.CAL_ISLAMIC,
|
||||
u'isl.' : Date.CAL_ISLAMIC,
|
||||
u'francoski republikanski': Date.CAL_FRENCH,
|
||||
u'franc.' : Date.CAL_FRENCH,
|
||||
u'perzijski' : Date.CAL_PERSIAN,
|
||||
u'perz. ' : Date.CAL_PERSIAN,
|
||||
u'švedski' : Date.CAL_SWEDISH,
|
||||
u'šved.' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
quality_to_int = {
|
||||
u'približno' : Date.QUAL_ESTIMATED,
|
||||
u'pribl.' : Date.QUAL_ESTIMATED,
|
||||
u'izračunano' : Date.QUAL_CALCULATED,
|
||||
u'izrač.' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
|
||||
bce = ["pred našim štetjem", "pred Kristusom",
|
||||
"p.n.š.", "p. n. š.", "pr.Kr.", "pr. Kr."] + DateParser.bce
|
||||
|
||||
def init_strings(self):
|
||||
"""
|
||||
compiles regular expression strings for matching dates
|
||||
"""
|
||||
DateParser.init_strings(self)
|
||||
# match 'Day. MONTH year.' format with or without dots
|
||||
self._text2 = re.compile('(\d+)?\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$'
|
||||
% self._mon_str, re.IGNORECASE)
|
||||
# match Day.Month.Year.
|
||||
self._numeric = re.compile("((\d+)[/\.-])?\s*((\d+)[/\.-])?\s*(\d+)\.?$")
|
||||
|
||||
self._span = re.compile("od\s+(?P<start>.+)\s+do\s+(?P<stop>.+)",
|
||||
re.IGNORECASE)
|
||||
self._range = re.compile(
|
||||
u"med\s+(?P<start>.+)\s+in\s+(?P<stop>.+)",
|
||||
re.IGNORECASE)
|
||||
self._jtext2 = re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?'\
|
||||
% self._jmon_str, re.IGNORECASE)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Slovenian display
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateDisplaySL(DateDisplay):
|
||||
"""
|
||||
Slovenian language date display class.
|
||||
"""
|
||||
long_months = ( u"", u"januarja", u"februarja", u"marca",u"aprila",
|
||||
u"maja", u"junija", u"julija", u"avgusta", u"septembra",
|
||||
u"oktobra", u"novembra", u"decembra"
|
||||
)
|
||||
|
||||
short_months = ( u"", u"jan", u"feb", u"mar", u"apr", u"maj", u"jun",
|
||||
u"jul", u"avg", u"sep", u"okt", u"nov", u"dec"
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", u"julijanski", u"hebrejski",
|
||||
u"francoski republikanski", u"perzijski", u"islamski",
|
||||
u"švedski"
|
||||
)
|
||||
|
||||
_mod_str = ("", "pred ", "po ", "okrog ", "", "", "")
|
||||
|
||||
_qual_str = ("", "približno ", "izračunano ")
|
||||
|
||||
_bce_str = "%s p.n.š."
|
||||
|
||||
formats = (
|
||||
"ISO (leto-mm-dd)",
|
||||
"številčno",
|
||||
"dan. mes. leto",
|
||||
"dan. mesec leto"
|
||||
)
|
||||
|
||||
def _display_gregorian(self, date_val):
|
||||
"""
|
||||
display gregorian calendar date in different format
|
||||
"""
|
||||
year = self._slash_year(date_val[2], date_val[3])
|
||||
if self.format == 0:
|
||||
return self.display_iso(date_val)
|
||||
elif self.format == 1:
|
||||
# D. M. YYYY
|
||||
if date_val[3]:
|
||||
return self.display_iso(date_val)
|
||||
else:
|
||||
if date_val[0] == 0 and date_val[1] == 0:
|
||||
value = str(date_val[2])
|
||||
else:
|
||||
value = self._tformat.replace('%m', str(date_val[1]))
|
||||
value = value.replace('%d', str(date_val[0]))
|
||||
value = value.replace('%Y', str(date_val[2]))
|
||||
value = value.replace('-', '. ')
|
||||
elif self.format == 2:
|
||||
# D. mon. YYYY
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = year
|
||||
else:
|
||||
value = "%s. %s" % (self.short_months[date_val[1]], year)
|
||||
else:
|
||||
value = "%d. %s. %s" % (date_val[0],
|
||||
self.short_months[date_val[1]], year)
|
||||
else:
|
||||
# D. month YYYY
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = "%s." % year
|
||||
else:
|
||||
value = "%s %s" % (self.long_months[date_val[1]], year)
|
||||
else:
|
||||
value = "%d. %s %s" % (
|
||||
date_val[0],self.long_months[date_val[1]], year)
|
||||
if date_val[2] < 0:
|
||||
return self._bce_str % value
|
||||
else:
|
||||
return value
|
||||
|
||||
def display(self, date):
|
||||
"""
|
||||
Return a text string representing the date.
|
||||
"""
|
||||
mod = date.get_modifier()
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
if mod == Date.MOD_TEXTONLY:
|
||||
return date.get_text()
|
||||
elif start == Date.EMPTY:
|
||||
return u""
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%sod %s do %s%s" % (qual_str, d_1, d_2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
date_string = u"%smed %s in %s%s" % (qual_str, d_1, d_2, scal)
|
||||
date_string = date_string.replace(u"a ",u"em ") #to correct declination
|
||||
date_string = date_string.replace(u"lem ",u"lom ")
|
||||
date_string = date_string.replace(u"rem ",u"rom ")
|
||||
date_string = date_string.replace(u"tem ",u"tom ")
|
||||
return date_string
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
date_string = "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal)
|
||||
return date_string
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
register_datehandler(("sl", "SL", "sl_SI", "slovenščina", "slovenian", "Slovenian",
|
||||
"sl_SI.UTF8", "sl_SI.UTF-8", "sl_SI.utf-8", "sl_SI.utf8"),
|
||||
DateParserSL, DateDisplaySL)
|
||||
@@ -251,9 +251,9 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", u" (julijanski)", u" (hebrejski)",
|
||||
u" (francuski republikanski)", u" (persijski)", u" (islamski)",
|
||||
u" (švedski)"
|
||||
"", u"julijanski", u"hebrejski",
|
||||
u"francuski republikanski", u"persijski", u"islamski",
|
||||
u"švedski"
|
||||
)
|
||||
|
||||
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
|
||||
@@ -334,6 +334,7 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -344,17 +345,20 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
+18
-14
@@ -64,7 +64,7 @@ class DateParserSv(DateParser):
|
||||
u'c:a' : Date.MOD_ABOUT
|
||||
}
|
||||
|
||||
bce = ["f Kr"]
|
||||
bce = [u"f Kr"]
|
||||
|
||||
calendar_to_int = {
|
||||
u'gregoriansk ' : Date.CAL_GREGORIAN,
|
||||
@@ -128,20 +128,20 @@ class DateDisplaySv(DateDisplay):
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"",
|
||||
" (juliansk)",
|
||||
" (hebreisk)",
|
||||
" (fransk republikansk)",
|
||||
" (persisk)",
|
||||
" (islamisk)",
|
||||
" (svensk)"
|
||||
u"",
|
||||
u"juliansk",
|
||||
u"hebreisk",
|
||||
u"fransk republikansk",
|
||||
u"persisk",
|
||||
u"islamisk",
|
||||
u"svensk"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"före ", u"efter ", u"c:a ", "", "", "")
|
||||
_mod_str = (u"", u"före ", u"efter ", u"c:a ", u"", u"", u"")
|
||||
|
||||
_qual_str = ("", u"uppskattat ", u"beräknat ")
|
||||
_qual_str = (u"", u"uppskattat ", u"beräknat ")
|
||||
|
||||
_bce_str = "%s f Kr"
|
||||
_bce_str = u"%s f Kr"
|
||||
|
||||
def display(self, date):
|
||||
"""
|
||||
@@ -151,6 +151,7 @@ class DateDisplaySv(DateDisplay):
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
@@ -161,16 +162,19 @@ class DateDisplaySv(DateDisplay):
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return u"%sfrån %s till %s%s" % (qual_str, d1, d2, self.calendar[cal])
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%sfrån %s till %s%s" % (qual_str, d1, d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%smellan %s och %s%s" % (qual_str, d1, d2,
|
||||
self.calendar[cal])
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return u"%s%s%s%s" % (qual_str, self._mod_str[mod],
|
||||
text, self.calendar[cal])
|
||||
text, scal)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -45,6 +45,7 @@ import _Date_pl
|
||||
import _Date_pt
|
||||
import _Date_ru
|
||||
import _Date_sk
|
||||
import _Date_sl
|
||||
import _Date_sr
|
||||
import _Date_sv
|
||||
|
||||
|
||||
+18
-7
@@ -307,19 +307,30 @@ class WarnHandler(RotateHandler):
|
||||
self.button = button
|
||||
button.on_clicked(self.display)
|
||||
self.timer = None
|
||||
self.last_line = '-1'
|
||||
|
||||
def emit(self, record):
|
||||
if self.timer:
|
||||
gobject.source_remove(self.timer)
|
||||
gobject.timeout_add(180*1000, self._clear)
|
||||
if self.timer is None:
|
||||
#check every 3 minutes if warn button can disappear
|
||||
self.timer = gobject.timeout_add(3*60*1000, self._check_clear)
|
||||
RotateHandler.emit(self, record)
|
||||
self.button.show()
|
||||
|
||||
def _check_clear(self):
|
||||
new_last_line = self.get_buffer()[-1]
|
||||
if self.last_line == new_last_line:
|
||||
#buffer has not changed for 3 minutes, let's clear it:
|
||||
self._clear()
|
||||
return False
|
||||
else:
|
||||
self.last_line = new_last_line
|
||||
return True
|
||||
|
||||
def _clear(self):
|
||||
self.button.hide()
|
||||
self.set_capacity(self._capacity)
|
||||
self.last_line = '-1'
|
||||
self.timer = None
|
||||
return False
|
||||
|
||||
def display(self, obj):
|
||||
obj.hide()
|
||||
@@ -329,7 +340,6 @@ class WarnHandler(RotateHandler):
|
||||
buf = msg.get_buffer()
|
||||
for i in self.get_formatted_log():
|
||||
buf.insert_at_cursor(i + '\n')
|
||||
self.set_capacity(self._capacity)
|
||||
top.run()
|
||||
top.destroy()
|
||||
|
||||
@@ -413,7 +423,7 @@ class DisplayState(gen.utils.Callback):
|
||||
navigation type and group.
|
||||
"""
|
||||
history = self.get_history(nav_type, nav_group)
|
||||
return history.present()
|
||||
return history.present() if history else None
|
||||
|
||||
def set_active(self, handle, nav_type, nav_group=0):
|
||||
"""
|
||||
@@ -421,7 +431,8 @@ class DisplayState(gen.utils.Callback):
|
||||
the given handle.
|
||||
"""
|
||||
history = self.get_history(nav_type, nav_group)
|
||||
history.push(handle)
|
||||
if history:
|
||||
history.push(handle)
|
||||
|
||||
def set_sensitive(self, state):
|
||||
self.window.set_sensitive(state)
|
||||
|
||||
+26
-12
@@ -3,6 +3,7 @@
|
||||
#
|
||||
# Copyright (C) 2004-2007 Donald N. Allingham
|
||||
# Copyright (C) 2008 Brian G. Matherly
|
||||
# Copyright (C) 2008 Benny Malengier
|
||||
# Contribution 2009 by Brad Crittenden <brad [AT] bradcrittenden.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -92,6 +93,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
|
||||
"""
|
||||
|
||||
#override predefined do_xxx signal handlers
|
||||
__gsignals__ = {"apply": "override", "cancel": "override",
|
||||
"close": "override", "prepare": "override"}
|
||||
|
||||
@@ -164,6 +166,22 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
if isinstance(arg, gtk.Button) and arg.get_label() == 'gtk-go-forward':
|
||||
self.forward_button = arg
|
||||
|
||||
def get_cancel_button(self, arg):
|
||||
if isinstance(arg, gtk.HBox):
|
||||
arg.forall(self._cancel_btn)
|
||||
|
||||
def _cancel_btn(self, arg):
|
||||
if isinstance(arg, gtk.Button) and arg.get_label() == 'gtk-cancel':
|
||||
self.cancel_button = arg
|
||||
|
||||
def get_close_button(self, arg):
|
||||
if isinstance(arg, gtk.HBox):
|
||||
arg.forall(self._close_btn)
|
||||
|
||||
def _close_btn(self, arg):
|
||||
if isinstance(arg, gtk.Button) and arg.get_label() == 'gtk-close':
|
||||
self.close_button = arg
|
||||
|
||||
def build_menu_names(self, obj):
|
||||
"""Override ManagedWindow method."""
|
||||
return (self.top_title, None)
|
||||
@@ -382,22 +400,18 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
self.set_page_complete(page, False)
|
||||
self.set_page_type(page, gtk.ASSISTANT_PAGE_SUMMARY)
|
||||
|
||||
|
||||
def do_apply(self):
|
||||
pass
|
||||
|
||||
def do_cancel(self):
|
||||
if self.writestarted :
|
||||
return True
|
||||
else :
|
||||
self.close()
|
||||
|
||||
def do_close(self):
|
||||
if self.writestarted :
|
||||
return True
|
||||
else :
|
||||
pass
|
||||
else :
|
||||
self.close()
|
||||
|
||||
def do_cancel(self):
|
||||
self.do_close()
|
||||
|
||||
def do_prepare(self, page):
|
||||
"""
|
||||
The "prepare" signal is emitted when a new page is set as the
|
||||
@@ -462,7 +476,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
#Allow for exotic error: file is still not correct
|
||||
self.check_fileselect(self.chooser, show=False)
|
||||
if self.get_page_complete(self.chooser) :
|
||||
filename = Utils.get_unicode_path(self.chooser.get_filename())
|
||||
filename = Utils.get_unicode_path_from_file_chooser(self.chooser.get_filename())
|
||||
name = os.path.split(filename)[1]
|
||||
folder = os.path.split(filename)[0]
|
||||
confirm_text = _(
|
||||
@@ -536,7 +550,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
|
||||
def close(self, *obj) :
|
||||
#clean up ManagedWindow menu, then destroy window, bring forward parent
|
||||
|
||||
gtk.Assistant.destroy(self)
|
||||
ManagedWindow.ManagedWindow.close(self,*obj)
|
||||
|
||||
def get_intro_text(self):
|
||||
@@ -596,7 +610,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
hasattr(self.option_box_instance, "no_fileselect")):
|
||||
filename = ""
|
||||
else:
|
||||
filename = Utils.get_unicode_path(self.chooser.get_filename())
|
||||
filename = Utils.get_unicode_path_from_file_chooser(self.chooser.get_filename())
|
||||
config.set('paths.recent-export-dir', os.path.split(filename)[0])
|
||||
ix = self.get_selected_format_index()
|
||||
config.set('behavior.recent-export-type', ix)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
SUBDIRS = Rules SideBar
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_FilterComboBox.py \
|
||||
_FilterList.py \
|
||||
_FilterMenu.py \
|
||||
@@ -17,7 +17,6 @@ pkgdata_PYTHON = \
|
||||
_SearchFilter.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters
|
||||
pkgpythondir = @pkgpythondir@/Filters
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -26,4 +25,4 @@ GRAMPS_PY_MODPATH = "../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Event level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Event
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Event
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_ChangedSince.py\
|
||||
_MatchesFilter.py\
|
||||
_EventPrivate.py\
|
||||
@@ -24,7 +24,7 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Event
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Event
|
||||
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -33,4 +33,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -40,5 +40,5 @@ from Filters.Rules._HasSourceBase import HasSourceBase
|
||||
class HasSource(HasSourceBase):
|
||||
"""Events with sources"""
|
||||
|
||||
name = _('Events with <count> source')
|
||||
description = _("Matches events with a certain number of items in the source")
|
||||
name = _('Events with <count> sources')
|
||||
description = _("Matches events with a certain number of sources connected to it")
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Family level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Family
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Family
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_AllFamilies.py\
|
||||
_ChangedSince.py\
|
||||
_FamilyPrivate.py\
|
||||
@@ -38,7 +38,6 @@ pkgdata_PYTHON = \
|
||||
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Family
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Family
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -47,4 +46,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -43,5 +43,5 @@ from Filters.Rules._HasSourceBase import HasSourceBase
|
||||
class HasSource(HasSourceBase):
|
||||
"""Families with sources"""
|
||||
|
||||
name = _('Families with <count> source')
|
||||
description = _("Matches families with a certain number of items in the source")
|
||||
name = _('Families with <count> sources')
|
||||
description = _("Matches families with a certain number of sources connected to it")
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
SUBDIRS = Person Family Event Place Source MediaObject Repository Note
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_ChangedSinceBase.py\
|
||||
_Everything.py\
|
||||
_HasEventBase.py\
|
||||
@@ -29,7 +29,6 @@ pkgdata_PYTHON = \
|
||||
_HasMarkerBase.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -38,4 +37,4 @@ GRAMPS_PY_MODPATH = "../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/MediaObject level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/MediaObject
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/MediaObject
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_AllMedia.py\
|
||||
_ChangedSince.py\
|
||||
_HasIdOf.py\
|
||||
@@ -17,7 +17,7 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/MediaObject
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/MediaObject
|
||||
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -26,4 +26,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Note level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Note
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Note
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_AllNotes.py\
|
||||
_ChangedSince.py\
|
||||
_HasIdOf.py\
|
||||
@@ -17,7 +17,6 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Note
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Note
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -26,4 +25,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -57,7 +57,7 @@ class MatchesRegexpOf(Rule):
|
||||
|
||||
def apply(self, db, note):
|
||||
""" Apply the filter """
|
||||
text = unicode(note.get())
|
||||
text = note.get()
|
||||
if self.match.match(text) is not None:
|
||||
return True
|
||||
return False
|
||||
@@ -49,7 +49,7 @@ class MatchesSubstringOf(Rule):
|
||||
|
||||
def apply(self, db, note):
|
||||
""" Apply the filter """
|
||||
text = unicode(note.get())
|
||||
text = note.get()
|
||||
if text.upper().find(self.list[0].upper()) != -1:
|
||||
return True
|
||||
return False
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Person level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Person
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Person
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_ChangedSince.py\
|
||||
_Disconnected.py \
|
||||
_DeepRelationshipPathBetween.py \
|
||||
@@ -74,7 +74,6 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Person
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Person
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -83,4 +82,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -46,10 +46,10 @@ def filter_database(db, progress, filter_name):
|
||||
"""Returns a list of person handles"""
|
||||
|
||||
filt = MatchesFilter([filter_name])
|
||||
progress.set_header('Preparing sub-filter')
|
||||
filt.prepare(db)
|
||||
progress.set_header(_('Preparing sub-filter'))
|
||||
filt.requestprepare(db)
|
||||
|
||||
progress.set_header('Retrieving all sub-filter matches')
|
||||
progress.set_header(_('Retrieving all sub-filter matches'))
|
||||
matches = []
|
||||
for handle in db.iter_person_handles():
|
||||
person = db.get_person_from_handle(handle)
|
||||
@@ -57,7 +57,7 @@ def filter_database(db, progress, filter_name):
|
||||
matches.append(handle)
|
||||
progress.step()
|
||||
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
return matches
|
||||
|
||||
@@ -75,7 +75,8 @@ def get_family_handle_people(db, exclude_handle, family_handle):
|
||||
possibly_add_handle(family.get_mother_handle())
|
||||
|
||||
for child_ref in family.get_child_ref_list():
|
||||
possibly_add_handle(child_ref.get_reference_handle())
|
||||
if child_ref:
|
||||
possibly_add_handle(child_ref.get_reference_handle())
|
||||
|
||||
return people
|
||||
|
||||
@@ -132,7 +133,7 @@ class DeepRelationshipPathBetween(Rule):
|
||||
root_person = db.get_person_from_gramps_id(root_person_id)
|
||||
|
||||
progress = ProgressMeter(_('Finding relationship paths'))
|
||||
progress.set_pass(header=_('Evaluating people'), mode=ProgressMeter.MODE_ACTIVITY)
|
||||
progress.set_pass(header=_('Evaluating people'), mode=ProgressMeter.MODE_ACTIVITY)
|
||||
|
||||
filter_name = self.list[1]
|
||||
target_people = filter_database(db, progress, filter_name)
|
||||
|
||||
@@ -48,11 +48,12 @@ class FamilyWithIncompleteEvent(Rule):
|
||||
def apply(self,db,person):
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = db.get_family_from_handle(family_handle)
|
||||
for event_ref in family.get_event_ref_list():
|
||||
if event_ref:
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
if not event.get_place_handle():
|
||||
return True
|
||||
if not event.get_date_object():
|
||||
return True
|
||||
if family:
|
||||
for event_ref in family.get_event_ref_list():
|
||||
if event_ref:
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
if not event.get_place_handle():
|
||||
return True
|
||||
if not event.get_date_object():
|
||||
return True
|
||||
return False
|
||||
@@ -58,7 +58,9 @@ class HasBirth(Rule):
|
||||
|
||||
def apply(self,db,person):
|
||||
for event_ref in person.get_event_ref_list():
|
||||
if event_ref.role != EventRoleType.PRIMARY:
|
||||
if not event_ref:
|
||||
continue
|
||||
elif event_ref.role != EventRoleType.PRIMARY:
|
||||
# Only match primaries, no witnesses
|
||||
continue
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
|
||||
@@ -63,19 +63,28 @@ class HasCommonAncestorWith(Rule):
|
||||
def add_ancs(self, db, person):
|
||||
if person.handle not in self.ancestor_cache:
|
||||
self.ancestor_cache[person.handle] = set()
|
||||
# We are going to compare ancestors of one person with that of
|
||||
# another person; if that other person is an ancestor and itself
|
||||
# has no ancestors is must be included, this is achieved by the
|
||||
# little trick of making a person his own ancestor.
|
||||
self.ancestor_cache[person.handle].add(person.handle)
|
||||
else:
|
||||
return
|
||||
|
||||
for fam_handle in person.get_parent_family_handle_list():
|
||||
parentless_fam = True
|
||||
fam = db.get_family_from_handle(fam_handle)
|
||||
for par_handle in (fam.get_father_handle(), fam.get_mother_handle()):
|
||||
if par_handle:
|
||||
par = db.get_person_from_handle(par_handle)
|
||||
if par and par.handle not in self.ancestor_cache:
|
||||
self.add_ancs(db, par)
|
||||
if par:
|
||||
self.ancestor_cache[person.handle].add(par)
|
||||
self.ancestor_cache[person.handle] |= self.ancestor_cache[par.handle]
|
||||
if fam:
|
||||
for par_handle in (fam.get_father_handle(), fam.get_mother_handle()):
|
||||
if par_handle:
|
||||
parentless_fam = False
|
||||
par = db.get_person_from_handle(par_handle)
|
||||
if par and par.handle not in self.ancestor_cache:
|
||||
self.add_ancs(db, par)
|
||||
if par:
|
||||
self.ancestor_cache[person.handle] |= self.ancestor_cache[par.handle]
|
||||
if parentless_fam:
|
||||
self.ancestor_cache[person.handle].add(fam_handle)
|
||||
|
||||
def reset(self):
|
||||
self.ancestor_cache = {}
|
||||
|
||||
@@ -41,7 +41,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# HasCommonAncestorWithFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class HasCommonAncestorWithFilterMatch(HasCommonAncestorWith,MatchesFilter):
|
||||
class HasCommonAncestorWithFilterMatch(HasCommonAncestorWith):
|
||||
"""Rule that checks for a person that has a common ancestor with
|
||||
someone matching a filter"""
|
||||
|
||||
@@ -64,7 +64,7 @@ class HasCommonAncestorWithFilterMatch(HasCommonAncestorWith,MatchesFilter):
|
||||
self.ancestor_cache = {}
|
||||
self.with_people = []
|
||||
filt = MatchesFilter(self.list)
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for handle in db.iter_person_handles():
|
||||
person = db.get_person_from_handle(handle)
|
||||
if filt.apply (db, person):
|
||||
@@ -73,4 +73,4 @@ class HasCommonAncestorWithFilterMatch(HasCommonAncestorWith,MatchesFilter):
|
||||
#fill list of ancestor of person if not present yet
|
||||
if handle not in self.ancestor_cache:
|
||||
self.add_ancs(db, person)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
@@ -58,7 +58,9 @@ class HasDeath(Rule):
|
||||
|
||||
def apply(self,db,person):
|
||||
for event_ref in person.get_event_ref_list():
|
||||
if event_ref.role != EventRoleType.PRIMARY:
|
||||
if not event_ref:
|
||||
continue
|
||||
elif event_ref.role != EventRoleType.PRIMARY:
|
||||
# Only match primaries, no witnesses
|
||||
continue
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
|
||||
@@ -53,10 +53,13 @@ class HasFamilyAttribute(Rule):
|
||||
return False
|
||||
for f_id in person.get_family_handle_list():
|
||||
f = db.get_family_from_handle(f_id)
|
||||
if not f:
|
||||
continue
|
||||
for attr in f.get_attribute_list():
|
||||
name_match = self.list[0] == attr.get_type()
|
||||
value_match = \
|
||||
attr.get_value().upper().find(self.list[1].upper()) != -1
|
||||
if name_match and value_match:
|
||||
return True
|
||||
if attr:
|
||||
name_match = self.list[0] == attr.get_type()
|
||||
value_match = \
|
||||
attr.get_value().upper().find(self.list[1].upper()) != -1
|
||||
if name_match and value_match:
|
||||
return True
|
||||
return False
|
||||
@@ -64,6 +64,8 @@ class HasFamilyEvent(Rule):
|
||||
def apply(self,db,person):
|
||||
for f_id in person.get_family_handle_list():
|
||||
f = db.get_family_from_handle(f_id)
|
||||
if not f:
|
||||
continue
|
||||
for event_ref in f.get_event_ref_list():
|
||||
if not event_ref:
|
||||
continue
|
||||
|
||||
@@ -61,9 +61,10 @@ class HasRelationship(Rule):
|
||||
# count children and look for a relationship type match
|
||||
for f_id in person.get_family_handle_list():
|
||||
f = db.get_family_from_handle(f_id)
|
||||
cnt = cnt + len(f.get_child_ref_list())
|
||||
if self.list[1] and specified_type == f.get_relationship():
|
||||
rel_type = 1
|
||||
if f:
|
||||
cnt = cnt + len(f.get_child_ref_list())
|
||||
if self.list[1] and specified_type == f.get_relationship():
|
||||
rel_type = 1
|
||||
|
||||
# if number of relations specified
|
||||
if self.list[0]:
|
||||
|
||||
@@ -43,5 +43,5 @@ from Filters.Rules._HasSourceBase import HasSourceBase
|
||||
class HasSource(HasSourceBase):
|
||||
"""People with sources"""
|
||||
|
||||
name = _('People with <count> source')
|
||||
description = _("Matches people with a certain number of items in the source")
|
||||
name = _('People with <count> sources')
|
||||
description = _("Matches people with a certain number of sources connected to it")
|
||||
@@ -171,7 +171,7 @@ class HasTextMatchingSubstringOf(Rule):
|
||||
self.repo_map.update(
|
||||
|
||||
repo.handle for repo in self.db.iter_repositories()
|
||||
if self.match_object(repo)
|
||||
if repo and self.match_object(repo)
|
||||
|
||||
)
|
||||
|
||||
|
||||
@@ -48,9 +48,10 @@ class HaveAltFamilies(Rule):
|
||||
def apply(self,db,person):
|
||||
for fhandle in person.get_parent_family_handle_list():
|
||||
family = db.get_family_from_handle(fhandle)
|
||||
ref = [ ref for ref in family.get_child_ref_list() \
|
||||
if ref.ref == person.handle]
|
||||
if ref[0].get_father_relation() == ChildRefType.ADOPTED \
|
||||
or ref[0].get_mother_relation() == ChildRefType.ADOPTED:
|
||||
return True
|
||||
if family:
|
||||
ref = [ ref for ref in family.get_child_ref_list() \
|
||||
if ref.ref == person.handle]
|
||||
if ref[0].get_father_relation() == ChildRefType.ADOPTED \
|
||||
or ref[0].get_mother_relation() == ChildRefType.ADOPTED:
|
||||
return True
|
||||
return False
|
||||
@@ -47,4 +47,4 @@ class HaveChildren(Rule):
|
||||
def apply(self,db,person):
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = db.get_family_from_handle(family_handle)
|
||||
return len(family.get_child_ref_list()) > 0
|
||||
return (family is not None) and len(family.get_child_ref_list()) > 0
|
||||
@@ -40,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsAncestorOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsAncestorOfFilterMatch(IsAncestorOf,MatchesFilter):
|
||||
class IsAncestorOfFilterMatch(IsAncestorOf):
|
||||
"""Rule that checks for a person that is an ancestor of
|
||||
someone matched by a filter"""
|
||||
|
||||
@@ -66,11 +66,11 @@ class IsAncestorOfFilterMatch(IsAncestorOf,MatchesFilter):
|
||||
first = 1
|
||||
|
||||
filt = MatchesFilter(self.list[0:1])
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for person in db.iter_people():
|
||||
if filt.apply(db, person):
|
||||
self.init_ancestor_list(db, person, first)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
def reset(self):
|
||||
self.map.clear()
|
||||
|
||||
@@ -32,6 +32,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Filters.Rules import Rule
|
||||
from _MatchesFilter import MatchesFilter
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -39,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsChildOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsChildOfFilterMatch(MatchesFilter):
|
||||
class IsChildOfFilterMatch(Rule):
|
||||
"""Rule that checks for a person that is a child
|
||||
of someone matched by a filter"""
|
||||
|
||||
@@ -52,11 +53,11 @@ class IsChildOfFilterMatch(MatchesFilter):
|
||||
self.db = db
|
||||
self.map = set()
|
||||
filt = MatchesFilter(self.list)
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for person in db.iter_people():
|
||||
if filt.apply(db, person):
|
||||
self.init_list(person)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
def reset(self):
|
||||
self.map.clear()
|
||||
@@ -69,5 +70,6 @@ class IsChildOfFilterMatch(MatchesFilter):
|
||||
return
|
||||
for fam_id in person.get_family_handle_list():
|
||||
fam = self.db.get_family_from_handle(fam_id)
|
||||
self.map.update(child_ref.ref
|
||||
for child_ref in fam.get_child_ref_list())
|
||||
if fam:
|
||||
self.map.update(child_ref.ref
|
||||
for child_ref in fam.get_child_ref_list())
|
||||
@@ -83,17 +83,18 @@ class IsDescendantFamilyOf(Rule):
|
||||
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = self.db.get_family_from_handle(family_handle)
|
||||
if family:
|
||||
# Add every child recursively
|
||||
for child_ref in family.get_child_ref_list():
|
||||
if child_ref:
|
||||
self.add_matches(self.db.get_person_from_handle(child_ref.ref))
|
||||
|
||||
# Add every child recursively
|
||||
for child_ref in family.get_child_ref_list():
|
||||
self.add_matches(self.db.get_person_from_handle(child_ref.ref))
|
||||
|
||||
# Add spouse
|
||||
if person.handle == family.get_father_handle():
|
||||
spouse_handle = family.get_mother_handle()
|
||||
else:
|
||||
spouse_handle = family.get_father_handle()
|
||||
self.matches.add(spouse_handle)
|
||||
# Add spouse
|
||||
if person.handle == family.get_father_handle():
|
||||
spouse_handle = family.get_mother_handle()
|
||||
else:
|
||||
spouse_handle = family.get_father_handle()
|
||||
self.matches.add(spouse_handle)
|
||||
|
||||
def exclude(self):
|
||||
# This removes root person and his/her spouses from the matches set
|
||||
@@ -101,8 +102,9 @@ class IsDescendantFamilyOf(Rule):
|
||||
self.matches.remove(self.root_person.handle)
|
||||
for family_handle in self.root_person.get_family_handle_list():
|
||||
family = self.db.get_family_from_handle(family_handle)
|
||||
if self.root_person.handle == family.get_father_handle():
|
||||
spouse_handle = family.get_mother_handle()
|
||||
else:
|
||||
spouse_handle = family.get_father_handle()
|
||||
self.matches.remove(spouse_handle)
|
||||
if family:
|
||||
if self.root_person.handle == family.get_father_handle():
|
||||
spouse_handle = family.get_mother_handle()
|
||||
else:
|
||||
spouse_handle = family.get_father_handle()
|
||||
self.matches.remove(spouse_handle)
|
||||
@@ -40,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsDescendantOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsDescendantOfFilterMatch(IsDescendantOf,MatchesFilter):
|
||||
class IsDescendantOfFilterMatch(IsDescendantOf):
|
||||
"""Rule that checks for a person that is a descendant
|
||||
of someone matched by a filter"""
|
||||
|
||||
@@ -66,11 +66,11 @@ class IsDescendantOfFilterMatch(IsDescendantOf,MatchesFilter):
|
||||
first = 1
|
||||
|
||||
filt = MatchesFilter(self.list[0:1])
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for person in db.iter_people():
|
||||
if filt.apply(db, person):
|
||||
self.init_list(person, first)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
def reset(self):
|
||||
self.map.clear()
|
||||
|
||||
@@ -75,6 +75,7 @@ class IsLessThanNthGenerationDescendantOf(Rule):
|
||||
|
||||
for fam_id in person.get_family_handle_list():
|
||||
fam = self.db.get_family_from_handle(fam_id)
|
||||
for child_ref in fam.get_child_ref_list():
|
||||
self.init_list(
|
||||
self.db.get_person_from_handle(child_ref.ref), gen+1)
|
||||
if fam:
|
||||
for child_ref in fam.get_child_ref_list():
|
||||
self.init_list(
|
||||
self.db.get_person_from_handle(child_ref.ref), gen+1)
|
||||
@@ -73,6 +73,7 @@ class IsMoreThanNthGenerationDescendantOf(Rule):
|
||||
|
||||
for fam_id in person.get_family_handle_list():
|
||||
fam = self.db.get_family_from_handle(fam_id)
|
||||
for child_ref in fam.get_child_ref_list():
|
||||
self.init_list(
|
||||
self.db.get_person_from_handle(child_ref.ref), gen+1)
|
||||
if fam:
|
||||
for child_ref in fam.get_child_ref_list():
|
||||
self.init_list(
|
||||
self.db.get_person_from_handle(child_ref.ref), gen+1)
|
||||
@@ -32,6 +32,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Filters.Rules import Rule
|
||||
from _MatchesFilter import MatchesFilter
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -39,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsParentOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsParentOfFilterMatch(MatchesFilter):
|
||||
class IsParentOfFilterMatch(Rule):
|
||||
"""Rule that checks for a person that is a parent
|
||||
of someone matched by a filter"""
|
||||
|
||||
@@ -52,11 +53,11 @@ class IsParentOfFilterMatch(MatchesFilter):
|
||||
self.db = db
|
||||
self.map = set()
|
||||
filt = MatchesFilter(self.list)
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for person in db.iter_people():
|
||||
if filt.apply(db, person):
|
||||
self.init_list(person)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
def reset(self):
|
||||
self.map.clear()
|
||||
@@ -67,6 +68,9 @@ class IsParentOfFilterMatch(MatchesFilter):
|
||||
def init_list(self,person):
|
||||
for fam_id in person.get_parent_family_handle_list():
|
||||
fam = self.db.get_family_from_handle(fam_id)
|
||||
self.map.update(parent_id
|
||||
for parent_id in [fam.get_father_handle(), fam.get_mother_handle()]
|
||||
if parent_id)
|
||||
if fam:
|
||||
self.map.update(parent_id
|
||||
for parent_id in [fam.get_father_handle(),
|
||||
fam.get_mother_handle()]
|
||||
if parent_id)
|
||||
|
||||
@@ -32,6 +32,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Filters.Rules import Rule
|
||||
from _MatchesFilter import MatchesFilter
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -39,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsSiblingOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsSiblingOfFilterMatch(MatchesFilter):
|
||||
class IsSiblingOfFilterMatch(Rule):
|
||||
"""Rule that checks for siblings of someone matched by a filter"""
|
||||
|
||||
labels = [ _('Filter name:') ]
|
||||
@@ -51,11 +52,11 @@ class IsSiblingOfFilterMatch(MatchesFilter):
|
||||
self.db = db
|
||||
self.map = set()
|
||||
filt = MatchesFilter(self.list)
|
||||
filt.prepare(db)
|
||||
filt.requestprepare(db)
|
||||
for person in db.iter_people():
|
||||
if filt.apply (db, person):
|
||||
self.init_list (person)
|
||||
filt.reset()
|
||||
filt.requestreset()
|
||||
|
||||
def reset(self):
|
||||
self.map.clear()
|
||||
@@ -71,4 +72,4 @@ class IsSiblingOfFilterMatch(MatchesFilter):
|
||||
if fam:
|
||||
self.map.update(child_ref.ref
|
||||
for child_ref in fam.get_child_ref_list()
|
||||
if child_ref.ref != person.handle)
|
||||
if child_ref and child_ref.ref != person.handle)
|
||||
@@ -32,6 +32,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Filters.Rules import Rule
|
||||
from _MatchesFilter import MatchesFilter
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -39,7 +40,7 @@ from _MatchesFilter import MatchesFilter
|
||||
# IsSpouseOfFilterMatch
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class IsSpouseOfFilterMatch(MatchesFilter):
|
||||
class IsSpouseOfFilterMatch(Rule):
|
||||
"""Rule that checks for a person married to someone matching
|
||||
a filter"""
|
||||
|
||||
@@ -50,16 +51,21 @@ class IsSpouseOfFilterMatch(MatchesFilter):
|
||||
|
||||
def prepare(self,db):
|
||||
self.filt = MatchesFilter (self.list)
|
||||
self.filt.prepare(db)
|
||||
self.filt.requestprepare(db)
|
||||
|
||||
def apply(self,db,person):
|
||||
for family_handle in person.get_family_handle_list ():
|
||||
family = db.get_family_from_handle(family_handle)
|
||||
for spouse_id in [family.get_father_handle (), family.get_mother_handle ()]:
|
||||
if not spouse_id:
|
||||
continue
|
||||
if spouse_id == person.handle:
|
||||
continue
|
||||
if self.filt.apply (db, db.get_person_from_handle( spouse_id)):
|
||||
return True
|
||||
if family:
|
||||
for spouse_id in [family.get_father_handle(),
|
||||
family.get_mother_handle()]:
|
||||
if not spouse_id:
|
||||
continue
|
||||
if spouse_id == person.handle:
|
||||
continue
|
||||
if self.filt.apply (db, db.get_person_from_handle( spouse_id)):
|
||||
return True
|
||||
return False
|
||||
|
||||
def reset(self):
|
||||
self.filt.requestreset()
|
||||
@@ -48,7 +48,7 @@ class IsWitness(Rule):
|
||||
|
||||
def apply(self,db,person):
|
||||
for event_ref in person.event_ref_list:
|
||||
if event_ref.role == EventRoleType.WITNESS:
|
||||
if event_ref and event_ref.role == EventRoleType.WITNESS:
|
||||
# This is the witness.
|
||||
# If event type was given, then check it.
|
||||
if self.list[0]:
|
||||
|
||||
@@ -53,10 +53,11 @@ class MissingParent(Rule):
|
||||
return True
|
||||
for family_handle in person.get_parent_family_handle_list():
|
||||
family = db.get_family_from_handle(family_handle)
|
||||
father_handle = family.get_father_handle()
|
||||
mother_handle = family.get_mother_handle()
|
||||
if not father_handle:
|
||||
return True
|
||||
if not mother_handle:
|
||||
return True
|
||||
if family:
|
||||
father_handle = family.get_father_handle()
|
||||
mother_handle = family.get_mother_handle()
|
||||
if not father_handle:
|
||||
return True
|
||||
if not mother_handle:
|
||||
return True
|
||||
return False
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Place level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Place
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Place
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_AllPlaces.py\
|
||||
_ChangedSince.py\
|
||||
_HasIdOf.py\
|
||||
@@ -21,7 +21,6 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Place
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Place
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -30,4 +29,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Media level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Repository
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Repository
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_AllRepos.py\
|
||||
_ChangedSince.py\
|
||||
_HasIdOf.py\
|
||||
@@ -16,7 +16,6 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Repository
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Repository
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -25,4 +24,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/Rules/Source level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Source
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/Rules/Source
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_ChangedSince.py\
|
||||
_MatchesFilter.py\
|
||||
_SourcePrivate.py\
|
||||
@@ -19,7 +19,6 @@ pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Source
|
||||
pkgpythondir = @pkgpythondir@/Filters/Rules/Source
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -28,4 +27,4 @@ GRAMPS_PY_MODPATH = "../../../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -43,7 +43,7 @@ class HasRepository(Rule):
|
||||
|
||||
labels = [ _('Number of instances:'), _('Number must be:')]
|
||||
name = _('Sources with <count> Repository references')
|
||||
description = _("Matches sources with certain number repository references")
|
||||
description = _("Matches sources with a certain number of repository references")
|
||||
category = _('General filters')
|
||||
|
||||
def prepare(self, db):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2002-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Raphael Ackermann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -40,7 +41,7 @@ from Filters.Rules import Rule
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class HasGrampsId(Rule):
|
||||
"""Rule that checks for a person with a specific GRAMPS ID."""
|
||||
"""Rule that checks for an object with a specific GRAMPS ID."""
|
||||
|
||||
labels = [ _('ID:') ]
|
||||
name = _('Object with <Id>')
|
||||
@@ -48,4 +49,8 @@ class HasGrampsId(Rule):
|
||||
category = _('General filters')
|
||||
|
||||
def apply(self, db, obj):
|
||||
return obj.gramps_id.find(self.list[0]) !=-1
|
||||
"""
|
||||
apply the rule on the obj.
|
||||
return true if the rule passes, false otherwise.
|
||||
"""
|
||||
return obj.gramps_id == self.list[0]
|
||||
@@ -59,7 +59,7 @@ class HasNoteRegexBase(Rule):
|
||||
notelist = person.get_note_list()
|
||||
for notehandle in notelist:
|
||||
note = db.get_note_from_handle(notehandle)
|
||||
n = unicode(note.get())
|
||||
n = note.get()
|
||||
if self.match.match(n) is not None:
|
||||
return True
|
||||
return False
|
||||
@@ -50,7 +50,7 @@ class HasNoteSubstrBase(Rule):
|
||||
notelist = person.get_note_list()
|
||||
for notehandle in notelist:
|
||||
note = db.get_note_from_handle(notehandle)
|
||||
n = unicode(note.get())
|
||||
n = note.get()
|
||||
if n.upper().find(self.list[0].upper()) != -1:
|
||||
return True
|
||||
return False
|
||||
@@ -43,7 +43,7 @@ class HasSourceBase(Rule):
|
||||
|
||||
labels = [ _('Number of instances:'), _('Number must be:')]
|
||||
name = _('Objects with <count> sources')
|
||||
description = _("Matches objects that have a certain number of sources")
|
||||
description = _("Matches objects that have a certain number of sources connected to it")
|
||||
category = _('General filters')
|
||||
|
||||
def prepare(self, db):
|
||||
|
||||
@@ -55,34 +55,22 @@ class MatchesFilterBase(Rule):
|
||||
category = _('General filters')
|
||||
|
||||
def prepare(self, db):
|
||||
#if Filters.SystemFilters:
|
||||
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||
#if filt.get_name() == self.list[0]:
|
||||
#for rule in filt.flist:
|
||||
#rule.prepare(db)
|
||||
if Filters.CustomFilters:
|
||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||
if filt.get_name() == self.list[0]:
|
||||
for rule in filt.flist:
|
||||
rule.prepare(db)
|
||||
rule.requestprepare(db)
|
||||
break
|
||||
|
||||
def reset(self):
|
||||
#if Filters.SystemFilters:
|
||||
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||
#if filt.get_name() == self.list[0]:
|
||||
#for rule in filt.flist:
|
||||
#rule.reset()
|
||||
if Filters.CustomFilters:
|
||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||
if filt.get_name() == self.list[0]:
|
||||
for rule in filt.flist:
|
||||
rule.reset()
|
||||
rule.requestreset()
|
||||
break
|
||||
|
||||
def apply(self, db, obj):
|
||||
#if Filters.SystemFilters:
|
||||
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||
#if filt.get_name() == self.list[0]:
|
||||
#return filt.check(db, obj.handle)
|
||||
if Filters.CustomFilters:
|
||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||
if filt.get_name() == self.list[0]:
|
||||
@@ -93,10 +81,6 @@ class MatchesFilterBase(Rule):
|
||||
"""
|
||||
Return the selected filter or None.
|
||||
"""
|
||||
#if Filters.SystemFilters:
|
||||
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||
#if filt.get_name() == self.list[0]:
|
||||
#return filt
|
||||
if Filters.CustomFilters:
|
||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||
if filt.get_name() == self.list[0]:
|
||||
|
||||
@@ -43,14 +43,47 @@ class Rule(object):
|
||||
|
||||
def __init__(self, arg):
|
||||
self.set_list(arg)
|
||||
self.nrprepare = 0
|
||||
|
||||
def is_empty(self):
|
||||
return False
|
||||
|
||||
def requestprepare(self, db):
|
||||
"""
|
||||
Request that the prepare method of the rule is executed if needed
|
||||
|
||||
Special: Custom Filters have fixed values, so only one instance needs to
|
||||
exists during a search. It is stored in a FilterStore, and initialized
|
||||
once.
|
||||
As filters are can be grouped in a group
|
||||
filter, we request a prepare. Only the first time prepare will be
|
||||
called
|
||||
"""
|
||||
if self.nrprepare == 0:
|
||||
self.prepare(db)
|
||||
self.nrprepare += 1
|
||||
|
||||
def prepare(self, db):
|
||||
"""prepare so the rule can be executed efficiently"""
|
||||
pass
|
||||
|
||||
def requestreset(self):
|
||||
"""
|
||||
Request that the reset method of the rule is executed if possible
|
||||
|
||||
Special: Custom Filters have fixed values, so only one instance needs to
|
||||
exists during a search. It is stored in a FilterStore, and initialized
|
||||
once.
|
||||
As filters are can be grouped in a group
|
||||
filter, we request a reset. Only the last time reset will be
|
||||
called
|
||||
"""
|
||||
self.nrprepare -= 1
|
||||
if self.nrprepare == 0:
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
"""remove no longer needed memory"""
|
||||
pass
|
||||
|
||||
def set_list(self, arg):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This is the src/Filters/SideBar level Makefile for Gramps
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/Filters/SideBar
|
||||
pkgpythondir = $(datadir)/@PACKAGE@/Filters/SideBar
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
pkgpython_PYTHON = \
|
||||
_EventSidebarFilter.py \
|
||||
_FamilySidebarFilter.py \
|
||||
__init__.py \
|
||||
@@ -15,7 +15,6 @@ pkgdata_PYTHON = \
|
||||
_NoteSidebarFilter.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Filters/SideBar
|
||||
pkgpythondir = @pkgpythondir@/Filters/SideBar
|
||||
|
||||
# Clean up all the byte-compiled files
|
||||
MOSTLYCLEANFILES = *pyc *pyo
|
||||
@@ -24,4 +23,4 @@ GRAMPS_PY_MODPATH = "../"
|
||||
|
||||
pycheck:
|
||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
||||
pychecker $(pkgdata_PYTHON));
|
||||
pychecker $(pkgpython_PYTHON));
|
||||
@@ -27,6 +27,7 @@
|
||||
#-------------------------------------------------------------------------
|
||||
from xml.sax import make_parser, SAXParseException
|
||||
import os
|
||||
import sys
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -84,8 +85,7 @@ class FilterList(object):
|
||||
return l.replace('"', '"')
|
||||
|
||||
def save(self):
|
||||
f = open(self.file.encode('utf-8'), 'w')
|
||||
|
||||
f = open(self.file.encode(sys.getfilesystemencoding()), 'w')
|
||||
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||
f.write('<filters>\n')
|
||||
for namespace in self.filter_namespaces:
|
||||
|
||||
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user