diff --git a/RNS/Utilities/rnir.py b/RNS/Utilities/rnir.py index 7f37576..73c346c 100644 --- a/RNS/Utilities/rnir.py +++ b/RNS/Utilities/rnir.py @@ -56,7 +56,7 @@ def main(): parser.add_argument('-v', '--verbose', action='count', default=0) parser.add_argument('-q', '--quiet', action='count', default=0) parser.add_argument("--exampleconfig", action='store_true', default=False, help="print verbose configuration example to stdout and exit") - parser.add_argument("--version", action="version", version="ir {version}".format(version=__version__)) + parser.add_argument("--version", action="version", version="rnir {version}".format(version=__version__)) args = parser.parse_args() diff --git a/RNS/Utilities/rnpkg.py b/RNS/Utilities/rnpkg.py new file mode 100644 index 0000000..a78a3e6 --- /dev/null +++ b/RNS/Utilities/rnpkg.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 + +# Reticulum License +# +# Copyright (c) 2016-2025 Mark Qvist +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import RNS +import argparse +import time + +from RNS._version import __version__ + +def program_setup(configdir, verbosity = 0, quietness = 0, service = False): + targetverbosity = verbosity-quietness + + if service: + targetlogdest = RNS.LOG_FILE + targetverbosity = None + else: + targetlogdest = RNS.LOG_STDOUT + + reticulum = RNS.Reticulum(configdir=configdir, verbosity=targetverbosity, logdest=targetlogdest) + exit(0) + +def main(): + try: + parser = argparse.ArgumentParser(description="Reticulum Meta Package Manager") + parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str) + parser.add_argument('-v', '--verbose', action='count', default=0) + parser.add_argument('-q', '--quiet', action='count', default=0) + parser.add_argument("--version", action="version", version="rnpkg {version}".format(version=__version__)) + + args = parser.parse_args() + + if args.exampleconfig: + print(__example_rns_config__) + exit() + + if args.config: configarg = args.config + else: configarg = None + + program_setup(configdir = configarg, verbosity=args.verbose, quietness=args.quiet) + + except KeyboardInterrupt: + print("") + exit() + +__example_rns_config__ = '''# This is an example package manager configuration file. +''' + +if __name__ == "__main__": main() diff --git a/RNS/_version.py b/RNS/_version.py index 6849410..a82b376 100644 --- a/RNS/_version.py +++ b/RNS/_version.py @@ -1 +1 @@ -__version__ = "1.1.0" +__version__ = "1.1.1" diff --git a/setup.py b/setup.py index bc037a9..80044e5 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ setuptools.setup( 'rncp=RNS.Utilities.rncp:main', 'rnx=RNS.Utilities.rnx:main', 'rnir=RNS.Utilities.rnir:main', + 'rnpkg=RNS.Utilities.rnpkg:main', 'rnodeconf=RNS.Utilities.rnodeconf:main', ] },