Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-04 18:32:59 +0000
committerGitHub <noreply@github.com>2021-04-04 18:32:59 +0000
commitf8fc542fd7cb35b68d8ab4760cf53f6d45654834 (patch)
tree821c37cc4ca53214868a6e36f2e978608d1a7867
parent5a321d6ce540d89b1464743738e43d4ac3205832 (diff)
parentb02c9991911887620d4c4e84b65ac6d0c9a97b16 (diff)
Merge branch 'master' into fix-repo-url
-rw-r--r--archinstall/lib/disk.py12
-rw-r--r--archinstall/lib/installer.py6
-rw-r--r--archinstall/lib/networking.py4
-rw-r--r--archinstall/lib/output.py4
-rw-r--r--archinstall/lib/profiles.py14
-rw-r--r--archinstall/lib/user_interaction.py2
-rw-r--r--docs/archinstall/general.rst6
-rw-r--r--docs/examples/binary.rst4
-rw-r--r--docs/index.rst7
-rw-r--r--docs/installing/binary.rst8
-rw-r--r--docs/installing/guided.rst4
-rw-r--r--examples/guided.py12
-rw-r--r--profiles/desktop.py8
-rw-r--r--profiles/kde-wayland.py2
-rw-r--r--profiles/kde.py2
15 files changed, 49 insertions, 46 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 10d4ef5a..0608b47b 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -25,10 +25,10 @@ class BlockDevice():
self.path = path
self.info = info
self.part_cache = OrderedDict()
- # TODO: Currently disk encryption is a BIT missleading.
+ # TODO: Currently disk encryption is a BIT misleading.
# It's actually partition-encryption, but for future-proofing this
# I'm placing the encryption password on a BlockDevice level.
- self.encryption_passwoed = None
+ self.encryption_password = None
def __repr__(self, *args, **kwargs):
return f"BlockDevice({self.device})"
@@ -284,10 +284,10 @@ class Partition():
handle = luks2(self, None, None)
return handle.encrypt(self, *args, **kwargs)
- def format(self, filesystem=None, path=None, allow_formatting=None, log_formating=True):
+ def format(self, filesystem=None, path=None, allow_formatting=None, log_formatting=True):
"""
Format can be given an overriding path, for instance /dev/null to test
- the formating functionality and in essence the support for the given filesystem.
+ the formatting functionality and in essence the support for the given filesystem.
"""
if filesystem is None:
filesystem = self.filesystem
@@ -305,7 +305,7 @@ class Partition():
if not allow_formatting:
raise PermissionError(f"{self} is not formatable either because instance is locked ({self.allow_formatting}) or a blocking flag was given ({allow_formatting})")
- if log_formating:
+ if log_formatting:
log(f'Formatting {path} -> {filesystem}', level=LOG_LEVELS.Info)
if filesystem == 'btrfs':
@@ -400,7 +400,7 @@ class Partition():
2. UnknownFilesystemFormat that indicates that we don't support the given filesystem type
"""
try:
- self.format(self.filesystem, '/dev/null', log_formating=False, allow_formatting=True)
+ self.format(self.filesystem, '/dev/null', log_formatting=False, allow_formatting=True)
except SysCallError:
pass # We supported it, but /dev/null is not formatable as expected so the mkfs call exited with an error code
except UnknownFilesystemFormat as err:
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index c0d174ff..0fc9f969 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -73,7 +73,7 @@ class Installer():
return self
def __exit__(self, *args, **kwargs):
- # b''.join(sys_command(f'sync')) # No need to, since the underlaying fs() object will call sync.
+ # b''.join(sys_command(f'sync')) # No need to, since the underlying fs() object will call sync.
# TODO: https://stackoverflow.com/questions/28157929/how-to-safely-handle-an-exception-inside-a-context-manager
if len(args) >= 2 and args[1]:
@@ -268,7 +268,7 @@ class Installer():
return True
def minimal_installation(self):
- ## Add nessecary packages if encrypting the drive
+ ## Add necessary packages if encrypting the drive
## (encrypted partitions default to btrfs for now, so we need btrfs-progs)
## TODO: Perhaps this should be living in the function which dictates
## the partitioning. Leaving here for now.
@@ -401,7 +401,7 @@ class Installer():
# The tricky thing with doing the import archinstall.session instead is that
# profiles might be run from a different chroot, and there's no way we can
# guarantee file-path safety when accessing the installer object that way.
- # Doing the __builtins__ replacement, ensures that the global vriable "installation"
+ # Doing the __builtins__ replacement, ensures that the global variable "installation"
# is always kept up to date. It's considered a nasty hack - but it's a safe way
# of ensuring 100% accuracy of archinstall session variables.
__builtins__['installation'] = self
diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py
index 882bcff3..2dc8be9b 100644
--- a/archinstall/lib/networking.py
+++ b/archinstall/lib/networking.py
@@ -56,7 +56,7 @@ def wirelessScan(interface):
storage['_WIFI'][interface]['scanning'] = True
-# TOOD: Full WiFi experience might get evolved in the future, pausing for now 2021-01-25
+# TODO: Full WiFi experience might get evolved in the future, pausing for now 2021-01-25
def getWirelessNetworks(interface):
# TODO: Make this oneliner pritter to check if the interface is scanning or not.
if not '_WIFI' in storage or interface not in storage['_WIFI'] or storage['_WIFI'][interface].get('scanning', False) is False:
@@ -65,4 +65,4 @@ def getWirelessNetworks(interface):
time.sleep(5)
for line in sys_command(f"iwctl station {interface} get-networks"):
- print(line) \ No newline at end of file
+ print(line)
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
index 537fb695..dfc6959d 100644
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -6,7 +6,7 @@ from pathlib import Path
from .storage import storage
# TODO: use logging's built in levels instead.
-# Altough logging is threaded and I wish to avoid that.
+# Although logging is threaded and I wish to avoid that.
# It's more Pythonistic or w/e you want to call it.
class LOG_LEVELS:
Critical = 0b001
@@ -130,4 +130,4 @@ def log(*args, **kwargs):
# We use sys.stdout.write()+flush() instead of print() to try and
# fix issue #94
sys.stdout.write(f"{string}\n")
- sys.stdout.flush() \ No newline at end of file
+ sys.stdout.flush()
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 08b1d618..4ef6c533 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -112,11 +112,11 @@ class Script():
if f"{self.profile}" in self.examples:
return self.localize_path(self.examples[self.profile]['path'])
- # TODO: Redundant, the below block shouldnt be needed as profiles are stripped of their .py, but just in case for now:
+ # TODO: Redundant, the below block shouldn't be needed as profiles are stripped of their .py, but just in case for now:
elif f"{self.profile}.py" in self.examples:
return self.localize_path(self.examples[f"{self.profile}.py"]['path'])
- # Path was not found in any known examples, check if it's an abolute path
+ # Path was not found in any known examples, check if it's an absolute path
if os.path.isfile(self.profile):
return self.profile
@@ -156,7 +156,7 @@ class Profile(Script):
def install(self):
# Before installing, revert any temporary changes to the namespace.
- # This ensures that the namespace during installation is the original initation namespace.
+ # This ensures that the namespace during installation is the original initiation namespace.
# (For instance awesome instead of aweosme.py or app-awesome.py)
self.namespace = self.original_namespace
return self.execute()
@@ -194,11 +194,11 @@ class Application(Profile):
if f"{self.profile}" in self.examples:
return self.localize_path(self.examples[self.profile]['path'])
- # TODO: Redundant, the below block shouldnt be needed as profiles are stripped of their .py, but just in case for now:
+ # TODO: Redundant, the below block shouldn't be needed as profiles are stripped of their .py, but just in case for now:
elif f"{self.profile}.py" in self.examples:
return self.localize_path(self.examples[f"{self.profile}.py"]['path'])
- # Path was not found in any known examples, check if it's an abolute path
+ # Path was not found in any known examples, check if it's an absolute path
if os.path.isfile(self.profile):
return os.path.basename(self.profile)
@@ -210,7 +210,7 @@ class Application(Profile):
def install(self):
# Before installing, revert any temporary changes to the namespace.
- # This ensures that the namespace during installation is the original initation namespace.
+ # This ensures that the namespace during installation is the original initiation namespace.
# (For instance awesome instead of aweosme.py or app-awesome.py)
self.namespace = self.original_namespace
- return self.execute() \ No newline at end of file
+ return self.execute()
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 630862ee..8cdbbe8c 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -151,7 +151,7 @@ def ask_for_main_filesystem_format():
def generic_select(options, input_text="Select one of the above by index or absolute value: ", sort=True):
"""
A generic select function that does not output anything
- other than the options and their indexs. As an example:
+ other than the options and their indexes. As an example:
generic_select(["first", "second", "third option"])
1: first
diff --git a/docs/archinstall/general.rst b/docs/archinstall/general.rst
index 349393de..0403ae30 100644
--- a/docs/archinstall/general.rst
+++ b/docs/archinstall/general.rst
@@ -22,7 +22,7 @@ Locale related
.. autofunction:: archinstall.search_keyboard_layout
-.. autofunction:: archinstall.set_keyboard_layout
+.. autofunction:: archinstall.set_keyboard_language
Services
========
@@ -34,7 +34,7 @@ Mirrors
.. autofunction:: archinstall.filter_mirrors_by_region
-.. autofunction:: archinstall.add_custom_mirror
+.. autofunction:: archinstall.add_custom_mirrors
.. autofunction:: archinstall.insert_mirrors
@@ -87,4 +87,4 @@ Exceptions
.. autofunction:: archinstall.ProfileError
-.. autofunction:: archinstall.SysCallError \ No newline at end of file
+.. autofunction:: archinstall.SysCallError
diff --git a/docs/examples/binary.rst b/docs/examples/binary.rst
index c73b3a5d..51dbd1dd 100644
--- a/docs/examples/binary.rst
+++ b/docs/examples/binary.rst
@@ -1,4 +1,4 @@
-.. _examples.python:
+.. _examples.binary:
Binary executable
=================
@@ -20,4 +20,4 @@ To run the `guided` installed, all you have to do *(after installing or compilin
./archinstall guided
As mentioned, the binary is a bit rudimentary and only supports executing whatever is found directly under `./archinstall/examples`.
-Anything else won't be found. This is subject to change in the future to make it a bit more flexible. \ No newline at end of file
+Anything else won't be found. This is subject to change in the future to make it a bit more flexible.
diff --git a/docs/index.rst b/docs/index.rst
index eef368c5..deb2734e 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -43,12 +43,15 @@ Some of the features of Archinstall are:
examples/python
examples/binary
+..
examples/scripting
-.. toctree::
+..
+ .. toctree::
:maxdepth: 3
:caption: Programming Guide
+..
programming_guide/requirements
programming_guide/basic_concept
@@ -64,4 +67,4 @@ Some of the features of Archinstall are:
:maxdepth: 3
:caption: API Helper functions
- archinstall/general \ No newline at end of file
+ archinstall/general
diff --git a/docs/installing/binary.rst b/docs/installing/binary.rst
index 9156a1bf..504d6e3e 100644
--- a/docs/installing/binary.rst
+++ b/docs/installing/binary.rst
@@ -1,10 +1,10 @@
-.. _installing.binary
+.. _installing.binary:
Binary executable
=================
Archinstall can be compiled into a standalone executable.
-For Arch Linux based systems, there's a package for this called `archinstall <https://archlinux.life/>`_.
+For Arch Linux based systems, there's a package for this called `archinstall <https://archlinux.org/packages/extra/any/archinstall/>`_.
.. warning::
This is not required if you're running archinstall on a pre-built ISO. The installation is only required if you're creating your own scripted installations.
@@ -37,7 +37,7 @@ Which should produce a `archinstall-X.x.z-1.pkg.tar.zst` that can be installed u
.. note::
- For a complete guide on the build process, please consult the wiki on `PKGBUILD <https://wiki.archlinux.org/index.php/PKGBUILD>`_.
+ For a complete guide on the build process, please consult the `PKGBUILD on ArchWiki <https://wiki.archlinux.org/index.php/PKGBUILD>`_.
Manual compilation
------------------
@@ -49,4 +49,4 @@ Simply clone or download the source, and while standing in the cloned folder `./
nuitka3 --standalone --show-progress archinstall
-This requires the `nuitka <https://archlinux.org/packages/community/any/nuitka/>`_ package as well as `python3` to be installed locally. \ No newline at end of file
+This requires the `nuitka <https://archlinux.org/packages/community/any/nuitka/>`_ package as well as `python3` to be installed locally.
diff --git a/docs/installing/guided.rst b/docs/installing/guided.rst
index 7ce081ca..2e1cda09 100644
--- a/docs/installing/guided.rst
+++ b/docs/installing/guided.rst
@@ -66,7 +66,7 @@ Default is :code:`auto detect best mirror`
As an example:
- * :code:`Sweden` *(wich a capital :code:`S`)* will only use mirrors from Sweden.
+ * :code:`Sweden` *(with a capital :code:`S`)* will only use mirrors from Sweden.
Selection of drive
------------------
@@ -175,4 +175,4 @@ After which you can press :code:`Enter` can be pressed in order to start the for
Post installation
-----------------
-Once the installation is complete, green text should appear saying that it's safe to `reboot`, which is also the command you use to reboot. \ No newline at end of file
+Once the installation is complete, green text should appear saying that it's safe to `reboot`, which is also the command you use to reboot.
diff --git a/examples/guided.py b/examples/guided.py
index 5803e13f..2e553c4d 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -58,7 +58,7 @@ def ask_user_questions():
if archinstall.arguments['harddrive'].has_partitions():
archinstall.log(f"{archinstall.arguments['harddrive']} contains the following partitions:", fg='yellow')
- # We curate a list pf supported paritions
+ # We curate a list pf supported partitions
# and print those that we don't support.
partition_mountpoints = {}
for partition in archinstall.arguments['harddrive']:
@@ -69,7 +69,7 @@ def ask_user_questions():
except archinstall.UnknownFilesystemFormat as err:
archinstall.log(f" {partition} (Filesystem not supported)", fg='red')
- # We then ask what to do with the paritions.
+ # We then ask what to do with the partitions.
if (option := archinstall.ask_for_disk_layout()) == 'abort':
archinstall.log(f"Safely aborting the installation. No changes to the disk or system has been made.")
exit(1)
@@ -89,7 +89,7 @@ def ask_user_questions():
mountpoint = input(f"Enter a mount-point for {partition}: ").strip(' ')
if len(mountpoint):
- # Get a valid & supported filesystem for the parition:
+ # Get a valid & supported filesystem for the partition:
while 1:
new_filesystem = input(f"Enter a valid filesystem for {partition} (leave blank for {partition.filesystem}): ").strip(' ')
if len(new_filesystem) <= 0:
@@ -120,7 +120,7 @@ def ask_user_questions():
# But that means our .format() function supported it.
break
- # When we've selected all three criterias,
+ # When we've selected all three criteria,
# We can safely mark the partition for formatting and where to mount it.
# TODO: allow_formatting might be redundant since target_mountpoint should only be
# set if we actually want to format it anyway.
@@ -170,7 +170,7 @@ def ask_user_questions():
else:
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
- # Check the potentially selected profiles preperations to get early checks if some additional questions are needed.
+ # Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_prep_function():
with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
if not imported._prep_function():
@@ -342,4 +342,4 @@ def perform_installation(device, boot_partition, language, mirrors):
ask_user_questions()
-perform_installation_steps() \ No newline at end of file
+perform_installation_steps()
diff --git a/profiles/desktop.py b/profiles/desktop.py
index 869cf0a0..41a2ad8b 100644
--- a/profiles/desktop.py
+++ b/profiles/desktop.py
@@ -13,8 +13,8 @@ def _prep_function(*args, **kwargs):
supported_desktops = ['gnome', 'kde', 'awesome']
desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ')
- # Temporarly store the selected desktop profile
- # in a session-safe location, since this module will get re-loaded
+ # Temporarily store the selected desktop profile
+ # in a session-safe location, since this module will get reloaded
# the next time it gets executed.
archinstall.storage['_desktop_profile'] = desktop
@@ -29,7 +29,7 @@ def _prep_function(*args, **kwargs):
if __name__ == 'desktop':
"""
This "profile" is a meta-profile.
- There are no specific desktop-steps, it simply routes
+ There are no desktop-specific steps, it simply routes
the installer to whichever desktop environment/window manager was chosen.
Maybe in the future, a network manager or similar things *could* be added here.
@@ -37,7 +37,7 @@ if __name__ == 'desktop':
it trying to be a turn-key desktop distribution.
There are plenty of desktop-turn-key-solutions based on Arch Linux,
- this is therefor just a helper to get started
+ this is therefore just a helper to get started
"""
# TODO: Remove magic variable 'installation' and place it
diff --git a/profiles/kde-wayland.py b/profiles/kde-wayland.py
index 31226952..e21f62c8 100644
--- a/profiles/kde-wayland.py
+++ b/profiles/kde-wayland.py
@@ -1,4 +1,4 @@
-# A desktop environement using "KDE".
+# A desktop environment using "KDE".
import archinstall, os
# TODO: Remove hard dependency of bash (due to .bash_profile)
diff --git a/profiles/kde.py b/profiles/kde.py
index 752a08d2..32819bd5 100644
--- a/profiles/kde.py
+++ b/profiles/kde.py
@@ -1,4 +1,4 @@
-# A desktop environement using "KDE".
+# A desktop environment using "KDE".
import archinstall, os