Mercurial > libervia-web
diff src/browser/sat_browser/base_menu.py @ 632:c2abadf31afb frontends_multi_profiles
browser side (menu): minor improvments:
- use of new style class for MenuCmd and PluginMenuCmd (useless for pyjamas, but can be useful in the future)
- use of try/except instead of hasattr
- do not use "None" for WidgetMenuBar's __init__
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 23 Feb 2015 18:43:08 +0100 |
parents | a5019e62c3e9 |
children | 6d3142b782c3 |
line wrap: on
line diff
--- a/src/browser/sat_browser/base_menu.py Mon Feb 23 18:20:04 2015 +0100 +++ b/src/browser/sat_browser/base_menu.py Mon Feb 23 18:43:08 2015 +0100 @@ -37,7 +37,7 @@ import re -class MenuCmd: +class MenuCmd(object): """Return an object with an "execute" method that can be set to a menu item callback""" def __init__(self, object_, handler=None, data=None): @@ -58,7 +58,7 @@ self.callback(self.data) if self.data else self.callback() -class PluginMenuCmd: +class PluginMenuCmd(object): """Like MenuCmd, but instead of executing a method, it will command the bridge to launch an action""" def __init__(self, host, action_id, menu_data=None):