jan: thuban/Examples/simple_extensions hello_world.py,1.1,1.2

cvs@intevation.de cvs at intevation.de
Sun May 16 11:45:07 CEST 2004


Author: jan

Update of /thubanrepository/thuban/Examples/simple_extensions
In directory doto:/tmp/cvs-serv16273

Modified Files:
	hello_world.py 
Log Message:
 Use FindOrInsertMenu() instead of finding menu on its own.


Index: hello_world.py
===================================================================
RCS file: /thubanrepository/thuban/Examples/simple_extensions/hello_world.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hello_world.py	19 Aug 2003 10:44:56 -0000	1.1
+++ hello_world.py	16 May 2004 09:45:05 -0000	1.2
@@ -36,9 +36,7 @@
                      helptext = _('Welcome everyone on this planet')))
 
 # find the extensions menu (create it anew if not found)
-extensions_menu = main_menu.find_menu('extensions')
-if extensions_menu is None:
-    extensions_menu = main_menu.InsertMenu('extensions', _('E&xtensions'))
+extensions_menu = main_menu.FindOrInsertMenu('extensions', _('E&xtensions'))
 
 # finally bind the new command with an entry in the extensions menu
 extensions_menu.InsertItem('hello_world')





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)