Mercurial > libervia-web
comparison browser_side/menu.py @ 377:603fa314880e
browser side: fixed bad variable reference in menus management
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Feb 2014 09:42:52 +0100 |
parents | 30d03d9f07e4 |
children | 933bce4cb816 |
comparison
equal
deleted
inserted
replaced
376:ab923b870fb0 | 377:603fa314880e |
---|---|
177 # additional menus | 177 # additional menus |
178 for action_id, type_, path, path_i18n in add_menus: | 178 for action_id, type_, path, path_i18n in add_menus: |
179 if not path: | 179 if not path: |
180 print "WARNING: skipping menu without path" | 180 print "WARNING: skipping menu without path" |
181 continue | 181 continue |
182 if len(path) != len(path_i18n): | |
183 print "ERROR: inconsistency between menu paths" | |
184 continue | |
182 menu_name = path[0] | 185 menu_name = path[0] |
183 menu_name_i18n = path_i18n[0] | 186 menu_name_i18n = path_i18n[0] |
184 item_name_i18n = ' | '.join(path_i18n[1:]) | 187 item_name = path[1:] |
185 if not item_name: | 188 if not item_name: |
186 print "WARNING: skipping menu with a path of lenght 1 [%s]" % path[0] | 189 print "WARNING: skipping menu with a path of lenght 1 [%s]" % path[0] |
187 continue | 190 continue |
191 item_name_i18n = ' | '.join(path_i18n[1:]) | |
188 addMenu(menu_name, menu_name_i18n, item_name_i18n, 'plugins', PluginMenuCmd(self.host, action_id)) | 192 addMenu(menu_name, menu_name_i18n, item_name_i18n, 'plugins', PluginMenuCmd(self.host, action_id)) |
189 | 193 |
190 menus_order.append(None) # we add separator | 194 menus_order.append(None) # we add separator |
191 | 195 |
192 addMenu("Help", _("Help"), _("Social contract"), 'help', MenuCmd(self, "onSocialContract")) | 196 addMenu("Help", _("Help"), _("Social contract"), 'help', MenuCmd(self, "onSocialContract")) |