From ac75467493daface3a967239b49393a958e1652d Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Fri, 20 Jun 2025 15:54:25 +1000 Subject: [PATCH] Fix script docs --- docs/examples/python.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/examples/python.rst b/docs/examples/python.rst index d9dcc21016..59f27f00a2 100644 --- a/docs/examples/python.rst +++ b/docs/examples/python.rst @@ -26,16 +26,17 @@ Creating a script Lets create a `test_installer` - installer as an example. This is assuming that the folder `./archinstall` is a git-clone of the main repo. We begin by creating "`scripts`_:code:`/test_installer.py`". The placement here is important later. -This script can now already be called using :code:`python -m archinstall test_installer` after a successful installation of the library itself. +This script can now already be called using :code:`python -m archinstall --script test_installer` after a successful installation of the library itself. But the script won't do much. So we'll do something simple like list all the hard drives as an example. To do this, we'll begin by importing :code:`archinstall` in our "`scripts`_:code:`/test_installer.py`" and call a function whtin ``archinstall``. .. code-block:: python - import archinstall + from archinstall.lib.disk.device_handler import device_handler + from pprint import pprint - print(archinstall.disk.device_handler.devices) + pprint(device_handler.devices) Now, go ahead and reference the :ref:`installing.python.manual` installation method. After running ``python -m archinstall test_installer`` it should print something that looks like: