4 class SamplePython(rb
.Plugin
):
7 rb
.Plugin
.__init
__(self
)
9 def activate(self
, shell
):
10 print "activating sample python plugin"
12 db
= shell
.get_property("db")
13 model
= db
.query_model_new_empty()
14 self
.source
= gobject
.new (PythonSource
, shell
=shell
, name
=_("Python Source"), query_model
=model
)
15 shell
.append_source(self
.source
, None)
17 def deactivate(self
, shell
):
18 print "deactivating sample python plugin"
19 self
.source
.delete_thyself()
23 class PythonSource(rb
.Source
):
25 rb
.Source
.__init
__(self
)
27 gobject
.type_register(PythonSource
)