http://paste.pocoo.org/show/6955/
Sicherlich ist vielles nicht perfekt gelöst und die Docstrings fehler noch... Aber ich bezeichne das hier mal als Version 0.001 alpha. Editieren fehlt noch, weiß nocht nich genau wie ich das implementieren soll... Falls irgendwelche PEP8 Fehler sind, bitte weißt mich darauf hin. Bin ziemlich offen dafür. Mal ein Beispiel für die Benutzung...
Code: Alles auswählen
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
from vivibook import ViviBook
foobar = ViviBook("foobar.xml")
foobar.add_contact("Marcell", "S.", "Foobarweg 12", "20.3.1337")
print foobar.get_contact(0)
foobar.add_contact("Vivi", "Orunita")
for i in foobar.get_all_contacts():
print i
foobar.remove_contact(0)
print foobar.search_contacts("marcell")
print foobar.search_contacts("vivi")
for i in foobar.get_all_contacts():
print i
foobar.save()