def main(): #macros invoked from macros object_guid = request.arguments.get( "macros_id" ) if object_guid: from class_macro import Macros macros = Macros.get_by_guid( object_guid ) if macros: invoke_dispather( macros )
def main(): from class_macro import Macros #click on macros\plugiuns panel object_guid = request.arguments.get("id") if object_guid: if object_guid.find("_", 0) == 1: #parse guid prefix, object_guid = object_guid.split("_", 1) #check prefix value if prefix == "p": #it is plugin guid from widget_macros_datatable import WidgetMacrosDatatable widget_macro_table = WidgetMacrosDatatable( object_guid, self.name) widget_macro_table.render( self.dialog_plugin_macros.datatable,\ self.dialog_plugin_macros ) self.dialog_plugin_macros.show = "1" return elif prefix <> "m": raise Exception("Unknown GUID") #click from dialog_plugin_macros.datatable elif request.arguments.get("keyField"): object_guid = request.arguments.get("keyField") #macros invoked from macros elif request.arguments.get("macros_id"): object_guid = request.arguments.get("macros_id") else: raise Exception("Bad GUID") macros = Macros.get_by_guid(object_guid) if not macros: raise Exception("Bad GUID") invoke_dispather(macros)