diff src/core/sat_main.py @ 914:1a3ba959f0ab

core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
author Goffi <goffi@goffi.org>
date Fri, 21 Mar 2014 16:08:11 +0100
parents fab49a1d5ea2
children 1a759096ccbd
line wrap: on
line diff
--- a/src/core/sat_main.py	Fri Mar 21 15:36:01 2014 +0100
+++ b/src/core/sat_main.py	Fri Mar 21 16:08:11 2014 +0100
@@ -39,7 +39,8 @@
 from sat.core.default_config import CONST
 from sat.core import xmpp
 from sat.core import exceptions
-from sat.memory.memory import Memory, NO_SECURITY_LIMIT
+from sat.core.constants import Const as C
+from sat.memory.memory import Memory
 from sat.tools.xml_tools import tupleList2dataForm
 from sat.tools.misc import TriggerManager
 from glob import glob
@@ -897,7 +898,7 @@
 
     #Menus management
 
-    def importMenu(self, path, callback, security_limit=NO_SECURITY_LIMIT, help_string="", type_="NORMAL"):
+    def importMenu(self, path, callback, security_limit=C.NO_SECURITY_LIMIT, help_string="", type_="NORMAL"):
         """register a new menu for frontends
         @param path: path to go to the menu (category/subcategory/.../item), must be an iterable (e.g.: ("File", "Open"))
             /!\ use D_() instead of _() for translations (e.g. (D_("File"), D_("Open")))
@@ -942,7 +943,7 @@
 
         return callback_id
 
-    def getMenus(self, language='', security_limit=NO_SECURITY_LIMIT):
+    def getMenus(self, language='', security_limit=C.NO_SECURITY_LIMIT):
         """Return all menus registered
         @param language: language used for translation, or empty string for default
         @param security_limit: %(doc_security_limit)s
@@ -958,7 +959,7 @@
             type_ = menu_data['type']
             path = menu_data['path']
             menu_security_limit = menu_data['security_limit']
-            if security_limit!=NO_SECURITY_LIMIT and (menu_security_limit==NO_SECURITY_LIMIT or menu_security_limit>security_limit):
+            if security_limit!=C.NO_SECURITY_LIMIT and (menu_security_limit==C.NO_SECURITY_LIMIT or menu_security_limit>security_limit):
                 continue
             languageSwitch(language)
             path_i18n = [_(elt) for elt in path]