| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | |
| 4 | # Libervia CLI |
| 5 | # Copyright (C) 2009-2026 Jérôme Poisson ([email protected]) |
| 6 | |
| 7 | # This program is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU Affero General Public License as published by |
| 9 | # the Free Software Foundation, either version 3 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU Affero General Public License for more details. |
| 16 | |
| 17 | # You should have received a copy of the GNU Affero General Public License |
| 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | |
| 21 | import cmdscip-python python python-stdlib 3.11 cmd/__init__: |
| 22 | import sysscip-python python python-stdlib 3.11 sys/__init__: |
| 23 | import shlexscip-python python python-stdlib 3.11 shlex/__init__: |
| 24 | import subprocessscip-python python python-stdlib 3.11 subprocess/__init__: |
| 25 | from . import basescip-python python libervia-backend 0.9.0.dev0 base/__init__: |
| 26 | from libervia.backend.core.i18nscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.i18n`/__init__: import _scip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.i18n`/_. |
| 27 | from libervia.backend.corescip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core`/__init__: import exceptionsscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.exceptions`/__init__: |
| 28 | from libervia.cli.constantsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/__init__: import Const as Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const# |
| 29 | from libervia.cliscip-python python libervia-backend 0.9.0.dev0 `libervia.cli`/__init__: import arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__: |
| 30 | from libervia.backend.tools.common.ansiscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/__init__: import ANSI as Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI# |
| 31 | |
| 32 | __commands__scip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/__commands__. = ["Shell"] |
| 33 | INTROscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/INTRO. = _("""Welcome to {app_name} shell, the Salut à Toi shell ! |
| 34 | |
| 35 | This enrironment helps you using several {app_name} commands with similar parameters. |
| 36 | |
| 37 | To quit, just enter "quit" or press C-d. |
| 38 | Enter "help" or "?" to know what to do |
| 39 | """).format(app_name=Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.APP_NAMEscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#APP_NAME.) |
| 40 | |
| 41 | |
| 42 | class Shellscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#(basescip-python python libervia-backend 0.9.0.dev0 base/__init__:.CommandBasescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#, cmdscip-python python python-stdlib 3.11 cmd/__init__:.Cmdscip-python python python-stdlib 3.11 cmd/Cmd#): |
| 43 | def __init__scip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(self), hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(host)): |
| 44 | basescip-python python libervia-backend 0.9.0.dev0 base/__init__:.CommandBasescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#.__init__scip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#__init__().( |
| 45 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(self), hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(host), "shell", helpscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#__init__().(help)=_("launch libervia-cli in shell (REPL) mode") |
| 46 | ) |
| 47 | cmdscip-python python python-stdlib 3.11 cmd/__init__:.Cmdscip-python python python-stdlib 3.11 cmd/Cmd#.__init__scip-python python python-stdlib 3.11 cmd/Cmd#__init__().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#__init__().(self)) |
| 48 | |
| 49 | def parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(args)): |
| 50 | """parse line arguments""" |
| 51 | return shlexscip-python python python-stdlib 3.11 shlex/__init__:.splitscip-python python python-stdlib 3.11 shlex/split().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(args), posixscip-python python python-stdlib 3.11 shlex/split().(posix)=True) |
| 52 | |
| 53 | def update_pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)): |
| 54 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#host..parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/LiberviaCli#parser. |
| 55 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).helpscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#help. = "" |
| 56 | for idx, path_elt in enumeratescip-python python python-stdlib 3.11 builtins/enumerate#(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path.): |
| 57 | try: |
| 58 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser. = arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.get_cmd_choicesscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_cmd_choices().(path_elt, selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser.) |
| 59 | except exceptionsscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.exceptions`/__init__:.NotFoundscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.exceptions`/NotFound#: |
| 60 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(_("bad command path"), errorscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(error)=True) |
| 61 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path.[:idx] |
| 62 | break |
| 63 | else: |
| 64 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).helpscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#help. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser. |
| 65 | |
| 66 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).promptscip-python python python-stdlib 3.11 cmd/Cmd#prompt. = Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().(Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_PROMPT_PATHscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_PROMPT_PATH., "/".joinscip-python python python-stdlib 3.11 builtins/str#join().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path.)) + Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().( |
| 67 | Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_PROMPT_SUFscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_PROMPT_SUF., "> " |
| 68 | ) |
| 69 | try: |
| 70 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).actionsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#actions. = listscip-python python python-stdlib 3.11 builtins/list#(arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.get_cmd_choicesscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_cmd_choices().(parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_cmd_choices().(parser)=selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser.).keys()) |
| 71 | except exceptionsscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.exceptions`/__init__:.NotFoundscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.exceptions`/NotFound#: |
| 72 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().(self).actionsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#actions. = [] |
| 73 | |
| 74 | def add_parser_optionsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#add_parser_options().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#add_parser_options().(self)): |
| 75 | pass |
| 76 | |
| 77 | def format_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#format_args().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#format_args().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#format_args().(args)): |
| 78 | """format argument to be printed with quotes if needed""" |
| 79 | for arg in argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#format_args().(args): |
| 80 | if " " in arg: |
| 81 | yield arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.escapescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/escape().(arg) |
| 82 | else: |
| 83 | yield arg |
| 84 | |
| 85 | def run_cmdscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(args), externalscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(external)=False): |
| 86 | """run command and retur exit code |
| 87 | |
| 88 | @param args[list[string]]: arguments of the command |
| 89 | must not include program name |
| 90 | @param external(bool): True if it's an external command (i.e. not libervia-cli) |
| 91 | @return (int): exit code (0 success, any other int failure) |
| 92 | """ |
| 93 | # FIXME: we have to use subprocess |
| 94 | # and relaunch whole python for now |
| 95 | # because if host.quit() is called in D-Bus callback |
| 96 | # GLib quit the whole app without possibility to stop it |
| 97 | # didn't found a nice way to work around it so far |
| 98 | # Situation should be better when we'll move away from python-dbus |
| 99 | if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose.: |
| 100 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 101 | _("COMMAND {external}=> {args}").format( |
| 102 | external=_("(external) ") if externalscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(external) else "", |
| 103 | argsscip-python python python-stdlib 3.11 builtins/str#format().(args)=" ".joinscip-python python python-stdlib 3.11 builtins/str#join().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(self).format_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#format_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(args))), |
| 104 | ) |
| 105 | ) |
| 106 | if not externalscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(external): |
| 107 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(args) = sysscip-python python python-stdlib 3.11 sys/__init__:.argvscip-python python python-stdlib 3.11 sys/argv.argv.[0:1] + argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(args) |
| 108 | ret_code = subprocessscip-python python python-stdlib 3.11 subprocess/__init__:.callscip-python python python-stdlib 3.11 subprocess/call().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(args)) |
| 109 | # XXX: below is a way to launch the command without creating a new process |
| 110 | # may be used when a solution to the aforementioned issue is there |
| 111 | # try: |
| 112 | # self.host._run(args) |
| 113 | # except SystemExit as e: |
| 114 | # ret_code = e.code |
| 115 | # except Exception as e: |
| 116 | # self.disp(A.color(C.A_FAILURE, u'command failed with an exception: {msg}'.format(msg=e)), error=True) |
| 117 | # ret_code = 1 |
| 118 | # else: |
| 119 | # ret_code = 0 |
| 120 | |
| 121 | if ret_code != 0: |
| 122 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 123 | Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().( |
| 124 | Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_FAILUREscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_FAILURE., |
| 125 | "command failed with an error code of {err_no}".format( |
| 126 | err_no=ret_code |
| 127 | ), |
| 128 | ), |
| 129 | errorscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(error)=True, |
| 130 | ) |
| 131 | return ret_code |
| 132 | |
| 133 | def defaultscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(args)): |
| 134 | """called when no shell command is recognized |
| 135 | |
| 136 | will launch the command with args on the line |
| 137 | (i.e. will launch do [args]) |
| 138 | """ |
| 139 | if argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(args) == "EOF": |
| 140 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(self).do_quitscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().("") |
| 141 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(self).do_doscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#default().(args)) |
| 142 | |
| 143 | def do_helpscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(args)): |
| 144 | """show help message""" |
| 145 | if not argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(args): |
| 146 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().(Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_HEADERscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_HEADER., _("Shell commands:")), endscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(end)=" ") |
| 147 | superscip-python python python-stdlib 3.11 builtins/super#(Shellscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#, selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self)).do_helpscip-python python python-stdlib 3.11 cmd/Cmd#do_help().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(args)) |
| 148 | if not argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(args): |
| 149 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().(Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_HEADERscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_HEADER., _("Action commands:"))) |
| 150 | help_list = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser..format_helpscip-python python python-stdlib 3.11 argparse/ArgumentParser#format_help().().splitscip-python python python-stdlib 3.11 builtins/str#split().("\n\n") |
| 151 | printscip-python python python-stdlib 3.11 builtins/print().(("\n\n".joinscip-python python python-stdlib 3.11 builtins/str#join().(help_list[1 if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_help().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. else 2 :]))) |
| 152 | |
| 153 | # FIXME: debug crashes on exit and is not that useful, |
| 154 | # keeping it until refactoring, may be removed entirely then |
| 155 | # def do_debug(self, args): |
| 156 | # """launch internal debugger""" |
| 157 | # try: |
| 158 | # import ipdb as pdb |
| 159 | # except ImportError: |
| 160 | # import pdb |
| 161 | # pdb.set_trace() |
| 162 | |
| 163 | def do_verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(args)): |
| 164 | """show verbose mode, or (de)activate it""" |
| 165 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(args) = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(self).parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(args)) |
| 166 | if argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(args): |
| 167 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose. = Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.boolscip-python python python-stdlib 3.11 builtins/bool#(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(args)[0]) |
| 168 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 169 | _("verbose mode is {status}").format( |
| 170 | status=_("ENABLED") if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_verbose().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose. else _("DISABLED") |
| 171 | ) |
| 172 | ) |
| 173 | |
| 174 | def do_cmdscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args)): |
| 175 | """change command path""" |
| 176 | if argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args) == "..": |
| 177 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path.[:-1] |
| 178 | else: |
| 179 | if not argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args) or argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args)[0] == "/": |
| 180 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. = [] |
| 181 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args) = "/".joinscip-python python python-stdlib 3.11 builtins/str#join().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args).split()) |
| 182 | for path_elt in argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(args).splitscip-python python python-stdlib 3.11 builtins/str#split().("/"): |
| 183 | path_elt = path_elt.stripscip-python python python-stdlib 3.11 builtins/str#strip().() |
| 184 | if not path_elt: |
| 185 | continue |
| 186 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path..appendscip-python python python-stdlib 3.11 builtins/list#append().(path_elt) |
| 187 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_cmd().(self).update_pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().() |
| 188 | |
| 189 | def do_versionscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_version().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_version().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_version().(args)): |
| 190 | """show current backend/CLI version""" |
| 191 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_version().(self).run_cmdscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(["--version"]) |
| 192 | |
| 193 | def do_shellscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(args)): |
| 194 | """launch an external command (you can use ![command] too)""" |
| 195 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(args) = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(self).parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(args)) |
| 196 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(self).run_cmdscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_shell().(args), externalscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(external)=True) |
| 197 | |
| 198 | def do_doscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args)): |
| 199 | """lauch a command""" |
| 200 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args) = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args)) |
| 201 | if ( |
| 202 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self)._not_default_profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_not_default_profile. |
| 203 | and not "-p" in argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args) |
| 204 | and not "--profile" in argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args) |
| 205 | and not "profile" in selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use. |
| 206 | ): |
| 207 | # profile is not specified and we are not using the default profile |
| 208 | # so we need to add it in arguments to use current user profile |
| 209 | if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose.: |
| 210 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 211 | _("arg profile={profile} (logged profile)").format( |
| 212 | profile=selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#profile(). |
| 213 | ) |
| 214 | ) |
| 215 | use = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use..copyscip-python python python-stdlib 3.11 builtins/dict#copy().() |
| 216 | use["profile"] = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#profile(). |
| 217 | else: |
| 218 | use = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use. |
| 219 | |
| 220 | # args may be modified by use_args |
| 221 | # to remove subparsers from it |
| 222 | parser_args, use_args = arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.get_use_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_use_args().( |
| 223 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#host., argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(args), use, verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_use_args().(verbose)=selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose., parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/get_use_args().(parser)=selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser. |
| 224 | ) |
| 225 | cmd_args = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. + parser_args + use_args |
| 226 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_do().(self).run_cmdscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#run_cmd().(cmd_args) |
| 227 | |
| 228 | def do_usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)): |
| 229 | """fix an argument""" |
| 230 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args) = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)) |
| 231 | if not argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args): |
| 232 | if not selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use.: |
| 233 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(_("no argument in USE")) |
| 234 | else: |
| 235 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(_("arguments in USE:")) |
| 236 | for arg, value in selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use..itemsscip-python python python-stdlib 3.11 builtins/dict#items().(): |
| 237 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 238 | _( |
| 239 | Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().( |
| 240 | Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_SUBHEADERscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_SUBHEADER., |
| 241 | arg, |
| 242 | Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.RESETscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#RESET., |
| 243 | " = ", |
| 244 | arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.escapescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/escape().(value), |
| 245 | ) |
| 246 | ) |
| 247 | ) |
| 248 | elif len(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)) != 2: |
| 249 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().("bad syntax, please use:\nuse [arg] [value]", errorscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(error)=True) |
| 250 | else: |
| 251 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use.[argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)[0]] = " ".joinscip-python python python-stdlib 3.11 builtins/str#join().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)[1:]) |
| 252 | if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose.: |
| 253 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 254 | "set {name} = {value}".format( |
| 255 | name=argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)[0], value=arg_toolsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/__init__:.escapescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.arg_tools`/escape().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use().(args)[1]) |
| 256 | ) |
| 257 | ) |
| 258 | |
| 259 | def do_use_clearscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(args)): |
| 260 | """unset one or many argument(s) in USE, or all of them if no arg is specified""" |
| 261 | argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(args) = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).parse_argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#parse_args().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(args)) |
| 262 | if not argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(args): |
| 263 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use..clearscip-python python python-stdlib 3.11 typing/MutableMapping#clear().() |
| 264 | else: |
| 265 | for arg in argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(args): |
| 266 | try: |
| 267 | del selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use.[arg] |
| 268 | except KeyErrorscip-python python python-stdlib 3.11 builtins/KeyError#: |
| 269 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().( |
| 270 | Ascip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#.colorscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.tools.common.ansi`/ANSI#color().( |
| 271 | Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.A_FAILUREscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#A_FAILURE., _("argument {name} not found").format(name=arg) |
| 272 | ), |
| 273 | errorscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(error)=True, |
| 274 | ) |
| 275 | else: |
| 276 | if selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose.: |
| 277 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_use_clear().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(_("argument {name} removed").format(name=arg)) |
| 278 | |
| 279 | def do_whoamiscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_whoami().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_whoami().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_whoami().(args)): |
| 280 | """print profile currently used""" |
| 281 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_whoami().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_whoami().(self).profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#profile().) |
| 282 | |
| 283 | def do_quitscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(args)): |
| 284 | """quit the shell""" |
| 285 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(self).dispscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#disp().(_("good bye!")) |
| 286 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(self).hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#host..quitscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/LiberviaCli#quit().() |
| 287 | |
| 288 | def do_exitscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_exit().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_exit().(self), argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_exit().(args)): |
| 289 | """alias for quit""" |
| 290 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_exit().(self).do_quitscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_quit().(argsscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#do_exit().(args)) |
| 291 | |
| 292 | async def startscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self)): |
| 293 | # FIXME: "shell" is currently kept synchronous as it works well as it |
| 294 | # and it will be refactored soon. |
| 295 | default_profile = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#host..bridgescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/LiberviaCli#bridge..profile_name_get(Cscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.constants`/Const#.PROF_KEY_DEFAULTscip-python python libervia-backend 0.9.0.dev0 `libervia.backend.core.constants`/Const#PROF_KEY_DEFAULT.) |
| 296 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self)._not_default_profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_not_default_profile. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).profilescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#profile(). != default_profile |
| 297 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#path. = [] |
| 298 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self)._cur_parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#_cur_parser. = selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).hostscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/CommandBase#host..parserscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.base`/LiberviaCli#parser. |
| 299 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).usescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#use. = {} |
| 300 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).verbosescip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#verbose. = False |
| 301 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).update_pathscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#update_path().() |
| 302 | selfscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/Shell#start().(self).cmdloopscip-python python python-stdlib 3.11 cmd/Cmd#cmdloop().(INTROscip-python python libervia-backend 0.9.0.dev0 `libervia.cli.cmd_shell`/INTRO.) |