* src/plugins/TestcaseGenerator.py: Feed in more data
svn: r5289
This commit is contained in:
parent
c3b626c960
commit
d44d8c8277
@ -1,3 +1,6 @@
|
|||||||
|
2005-10-07 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
|
* src/plugins/TestcaseGenerator.py: Feed in more data
|
||||||
|
|
||||||
2005-10-07 Alex Roitman <shura@gramps-project.org>
|
2005-10-07 Alex Roitman <shura@gramps-project.org>
|
||||||
* doc/gramps-manual/C/cmdplug.xml: Add new section documenting
|
* doc/gramps-manual/C/cmdplug.xml: Add new section documenting
|
||||||
plugin options (Reports and Tools).
|
plugin options (Reports and Tools).
|
||||||
|
@ -271,21 +271,43 @@ class TestcaseGenerator(Tool.Tool):
|
|||||||
or self.options.handler.options_dict['dates']\
|
or self.options.handler.options_dict['dates']\
|
||||||
or self.options.handler.options_dict['persons']:
|
or self.options.handler.options_dict['persons']:
|
||||||
|
|
||||||
|
self.default_url = RelLib.Url()
|
||||||
|
self.default_url.set_path("http://www.gramps-project.org/")
|
||||||
|
self.default_url.set_description("GRAMPS Project Homepage")
|
||||||
self.default_source = RelLib.Source()
|
self.default_source = RelLib.Source()
|
||||||
self.default_source.set_title("TestcaseGenerator")
|
self.default_source.set_title("TestcaseGenerator")
|
||||||
|
self.default_source.set_note("Generated by TestcaseGenerator")
|
||||||
|
self.default_source.set_data_item("Testcase Attribute", "Value test")
|
||||||
self.db.add_source(self.default_source, self.trans)
|
self.db.add_source(self.default_source, self.trans)
|
||||||
self.default_sourceref = RelLib.SourceRef()
|
self.default_sourceref = RelLib.SourceRef()
|
||||||
self.default_sourceref.set_base_handle(self.default_source.get_handle())
|
self.default_sourceref.set_base_handle(self.default_source.get_handle())
|
||||||
self.default_place = RelLib.Place()
|
self.default_attribute = RelLib.Attribute()
|
||||||
self.default_place.set_title("TestcaseGenerator place")
|
self.default_attribute.set_type("Testcase Attribute")
|
||||||
self.db.add_place(self.default_place, self.trans)
|
self.default_attribute.set_value("Value test")
|
||||||
|
self.default_attribute.set_note("Generated by TestcaseGenerator")
|
||||||
|
self.default_attribute.add_source_reference(self.default_sourceref)
|
||||||
self.default_media = RelLib.MediaObject()
|
self.default_media = RelLib.MediaObject()
|
||||||
self.default_media.set_description("TestcaseGenerator media")
|
self.default_media.set_description("TestcaseGenerator media")
|
||||||
self.default_media.set_path("/tmp/TestcaseGenerator.png")
|
self.default_media.set_path("/tmp/TestcaseGenerator.png")
|
||||||
self.default_media.set_mime_type("image/png")
|
self.default_media.set_mime_type("image/png")
|
||||||
|
self.default_media.set_note("Generated by TestcaseGenerator")
|
||||||
|
self.default_media.add_source_reference(self.default_sourceref)
|
||||||
|
self.default_media.add_attribute(self.default_attribute)
|
||||||
self.db.add_object(self.default_media, self.trans)
|
self.db.add_object(self.default_media, self.trans)
|
||||||
self.default_mediaref = RelLib.MediaRef()
|
self.default_mediaref = RelLib.MediaRef()
|
||||||
self.default_mediaref.set_reference_handle(self.default_media.get_handle())
|
self.default_mediaref.set_reference_handle(self.default_media.get_handle())
|
||||||
|
self.default_mediaref.set_note("Generated by TestcaseGenerator")
|
||||||
|
self.default_mediaref.add_source_reference(self.default_sourceref)
|
||||||
|
self.default_mediaref.add_attribute(self.default_attribute)
|
||||||
|
self.default_source.add_media_reference(self.default_mediaref)
|
||||||
|
self.db.commit_source(self.default_source, self.trans)
|
||||||
|
self.default_place = RelLib.Place()
|
||||||
|
self.default_place.set_title("TestcaseGenerator place")
|
||||||
|
self.default_place.set_note("Generated by TestcaseGenerator")
|
||||||
|
self.default_place.add_source_reference(self.default_sourceref)
|
||||||
|
self.default_place.add_media_reference(self.default_mediaref)
|
||||||
|
self.default_place.add_url(self.default_url)
|
||||||
|
self.db.add_place(self.default_place, self.trans)
|
||||||
|
|
||||||
if self.options.handler.options_dict['bugs']:
|
if self.options.handler.options_dict['bugs']:
|
||||||
self.generate_broken_relations()
|
self.generate_broken_relations()
|
||||||
@ -800,9 +822,20 @@ class TestcaseGenerator(Tool.Tool):
|
|||||||
object.add_media_reference(self.default_mediaref)
|
object.add_media_reference(self.default_mediaref)
|
||||||
e = RelLib.Event()
|
e = RelLib.Event()
|
||||||
e.set_name("TestcaseGenerator")
|
e.set_name("TestcaseGenerator")
|
||||||
|
e.set_note("Generated by TestcaseGenerator")
|
||||||
|
e.set_cause("Test cause")
|
||||||
|
e.set_description("Test description")
|
||||||
|
e.add_source_reference(self.default_sourceref)
|
||||||
|
e.add_media_reference(self.default_mediaref)
|
||||||
e.set_place_handle(self.default_place.get_handle())
|
e.set_place_handle(self.default_place.get_handle())
|
||||||
self.db.add_event(e, self.trans)
|
self.db.add_event(e, self.trans)
|
||||||
object.add_event_handle(e.get_handle())
|
object.add_event_handle(e.get_handle())
|
||||||
|
object.add_attribute( self.default_attribute)
|
||||||
|
try:
|
||||||
|
object.add_url(self.default_url)
|
||||||
|
except AttributeError:
|
||||||
|
pass # family does not have an url
|
||||||
|
object.set_note("Generated by TestcaseGenerator")
|
||||||
|
|
||||||
def commit_transaction(self):
|
def commit_transaction(self):
|
||||||
if self.options.handler.options_dict['no_trans']:
|
if self.options.handler.options_dict['no_trans']:
|
||||||
|
Loading…
Reference in New Issue
Block a user