Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tree.py')
-rw-r--r--src/tree.py50
1 files changed, 38 insertions, 12 deletions
diff --git a/src/tree.py b/src/tree.py
index e8183a3..189b712 100644
--- a/src/tree.py
+++ b/src/tree.py
@@ -1,8 +1,12 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
# Base import
import pickle
import tempfile
import os
import gtk
+from gettext import gettext as _
# Local import
from person import Person
@@ -333,9 +337,9 @@ class Tree:
# Create the samples family
-def empty_tree():
+def empty_tree(xoOwner):
tree = Tree()
- tree.root = tree.Person("", "M")
+ tree.root = tree.Person(xoOwner, "M")
tree.root.isroot = True
return tree
@@ -367,19 +371,19 @@ def sample_family1():
ub = tree.Union(jo, j)
ub.append_child(tree.Person("Charlie", "F"))
- rs = tree.Person("Renee", "F")
+ rs = tree.Person("Renée", "F")
vm = tree.Person("Vivien", "M")
urv = tree.Union(vm, rs)
urv.append_child(j)
- jr = tree.Person("Jean-Rene", "M")
+ jr = tree.Person("Jean-René", "M")
ua = tree.Union(jr, tree.Person("Micheline", "F"))
ua.append_child(a)
- i = tree.Person("Irene", "F")
+ i = tree.Person("Irène", "F")
ua.append_child(i)
ui = tree.Union(tree.Person("Nathan", "M"), i)
ui.append_child(tree.Person("Marie", "F"))
- ui.append_child(tree.Person("Noel", "M"))
+ ui.append_child(tree.Person("Noël", "M"))
ui.append_child(tree.Person("Thierry", "M"))
uc = tree.Union(c, tree.Person("Clarah", "F"))
@@ -399,29 +403,51 @@ def sample_family1():
def sample_family2():
# Napoleon family
tree = Tree()
- tree.root = p1 = tree.Person("Chales-Marie Bonaparte", "M")
+ tree.root = p1 = tree.Person("Charles-Marie Bonaparte", "M")
+ p1.description = _("(1746-1785) This young Corsican aristocrat studied law in Italy and Corsica.")
+ p1.image = gtk.gdk.pixbuf_new_from_file("images/napo_p1.jpg")
p2 = tree.Person("Letizia Ramolino", "F")
+ p2.description = _("(1750-1836) She married very young, at 14 years old. In Corsica, she was known as the 'little marvel', famed for her beauty far and wide.")
+ p2.image = gtk.gdk.pixbuf_new_from_file("images/napo_p2.jpg")
u1 = tree.Union(p2, p1)
- p4 = tree.Person("Napoleon", "M")
+ p4 = tree.Person("Napoléon Ier", "M")
+ p4.description = _("(1769-1821) He was born on 15 August 1769 in Ajaccio, Corsica. At the age of 10, he left Corsica with his older brother Joseph to study at the Ecole Militaire in Paris.")
+ p4.image = gtk.gdk.pixbuf_new_from_file("images/napo_p4.jpg")
p6 = tree.Person("Louis Bonaparte", "M")
+ p6.description = _("(1778-1846) While still a child, Louis joined his brother Napoleon in Paris. He accompanied his brother on his early military campaigns and became King of Holland at the age of 28.")
+ p6.image = gtk.gdk.pixbuf_new_from_file("images/napo_p6.jpg")
u1.append_child(p4)
u1.append_child(p6)
- p3 = tree.Person("Josephine", "F")
+ p3 = tree.Person("Joséphine", "F")
+ p3.description = _("(1763-1814) She was born in Martinique and arrived in Paris at the age of 16. Her first hushband Alexandre de Beauharnais was guillotined during the French Revolution.")
+ p3.image = gtk.gdk.pixbuf_new_from_file("images/napo_p3.jpg")
u2 = tree.Union(p4, p3)
p5 = tree.Person("Marie-Louise d'Autriche", "F")
+ p5.description = _("(1791-1847) She was daughter of the king of Austria and became Napoleon's second wife.")
+ p5.image = gtk.gdk.pixbuf_new_from_file("images/napo_p5.jpg")
u3 = tree.Union(p4, p5)
- p10 = tree.Person("Napoleon II", "M")
+ p10 = tree.Person("Napoléon II", "M")
+ p10.description = _("(1811-1832) When the French Empire fell once and for all, he followed his mother to Austria and died at a very young age, only 21 years old.")
+ p10.image = gtk.gdk.pixbuf_new_from_file("images/napo_p10.jpg")
u3.append_child(p10)
p7 = tree.Person("Hortense de Beauharnais", "F")
+ p7.description = _("(1783-1837) She had a gift for music and wrote and composed romantic songs. She married Louis and became Queen of Holland.")
+ p7.image = gtk.gdk.pixbuf_new_from_file("images/napo_p7.jpg")
u4 = tree.Union(p6, p7)
- p8 = tree.Person("Napoleon III", "M")
+ p8 = tree.Person("Napoléon III", "M")
+ p8.description = _("(1808-1873) He had to spend a large part of his childhood in Switzerland with his mother. He became officer then president in 1848.")
+ p8.image = gtk.gdk.pixbuf_new_from_file("images/napo_p8.jpg")
u4.append_child(p8)
p9 = tree.Person("Eugenie de Palafox-Guzman", "F")
+ p9.description = _("(1826-1920) Daughter of a Spanish count, she became Empress through her marriage in 1853.")
+ p9.image = gtk.gdk.pixbuf_new_from_file("images/napo_p9.jpg")
u5 = tree.Union(p8, p9)
- p11 = tree.Person("Louis Napoleon", "M")
+ p11 = tree.Person("Louis Napoléon", "M")
+ p11.description = _("(1856-1879) When the French army was beaten by the Prussian army, he had to leave France. He chose to become a soldier for the English and was killed in South Africa.")
+ p11.image = gtk.gdk.pixbuf_new_from_file("images/napo_p11.jpg")
u5.append_child(p11)
tree.root.isroot = True