evolution r35627 - in trunk/plugins/python: . example



Author: jjohnny
Date: Wed Jun 11 21:22:15 2008
New Revision: 35627
URL: http://svn.gnome.org/viewvc/evolution?rev=35627&view=rev

Log:
A simple example python plugin - just hook onto events.


Added:
   trunk/plugins/python/example/
   trunk/plugins/python/example/Makefile.am
   trunk/plugins/python/example/hello_python.py
   trunk/plugins/python/example/org-gnome-hello-python-ui.xml
   trunk/plugins/python/example/org-gnome-hello-python.eplug.xml
Modified:
   trunk/plugins/python/ChangeLog

Added: trunk/plugins/python/example/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plugins/python/example/Makefile.am	Wed Jun 11 21:22:15 2008
@@ -0,0 +1,30 @@
+INCLUDES =						\
+	-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_LIBADD=			\
+	$(NO_UNDEFINED_REQUIRED_LIBS)		
+
+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)

Added: trunk/plugins/python/example/hello_python.py
==============================================================================
--- (empty file)
+++ trunk/plugins/python/example/hello_python.py	Wed Jun 11 21:22:15 2008
@@ -0,0 +1,5 @@
+'''hello_python.py - Python source designed to '''
+'''demonstrate the use of python Eplugins'''
+
+def say_hello():
+    print 'Hello ! From python'

Added: trunk/plugins/python/example/org-gnome-hello-python-ui.xml
==============================================================================
--- (empty file)
+++ trunk/plugins/python/example/org-gnome-hello-python-ui.xml	Wed Jun 11 21:22:15 2008
@@ -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>

Added: trunk/plugins/python/example/org-gnome-hello-python.eplug.xml
==============================================================================
--- (empty file)
+++ trunk/plugins/python/example/org-gnome-hello-python.eplug.xml	Wed Jun 11 21:22:15 2008
@@ -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>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]