Compare commits

..

No commits in common. "bd0f850d259742e24d59b93482110bf5c2a4027d" and "263c53bac5e1a7357a5e73f95e180a44b97c5971" have entirely different histories.

7 changed files with 4448 additions and 4314 deletions

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 809 KiB

After

Width:  |  Height:  |  Size: 812 KiB

View File

@ -1,4 +1,4 @@
.TH AHRIMAN "1" "2023\-07\-28" "ahriman" "Generated Python Manual"
.TH AHRIMAN "1" "2023\-07\-22" "ahriman" "Generated Python Manual"
.SH NAME
ahriman
.SH SYNOPSIS
@ -733,7 +733,7 @@ path to unix socket used for interprocess communications
.SH COMMAND \fI\,'ahriman service\-shell'\/\fR
usage: ahriman service\-shell [\-h] [code]
drop into python shell
drop into python shell while having created application
.TP
\fBcode\fR

View File

@ -58,9 +58,9 @@ _shtab_ahriman_commands() {
"service-config-validate:validate configuration and print found errors"
"service-key-import:import PGP key from public sources to the repository user"
"service-setup:create initial service configuration, requires root"
"service-shell:drop into python shell"
"service-shell:drop into python shell while having created application"
"setup:create initial service configuration, requires root"
"shell:drop into python shell"
"shell:drop into python shell while having created application"
"sign:(re-)sign packages and repository database according to current settings"
"status:request status of the package"
"status-update:update package status on the status page"

View File

@ -1,7 +1,7 @@
# Maintainer: Evgeniy Alekseev
pkgname='ahriman'
pkgver=2.10.1
pkgver=2.10.0
pkgrel=1
pkgdesc="ArcH linux ReposItory MANager"
arch=('any')

View File

@ -904,7 +904,8 @@ def _set_service_shell_parser(root: SubParserAction) -> argparse.ArgumentParser:
argparse.ArgumentParser: created argument parser
"""
parser = root.add_parser("service-shell", aliases=["shell"], help="invoke python shell",
description="drop into python shell", formatter_class=_formatter)
description="drop into python shell while having created application",
formatter_class=_formatter)
parser.add_argument("code", help="instead of dropping into shell, just execute the specified code", nargs="?")
parser.add_argument("-v", "--verbose", help=argparse.SUPPRESS, action="store_true")
parser.set_defaults(handler=handlers.Shell, lock=None, report=False)

View File

@ -23,6 +23,7 @@ import sys
from pathlib import Path
from ahriman.application.application import Application
from ahriman.application.handlers import Handler
from ahriman.core.configuration import Configuration
from ahriman.core.formatters import StringPrinter
@ -46,12 +47,14 @@ class Shell(Handler):
configuration(Configuration): configuration instance
report(bool): force enable or disable reporting
"""
# pylint: disable=possibly-unused-variable
application = Application(architecture, configuration, report=report)
if args.verbose:
# licensed by https://creativecommons.org/licenses/by-sa/3.0
path = Path(sys.prefix) / "share" / "ahriman" / "templates" / "shell"
StringPrinter(path.read_text(encoding="utf8")).print(verbose=False)
local_variables = {"architecture": architecture, "configuration": configuration}
# we only want to pass application instance inside
if args.code is None:
code.interact(local=local_variables)
code.interact(local={"application": application})
else:
code.InteractiveConsole(locals=local_variables).runcode(args.code)
code.InteractiveConsole(locals={"application": application}).runcode(args.code)

View File

@ -17,4 +17,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__version__ = "2.10.1"
__version__ = "2.10.0"