aboutsummaryrefslogtreecommitdiffstats
path: root/modules/plugin-python/example
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-08-29 08:21:54 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-30 05:23:20 +0800
commit32f545cdf031ebe3718791f18e8fb6b6141fd081 (patch)
tree980723161c32da855ca91b135318d7fa67dc18c7 /modules/plugin-python/example
parente8382099228d46ebef684c5384bab6ec710283ce (diff)
downloadgsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.gz
gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.zst
gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.zip
Simplify EPlugin loading at startup.
- Require all EPlugin and EPluginHook subtypes be registered before loading plugins. This drastically simplifies the EPlugin/EPluginHook negotiation. - Turn most EPluginHook subtypes into GTypeModules and register their types from an e_module_load() function (does not include shell hooks). - Convert EPluginLib and the Mono and Python bindings to GTypeModules and register their types from an e_module_load() function, and kill EPluginTypeHook.
Diffstat (limited to 'modules/plugin-python/example')
-rw-r--r--modules/plugin-python/example/Makefile.am29
-rw-r--r--modules/plugin-python/example/hello_python.py5
-rw-r--r--modules/plugin-python/example/org-gnome-hello-python-ui.xml16
-rw-r--r--modules/plugin-python/example/org-gnome-hello-python.eplug.xml20
4 files changed, 70 insertions, 0 deletions
diff --git a/modules/plugin-python/example/Makefile.am b/modules/plugin-python/example/Makefile.am
new file mode 100644
index 0000000000..cc14dc94d9
--- /dev/null
+++ b/modules/plugin-python/example/Makefile.am
@@ -0,0 +1,29 @@
+AM_CPPFLAGS = \
+ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
+ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\"
+
+@EVO_PLUGIN_RULE@
+
+plugin_DATA = \
+ hello_python.py \
+ org-gnome-hello-python-ui.xml \
+ org-gnome-hello-python.eplug
+
+liborg_gnome_py_plug_test_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)
+
+errordir = $(privdatadir)/errors
+
+BUILDME = org-gnome-hello-python.eplug \
+$(error_i18n)
+
+BUILT_SOURCES = \
+ $(BUILDME)
+
+EXTRA_DIST = \
+ hello_python.py \
+ org-gnome-hello-python-ui.xml \
+ org-gnome-hello-python.eplug.xml
+
+CLEANFILES = $(BUILT_SOURCES)
+
+-include $(top_srcdir)/git.mk
diff --git a/modules/plugin-python/example/hello_python.py b/modules/plugin-python/example/hello_python.py
new file mode 100644
index 0000000000..16dc2a12f8
--- /dev/null
+++ b/modules/plugin-python/example/hello_python.py
@@ -0,0 +1,5 @@
+'''hello_python.py - Python source designed to '''
+'''demonstrate the use of python Eplugins'''
+
+def say_hello():
+ print 'Hello ! From python'
diff --git a/modules/plugin-python/example/org-gnome-hello-python-ui.xml b/modules/plugin-python/example/org-gnome-hello-python-ui.xml
new file mode 100644
index 0000000000..074960e84d
--- /dev/null
+++ b/modules/plugin-python/example/org-gnome-hello-python-ui.xml
@@ -0,0 +1,16 @@
+<Root>
+ <commands>
+ <cmd name="HelloPy" _label="Hello Python"
+ _tip="Python Plugin Loader tests"
+ />
+ </commands>
+
+ <menu>
+ <placeholder name="MessagePlaceholder">
+ <submenu name="Message">
+ <separator f="" name="sep"/>
+ <menuitem name="HelloPy" verb=""/>
+ </submenu>
+ </placeholder>
+ </menu>
+</Root>
diff --git a/modules/plugin-python/example/org-gnome-hello-python.eplug.xml b/modules/plugin-python/example/org-gnome-hello-python.eplug.xml
new file mode 100644
index 0000000000..8f77d5ba01
--- /dev/null
+++ b/modules/plugin-python/example/org-gnome-hello-python.eplug.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<e-plugin-list>
+ <e-plugin id="org.gnome.evolution.hello_python" type="python" _name="Python Test Plugin" location="@PLUGINDIR@" module_name="hello_python">
+
+ <author name="Johnny Jacob" email="jjohnny@novell.com"/>
+
+ <_description>
+ Test Plugin for Python EPlugin loader.
+ </_description>
+
+ <hook class="org.gnome.evolution.mail.bonobomenu:1.0">
+ <menu id="org.gnome.evolution.mail.browser" target="select">
+ <!-- the path to the bonobo menu description. Any UI items on Evolution should come here -->
+ <ui file="@PLUGINDIR@/org-gnome-hello-python-ui.xml"/>
+ <item type="item" verb="HelloPy" path="/commands/HelloPy" enable="one" activate="say_hello"/>
+ </menu>
+ </hook>
+
+ </e-plugin>
+</e-plugin-list>