mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-30 18:27:18 +00:00
Compare commits
2 Commits
263c53bac5
...
bd0f850d25
Author | SHA1 | Date | |
---|---|---|---|
bd0f850d25 | |||
5904727da2 |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 812 KiB After Width: | Height: | Size: 809 KiB |
@ -1,4 +1,4 @@
|
|||||||
.TH AHRIMAN "1" "2023\-07\-22" "ahriman" "Generated Python Manual"
|
.TH AHRIMAN "1" "2023\-07\-28" "ahriman" "Generated Python Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ahriman
|
ahriman
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -733,7 +733,7 @@ path to unix socket used for interprocess communications
|
|||||||
.SH COMMAND \fI\,'ahriman service\-shell'\/\fR
|
.SH COMMAND \fI\,'ahriman service\-shell'\/\fR
|
||||||
usage: ahriman service\-shell [\-h] [code]
|
usage: ahriman service\-shell [\-h] [code]
|
||||||
|
|
||||||
drop into python shell while having created application
|
drop into python shell
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fBcode\fR
|
\fBcode\fR
|
||||||
|
@ -58,9 +58,9 @@ _shtab_ahriman_commands() {
|
|||||||
"service-config-validate:validate configuration and print found errors"
|
"service-config-validate:validate configuration and print found errors"
|
||||||
"service-key-import:import PGP key from public sources to the repository user"
|
"service-key-import:import PGP key from public sources to the repository user"
|
||||||
"service-setup:create initial service configuration, requires root"
|
"service-setup:create initial service configuration, requires root"
|
||||||
"service-shell:drop into python shell while having created application"
|
"service-shell:drop into python shell"
|
||||||
"setup:create initial service configuration, requires root"
|
"setup:create initial service configuration, requires root"
|
||||||
"shell:drop into python shell while having created application"
|
"shell:drop into python shell"
|
||||||
"sign:(re-)sign packages and repository database according to current settings"
|
"sign:(re-)sign packages and repository database according to current settings"
|
||||||
"status:request status of the package"
|
"status:request status of the package"
|
||||||
"status-update:update package status on the status page"
|
"status-update:update package status on the status page"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Evgeniy Alekseev
|
# Maintainer: Evgeniy Alekseev
|
||||||
|
|
||||||
pkgname='ahriman'
|
pkgname='ahriman'
|
||||||
pkgver=2.10.0
|
pkgver=2.10.1
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="ArcH linux ReposItory MANager"
|
pkgdesc="ArcH linux ReposItory MANager"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
@ -904,8 +904,7 @@ def _set_service_shell_parser(root: SubParserAction) -> argparse.ArgumentParser:
|
|||||||
argparse.ArgumentParser: created argument parser
|
argparse.ArgumentParser: created argument parser
|
||||||
"""
|
"""
|
||||||
parser = root.add_parser("service-shell", aliases=["shell"], help="invoke python shell",
|
parser = root.add_parser("service-shell", aliases=["shell"], help="invoke python shell",
|
||||||
description="drop into python shell while having created application",
|
description="drop into python shell", formatter_class=_formatter)
|
||||||
formatter_class=_formatter)
|
|
||||||
parser.add_argument("code", help="instead of dropping into shell, just execute the specified code", nargs="?")
|
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.add_argument("-v", "--verbose", help=argparse.SUPPRESS, action="store_true")
|
||||||
parser.set_defaults(handler=handlers.Shell, lock=None, report=False)
|
parser.set_defaults(handler=handlers.Shell, lock=None, report=False)
|
||||||
|
@ -23,7 +23,6 @@ import sys
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ahriman.application.application import Application
|
|
||||||
from ahriman.application.handlers import Handler
|
from ahriman.application.handlers import Handler
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.core.formatters import StringPrinter
|
from ahriman.core.formatters import StringPrinter
|
||||||
@ -47,14 +46,12 @@ class Shell(Handler):
|
|||||||
configuration(Configuration): configuration instance
|
configuration(Configuration): configuration instance
|
||||||
report(bool): force enable or disable reporting
|
report(bool): force enable or disable reporting
|
||||||
"""
|
"""
|
||||||
# pylint: disable=possibly-unused-variable
|
|
||||||
application = Application(architecture, configuration, report=report)
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
# licensed by https://creativecommons.org/licenses/by-sa/3.0
|
# licensed by https://creativecommons.org/licenses/by-sa/3.0
|
||||||
path = Path(sys.prefix) / "share" / "ahriman" / "templates" / "shell"
|
path = Path(sys.prefix) / "share" / "ahriman" / "templates" / "shell"
|
||||||
StringPrinter(path.read_text(encoding="utf8")).print(verbose=False)
|
StringPrinter(path.read_text(encoding="utf8")).print(verbose=False)
|
||||||
# we only want to pass application instance inside
|
local_variables = {"architecture": architecture, "configuration": configuration}
|
||||||
if args.code is None:
|
if args.code is None:
|
||||||
code.interact(local={"application": application})
|
code.interact(local=local_variables)
|
||||||
else:
|
else:
|
||||||
code.InteractiveConsole(locals={"application": application}).runcode(args.code)
|
code.InteractiveConsole(locals=local_variables).runcode(args.code)
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
__version__ = "2.10.0"
|
__version__ = "2.10.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user