Make get_modeman private again.
This commit is contained in:
parent
222627b08d
commit
bc54eb8671
@ -97,25 +97,25 @@ def init(win_id, parent):
|
||||
return modeman
|
||||
|
||||
|
||||
def get_modeman(win_id):
|
||||
def _get_modeman(win_id):
|
||||
"""Get a modemanager object."""
|
||||
return objreg.get('mode-manager', scope='window', window=win_id)
|
||||
|
||||
|
||||
def enter(win_id, mode, reason=None, only_if_normal=False):
|
||||
"""Enter the mode 'mode'."""
|
||||
get_modeman(win_id).enter(mode, reason, only_if_normal)
|
||||
_get_modeman(win_id).enter(mode, reason, only_if_normal)
|
||||
|
||||
|
||||
def leave(win_id, mode, reason=None):
|
||||
"""Leave the mode 'mode'."""
|
||||
get_modeman(win_id).leave(mode, reason)
|
||||
_get_modeman(win_id).leave(mode, reason)
|
||||
|
||||
|
||||
def maybe_leave(win_id, mode, reason=None):
|
||||
"""Convenience method to leave 'mode' without exceptions."""
|
||||
try:
|
||||
get_modeman(win_id).leave(mode, reason)
|
||||
_get_modeman(win_id).leave(mode, reason)
|
||||
except NotInModeError as e:
|
||||
# This is rather likely to happen, so we only log to debug log.
|
||||
log.modes.debug("{} (leave reason: {})".format(e, reason))
|
||||
|
Loading…
Reference in New Issue
Block a user