Bug #47117 Python scripts fail to load / display in the plugins menu.
Submitted: 4 Sep 2009 1:14 Modified: 15 Jan 2010 16:21
Reporter: Ryan Taylor Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1.17 OSS OS:Windows (SP3)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: python module plugin

[4 Sep 2009 1:14] Ryan Taylor
Description:
Custom python modules fail to load in MySQL Workbench 5.1.17 OSS and SE. On my system I have python 2.1, 2.4, and 2.5 installed. Python 2.4 and 2.5 appear in my PATH environment variable with 2.5 listed first.

Additionally, I cannot run a python script. However, I can execute single line python commands from the GRT (e.g. print "hello").

How to repeat:
1. Create a minimal python module like so:

# start code
from wb import *
import grt

ModuleInfo = DefineModule(name="myutils", author="rtaylor", version="1.0")

@wbplugin("wb.catalog.util.createGeodatabase", caption="CreateGeodatabase", input=[wbinputs.currentCatalog()], pluginMenu="Catalog")
@wbexport(grt.INT, grt.classes.db_Catalog)
def createGeodatabase(catalog):
  print "Hello World"
  return 0
# end code

2. Copy python file to "C:\Documents and Settings\<username>\Application Data\MySQL\Workbench\modules"
3. Launch MySQL Workbench
[6 Jan 2010 15:09] Alfredo Kojima
In WB 5.1 a bug in the implementation prevented more than 1 Python plugin file to be recognized.
In 5.2, the Python module declaration method has changed. Once the provided test script is
updated to the new syntax (@ModuleInfo.plugin instead of @wbplugin) it properly shows in the menus.
[13 Jan 2010 17:34] Johannes Taxacher
fixed already in 5.2 (scripts from 5.1 need to be changed like mentioned by developer in previous comment)
[15 Jan 2010 16:21] Tony Bedford
An entry has been added to the 5.2.12 changelog:

Custom Python modules failed to load and were not displayed in the MySQL Workbench Plugins menu.

In MySQL Workbench 5.2 the syntax used has changed from @wbplugin to @ModuleInfo.Plugin.