Rearrange some code

This commit is contained in:
Richard Chien 2019-01-25 18:51:42 +08:00
parent d88eda7c66
commit 78d48fb163

View File

@ -288,14 +288,6 @@ class CommandSession(BaseSession):
def is_first_run(self) -> bool:
return self._last_interaction is None
@property
def argv(self) -> List[str]:
"""
Shell-like argument list, similar to sys.argv.
Only available while shell_like is True in on_command decorator.
"""
return self.state.get('argv', [])
@property
def current_arg_text(self) -> str:
"""
@ -318,6 +310,14 @@ class CommandSession(BaseSession):
]
return self._current_arg_images
@property
def argv(self) -> List[str]:
"""
Shell-like argument list, similar to sys.argv.
Only available while shell_like is True in on_command decorator.
"""
return self.state.get('argv', [])
def refresh(self, ctx: Context_T, *, current_arg: str = '') -> None:
"""
Refill the session with a new message context.