Git commit bfd8e7d51681322b618bb76f60f8de0e995aed1f by Shaheed Haque. Committed on 30/11/2012 at 21:45. Pushed by shaheed into branch 'master'. Restore genration of Actions help M +16 -16 kate/plugins/pate/src/kate/__init__.py http://commits.kde.org/kate/bfd8e7d51681322b618bb76f60f8de0e995aed1f diff --git a/kate/plugins/pate/src/kate/__init__.py b/kate/plugins/pate/src= /kate/__init__.py index 0706189..1d52851 100644 --- a/kate/plugins/pate/src/kate/__init__.py +++ b/kate/plugins/pate/src/kate/__init__.py @@ -183,7 +183,7 @@ def moduleGetActions(module): = The returned object is [ { function, ( text, icon, shortcut, menu ) }.= .. ]. """ - functionsList =3D [o for o in getmembers(module) if isfunction(o[1])] + functionsList =3D [o for o in getmembers(module) if isinstance(o[1], k= ate.catchAllHandler)] actionsList =3D [(n, _moduleActionDecompile(o.__dict__['action'])) for= (n, o) in functionsList if 'action' in o.__dict__] return actionsList = @@ -258,6 +258,21 @@ class _HandledException(Exception): def __init__(self, message): super(_HandledException, self).__init__(message) = +class catchAllHandler(object): + '''Standard error handling for plugin actions.''' + def __init__(self, f): + self.f =3D f + + def __call__(self): + try: + return self.f() + except _HandledException: + raise + except Exception as e: + txt =3D "".join(traceback.format_exception(*sys.exc_info())) + KMessageBox.error(None, txt, i18n("Error in action '{}'").form= at(self.f.__name__)) + raise _HandledException(txt) + @_attribute(actions=3Dset()) def action(text, icon=3DNone, shortcut=3DNone, menu=3DNone): ''' Decorator that adds an action to the menu bar. When the item is fi= red, @@ -283,21 +298,6 @@ def action(text, icon=3DNone, shortcut=3DNone, menu=3D= None): NOTE: Kate may need to be restarted for this decorator to take effect,= or to remove all traces of the plugin on removal. ''' - class catchAllHandler(object): - '''Standard error handling for plugin actions.''' - def __init__(self, f): - self.f =3D f - - def __call__(self): - try: - return self.f() - except _HandledException: - raise - except Exception as e: - txt =3D "".join(traceback.format_exception(*sys.exc_info()= )) - KMessageBox.error(None, txt, i18n("Error in action '{}'").= format(self.f.__name__)) - raise _HandledException(txt) - def decorator(func): a =3D kdeui.KAction(text, None) if shortcut is not None: