Changes

Jump to: navigation, search

Gramplets

16 bytes added, 23 August
m
Hello World, with Class: Tested & recorrected the "5.0" target version that was a problem. Added a Spanish source so we'll have an example for English translators of non-English gramplets
== Hello World, with Class ==
Here is the same functionality again, but this time as a class(and the text in Spanish):
<pre>
# File: HelloWorld2HolaMundo.py
from gramps.gen.plug import Gramplet
class HelloWorldGrampletHolaMundoGramplet(Gramplet):
def init(self):
self.set_text("Hello world¡Hola Mundo!")
</pre>
<pre># File: HelloWorld2HolaMundo.gpr.py
register(GRAMPLET,
id="Hello World2 Hola Mundo Gramplet", name=_("Hello World2 Hola Mundo Gramplet"), description = _("a program that says un programa que dice 'Hello WorldHola Mundo'"),
version="0.0.1",
gramps_target_version="5.01",
status = STABLE,
fname="HelloWorld2HolaMundo.py",
height = 20,
gramplet = 'HelloWorldGramplet',
gramplet_title=_("Sample Muestra Gramplet"), help_url="Sample Muestra Gramplet" )</pre>
This is the '''recommended method''' of creating a Gramplet. The following details describe the properties and methods of this class.
1,872
edits

Navigation menu