Mercurial > libervia-backend
diff sat/core/sat_main.py @ 2810:c161a294fffd
core: added a base menu allowing to set encryption session or show the trust management UI.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 24 Feb 2019 14:11:08 +0100 |
parents | 034c88e9cd93 |
children | 5ba98fd6c9a4 |
line wrap: on
line diff
--- a/sat/core/sat_main.py Sun Feb 24 14:09:44 2019 +0100 +++ b/sat/core/sat_main.py Sun Feb 24 14:11:08 2019 +0100 @@ -17,6 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +from glob import glob +import sys +import os.path +import uuid import sat from sat.core.i18n import _, languageSwitch from sat.core import patches @@ -30,7 +34,6 @@ from sat.core import exceptions from sat.core.log import getLogger -log = getLogger(__name__) from sat.core.constants import Const as C from sat.memory import memory from sat.memory import cache @@ -41,10 +44,6 @@ from sat.tools.common import regex from sat.stdui import ui_contact_list, ui_profile_manager import sat.plugins -from glob import glob -import sys -import os.path -import uuid try: @@ -52,6 +51,7 @@ except ImportError: from ordereddict import OrderedDict +log = getLogger(__name__) class SAT(service.Service): def __init__(self): @@ -206,9 +206,14 @@ ) ) sys.exit(1) + self._addBaseMenus() self.initialised.callback(None) log.info(_(u"Backend is ready")) + def _addBaseMenus(self): + """Add base menus""" + encryption.EncryptionHandler._importMenus(self) + def _unimport_plugin(self, plugin_path): """remove a plugin from sys.modules if it is there""" try: @@ -932,7 +937,7 @@ d_list = defer.DeferredList(d_list) # XXX: 10 seconds may be too low for slow connections (e.g. mobiles) # but for discovery, that's also the time the user will wait the first time - # before seing the page. + # before seing the page, if something goes wrong. d_list.addTimeout(10, reactor) infos_data = yield d_list @@ -1188,14 +1193,8 @@ """ return tuple((p.lower().strip() for p in path)) - def importMenu( - self, - path, - callback, - security_limit=C.NO_SECURITY_LIMIT, - help_string="", - type_=C.MENU_GLOBAL, - ): + def importMenu(self, path, callback, security_limit=C.NO_SECURITY_LIMIT, + help_string="", type_=C.MENU_GLOBAL): """register a new menu for frontends @param path(iterable[unicode]): path to go to the menu