core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
This commit is contained in:
parent
2a40da1664
commit
005ec59a8a
25 changed files with 123 additions and 101 deletions
|
|
@ -18,6 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _, D_
|
||||
from sat.core.constants import Const as C
|
||||
from logging import debug, info, warning, error
|
||||
from twisted.words.protocols.jabber import jid
|
||||
from twisted.internet import defer, reactor
|
||||
|
|
@ -120,7 +121,7 @@ class AdHocDBus(object):
|
|||
return self.adHocDBusAddAuto(prog_name, allowed_jids, allowed_groups, allowed_magics, forbidden_jids, forbidden_groups, flags, profile_key)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def adHocDBusAddAuto(self, prog_name, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key='@NONE@'):
|
||||
def adHocDBusAddAuto(self, prog_name, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key=C.PROF_KEY_NONE):
|
||||
bus_names = yield self._DBusListNames()
|
||||
bus_names = [bus_name for bus_name in bus_names if '.' + prog_name in bus_name]
|
||||
if not bus_names:
|
||||
|
|
@ -149,7 +150,7 @@ class AdHocDBus(object):
|
|||
defer.returnValue((bus_name, methods))
|
||||
|
||||
|
||||
def _addCommand(self, adhoc_name, bus_name, methods, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key='@NONE@'):
|
||||
def _addCommand(self, adhoc_name, bus_name, methods, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key=C.PROF_KEY_NONE):
|
||||
if flags is None:
|
||||
flags = set()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue