From 2de153003ed5de1018639070fabc9c9e583c49d1 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 29 May 2022 15:31:18 +0800 Subject: Fix typos (#1265) --- archinstall/lib/disk/btrfs/__init__.py | 4 ++-- archinstall/lib/disk/btrfs/btrfs_helpers.py | 4 ++-- archinstall/lib/disk/btrfs/btrfspartition.py | 4 ++-- archinstall/lib/disk/btrfs/btrfssubvolume.py | 4 ++-- archinstall/lib/disk/filesystem.py | 4 ++-- archinstall/lib/disk/helpers.py | 6 +++--- archinstall/lib/general.py | 6 +++--- archinstall/lib/installer.py | 4 ++-- archinstall/lib/menu/list_manager.py | 4 ++-- archinstall/lib/menu/menu.py | 2 +- archinstall/lib/menu/selection_menu.py | 4 ++-- archinstall/lib/menu/simple_menu.py | 2 +- archinstall/lib/models/users.py | 4 ++-- archinstall/lib/storage.py | 4 ++-- archinstall/lib/systemd.py | 2 +- archinstall/lib/translation.py | 2 +- archinstall/lib/user_interaction/backwards_compatible_conf.py | 2 +- archinstall/lib/user_interaction/partitioning_conf.py | 2 +- 18 files changed, 32 insertions(+), 32 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/disk/btrfs/__init__.py b/archinstall/lib/disk/btrfs/__init__.py index 84b9c0f6..90c58145 100644 --- a/archinstall/lib/disk/btrfs/__init__.py +++ b/archinstall/lib/disk/btrfs/__init__.py @@ -73,7 +73,7 @@ def create_subvolume(installation :Installer, subvolume_location :Union[pathlib. def _has_option(option :str,options :list) -> bool: """ auxiliary routine to check if an option is present in a list. - we check if the string appears in one of the options, 'cause it can appear in severl forms (option, option=val,...) + we check if the string appears in one of the options, 'cause it can appear in several forms (option, option=val,...) """ if not options: return False @@ -110,7 +110,7 @@ def manage_btrfs_subvolumes(installation :Installer, subvolumes = partition['btrfs']['subvolumes'] for name, right_hand in subvolumes.items(): try: - # we normalize the subvolume name (getting rid of slash at the start if exists. In our implemenation has no semantic load - every subvolume is created from the top of the hierarchy- and simplifies its further use + # we normalize the subvolume name (getting rid of slash at the start if exists. In our implementation has no semantic load - every subvolume is created from the top of the hierarchy- and simplifies its further use if name.startswith('/'): name = name[1:] # renormalize the right hand. diff --git a/archinstall/lib/disk/btrfs/btrfs_helpers.py b/archinstall/lib/disk/btrfs/btrfs_helpers.py index d577d82b..5fa94314 100644 --- a/archinstall/lib/disk/btrfs/btrfs_helpers.py +++ b/archinstall/lib/disk/btrfs/btrfs_helpers.py @@ -10,7 +10,7 @@ from .btrfssubvolume import BtrfsSubvolume def mount_subvolume(installation, device, name, subvolume_information): - # we normalize the subvolume name (getting rid of slash at the start if exists. In our implemenation has no semantic load. + # we normalize the subvolume name (getting rid of slash at the start if exists. In our implementation has no semantic load. # Every subvolume is created from the top of the hierarchy- and simplifies its further use name = name.lstrip('/') @@ -53,7 +53,7 @@ def setup_subvolumes(installation, partition_dict): """ log(f"Setting up subvolumes: {partition_dict['btrfs']['subvolumes']}", level=logging.INFO, fg="gray") for name, right_hand in partition_dict['btrfs']['subvolumes'].items(): - # we normalize the subvolume name (getting rid of slash at the start if exists. In our implemenation has no semantic load. + # we normalize the subvolume name (getting rid of slash at the start if exists. In our implementation has no semantic load. # Every subvolume is created from the top of the hierarchy- and simplifies its further use name = name.lstrip('/') diff --git a/archinstall/lib/disk/btrfs/btrfspartition.py b/archinstall/lib/disk/btrfs/btrfspartition.py index 299357b8..6f7487e4 100644 --- a/archinstall/lib/disk/btrfs/btrfspartition.py +++ b/archinstall/lib/disk/btrfs/btrfspartition.py @@ -62,13 +62,13 @@ class BTRFSPartition(Partition): if not installation: installation = storage.get('installation_session') - # Determain if the path given, is an absolute path or a releative path. + # Determain if the path given, is an absolute path or a relative path. # We do this by checking if the path contains a known mountpoint. if str(subvolume)[0] == '/': if filesystems := findmnt(subvolume, traverse=True).get('filesystems'): if (target := filesystems[0].get('target')) and target != '/' and str(subvolume).startswith(target): # Path starts with a known mountpoint which isn't / - # Which means it's an absolut path to a mounted location. + # Which means it's an absolute path to a mounted location. pass else: # Since it's not an absolute position with a known start. diff --git a/archinstall/lib/disk/btrfs/btrfssubvolume.py b/archinstall/lib/disk/btrfs/btrfssubvolume.py index a96e2a94..bc7db612 100644 --- a/archinstall/lib/disk/btrfs/btrfssubvolume.py +++ b/archinstall/lib/disk/btrfs/btrfssubvolume.py @@ -68,9 +68,9 @@ class BtrfsSubvolume: from .btrfs_helpers import subvolume_info_from_path # TODO: Make this function traverse storage['MOUNT_POINT'] and find the first - # occurance of a mountpoint that is a btrfs volume instead of lazy assume / is a subvolume. + # occurrence of a mountpoint that is a btrfs volume instead of lazy assume / is a subvolume. # It would also be nice if it could use findmnt(self.full_path) and traverse backwards - # finding the last occurance of a subvolume which 'self' belongs to. + # finding the last occurrence of a subvolume which 'self' belongs to. if volume := subvolume_info_from_path(storage['MOUNT_POINT']): return self.full_path == volume.full_path diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index f94b4b47..cc29a491 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -74,7 +74,7 @@ class Filesystem: raise KeyError(f"Could not create a GPT label on {self}") elif self.mode == MBR: if not self.parted_mklabel(self.blockdevice.device, "msdos"): - raise KeyError(f"Could not create a MSDOS label on {self}") + raise KeyError(f"Could not create a MS-DOS label on {self}") self.blockdevice.flush_cache() time.sleep(3) @@ -221,7 +221,7 @@ class Filesystem: raise KeyError(f"Could not create a GPT label on {self}") elif self.mode == MBR: if not self.parted_mklabel(self.blockdevice.device, "msdos"): - raise KeyError(f"Could not create a MSDOS label on {self}") + raise KeyError(f"Could not create a MS-DOS label on {self}") self.blockdevice.flush_cache() diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index 65d7a006..47cc81c4 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -112,7 +112,7 @@ def cleanup_bash_escapes(data :str) -> str: def blkid(cmd :str) -> Dict[str, Any]: if '-o' in cmd and '-o export' not in cmd: - raise ValueError(f"blkid() requires '-o export' to be used and can therefor not continue reliably.") + raise ValueError(f"blkid() requires '-o export' to be used and can therefore not continue reliably.") elif '-o' not in cmd: cmd += ' -o export' @@ -133,7 +133,7 @@ def blkid(cmd :str) -> Dict[str, Any]: key, val = line.split('=', 1) if key.lower() == 'devname': devname = val - # Lowercase for backwards compatability with all_disks() previous use cases + # Lowercase for backwards compatibility with all_disks() previous use cases result[devname] = { "path": devname, "PATH": devname @@ -475,7 +475,7 @@ def has_mountpoint(partition: Union[dict,Partition,MapperDev], target: str, stri Input parms: :parm partition the partition we check - :type Either a Partition object or a dict with the contents of a partition definiton in the disk_layouts schema + :type Either a Partition object or a dict with the contents of a partition definition in the disk_layouts schema :parm target (a string representing a mount path we want to check for. :type str diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index b99e4a45..3ec1d685 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -207,7 +207,7 @@ class SysCommandWorker: self.cmd = cmd self.callbacks = callbacks self.peak_output = peak_output - # define the standard locale for command outputs. For now the C ascii one. Can be overriden + # define the standard locale for command outputs. For now the C ascii one. Can be overridden self.environment_vars = {**storage.get('CMD_LOCALE',{}),**environment_vars} self.logfile = logfile self.working_directory = working_directory @@ -354,7 +354,7 @@ class SysCommandWorker: # Note: If for any reason, we get a Python exception between here # and until os.close(), the traceback will get locked inside # stdout of the child_fd object. `os.read(self.child_fd, 8192)` is the - # only way to get the traceback without loosing it. + # only way to get the traceback without losing it. self.pid, self.child_fd = pty.fork() @@ -547,7 +547,7 @@ def json_stream_to_structure(configuration_identifier : str, stream :str, target parsed_url = urllib.parse.urlparse(stream) - if parsed_url.scheme: # The stream is in fact a URL that should be grabed + if parsed_url.scheme: # The stream is in fact a URL that should be grabbed with urllib.request.urlopen(urllib.request.Request(stream, headers={'User-Agent': 'ArchInstall'})) as response: target.update(json.loads(response.read())) else: diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index b2cd6306..7af6006f 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -195,7 +195,7 @@ class Installer: return True def _create_keyfile(self,luks_handle , partition :dict, password :str): - """ roiutine to create keyfiles, so it can be moved elsewere + """ roiutine to create keyfiles, so it can be moved elsewhere """ if partition.get('generate-encryption-key-file'): if not (cryptkey_dir := pathlib.Path(f"{self.target}/etc/cryptsetup-keys.d")).exists(): @@ -413,7 +413,7 @@ class Installer: try: run_pacman('-Syy', default_cmd='/usr/bin/pacman') except SysCallError as error: - self.log(f'Could not sync a new package databse: {error}', level=logging.ERROR, fg="red") + self.log(f'Could not sync a new package database: {error}', level=logging.ERROR, fg="red") if storage['arguments'].get('silent', False) is False: if input('Would you like to re-try this download? (Y/n): ').lower().strip() in ('', 'y'): diff --git a/archinstall/lib/menu/list_manager.py b/archinstall/lib/menu/list_manager.py index cb567093..7e051528 100644 --- a/archinstall/lib/menu/list_manager.py +++ b/archinstall/lib/menu/list_manager.py @@ -54,7 +54,7 @@ The default implementation can handle simple lists and a key:value dictionary. T A sample of basic usage is included at the end of the source. More sophisticaded uses can be achieved by -* changing the action list and the null_action during intialization +* changing the action list and the null_action during initialization ``` opciones = ListManager('Vamos alla',opciones,[str(_('Add')),str(_('Delete'))],_('Add')).run() ``` @@ -198,7 +198,7 @@ class ListManager: else: self.target = self._data[data_formatted[target.value]] - # Possible enhacement. If run_actions returns false a message line indicating the failure + # Possible enhancement. If run_actions returns false a message line indicating the failure self.run_actions(target.value) if target.value == self.cancel_action: # TODO dubious diff --git a/archinstall/lib/menu/menu.py b/archinstall/lib/menu/menu.py index c34814eb..3a26f6e7 100644 --- a/archinstall/lib/menu/menu.py +++ b/archinstall/lib/menu/menu.py @@ -115,7 +115,7 @@ class Menu(TerminalMenu): # We check that the options are iterable. If not we abort. Else we copy them to lists # it options is a dictionary we use the values as entries of the list # if options is a string object, each character becomes an entry - # if options is a list, we implictily build a copy to mantain immutability + # if options is a list, we implictily build a copy to maintain immutability if not isinstance(p_options,Iterable): log(f"Objects of type {type(p_options)} is not iterable, and are not supported at Menu",fg="red") log(f"invalid parameter at Menu() call was at <{sys._getframe(1).f_code.co_name}>",level=logging.WARNING) diff --git a/archinstall/lib/menu/selection_menu.py b/archinstall/lib/menu/selection_menu.py index 57e290f1..6a693730 100644 --- a/archinstall/lib/menu/selection_menu.py +++ b/archinstall/lib/menu/selection_menu.py @@ -219,7 +219,7 @@ class GeneralMenu: def _setup_selection_menu_options(self): """ Define the menu options. - Menu options can be defined here in a subclass or done per progam calling self.set_option() + Menu options can be defined here in a subclass or done per program calling self.set_option() """ return @@ -347,7 +347,7 @@ class GeneralMenu: return self.exec_option(config_name, selector) def exec_option(self, config_name :str, p_selector :Selector = None) -> bool: - """ processes the exection of a given menu entry + """ processes the execution of a given menu entry - pre process callback - selection function - post process callback diff --git a/archinstall/lib/menu/simple_menu.py b/archinstall/lib/menu/simple_menu.py index 947259eb..f7a2cf23 100644 --- a/archinstall/lib/menu/simple_menu.py +++ b/archinstall/lib/menu/simple_menu.py @@ -619,7 +619,7 @@ class TerminalMenu: else: unit_separated_entry = escaped_separator_pattern.sub("|", separator_pattern.sub("\\1\x1F", entry)) match_obj = menu_entry_pattern.match(unit_separated_entry) - # this is none in case the entry was an emtpy string which + # this is none in case the entry was an empty string which # will be interpreted as a separator assert match_obj is not None shortcut_key = match_obj.group(1) diff --git a/archinstall/lib/models/users.py b/archinstall/lib/models/users.py index 6052b73a..a3057291 100644 --- a/archinstall/lib/models/users.py +++ b/archinstall/lib/models/users.py @@ -64,13 +64,13 @@ class User: ) -> List['User']: users = [] - # backwards compability + # backwards compatibility if isinstance(config_users, dict): users += cls._parse_backwards_compatible(config_users, False) else: users += cls._parse(config_users) - # backwards compability + # backwards compatibility if isinstance(config_superusers, dict): users += cls._parse_backwards_compatible(config_superusers, True) diff --git a/archinstall/lib/storage.py b/archinstall/lib/storage.py index dd7ddc88..8c358161 100644 --- a/archinstall/lib/storage.py +++ b/archinstall/lib/storage.py @@ -17,13 +17,13 @@ storage: Dict[str, Any] = { # os.path.abspath(f'{os.path.dirname(__file__)}/../examples') ], 'UPSTREAM_URL': 'https://raw.githubusercontent.com/archlinux/archinstall/master/profiles', - 'PROFILE_DB': None, # Used in cases when listing profiles is desired, not mandatory for direct profile grabing. + 'PROFILE_DB': None, # Used in cases when listing profiles is desired, not mandatory for direct profile grabbing. 'LOG_PATH': '/var/log/archinstall', 'LOG_FILE': 'install.log', 'MOUNT_POINT': '/mnt/archinstall', 'ENC_IDENTIFIER': 'ainst', 'DISK_TIMEOUTS' : 1, # seconds 'DISK_RETRY_ATTEMPTS' : 5, # RETRY_ATTEMPTS * DISK_TIMEOUTS is used in disk operations - 'CMD_LOCALE':{'LC_ALL':'C'}, # default locale for execution commands. Can be overriden with set_cmd_locale() + 'CMD_LOCALE':{'LC_ALL':'C'}, # default locale for execution commands. Can be overridden with set_cmd_locale() 'CMD_LOCALE_DEFAULT':{'LC_ALL':'C'}, # should be the same as the former. Not be used except in reset_cmd_locale() } diff --git a/archinstall/lib/systemd.py b/archinstall/lib/systemd.py index 3d2f0385..f459f94b 100644 --- a/archinstall/lib/systemd.py +++ b/archinstall/lib/systemd.py @@ -88,7 +88,7 @@ class Boot: if len(args) >= 2 and args[1]: log(args[1], level=logging.ERROR, fg='red') - log(f"The error above occured in a temporary boot-up of the installation {self.instance}", level=logging.ERROR, fg="red") + log(f"The error above occurred in a temporary boot-up of the installation {self.instance}", level=logging.ERROR, fg="red") shutdown = None shutdown_exit_code = -1 diff --git a/archinstall/lib/translation.py b/archinstall/lib/translation.py index 1a0e94e4..79e0198a 100644 --- a/archinstall/lib/translation.py +++ b/archinstall/lib/translation.py @@ -28,7 +28,7 @@ class LanguageDefinitions: if entry['abbr'] == abbr: return entry['lang'] - raise ValueError(f'No language with abbrevation "{abbr}" found') + raise ValueError(f'No language with abbreviation "{abbr}" found') class DeferredTranslation: diff --git a/archinstall/lib/user_interaction/backwards_compatible_conf.py b/archinstall/lib/user_interaction/backwards_compatible_conf.py index d91690eb..296572d2 100644 --- a/archinstall/lib/user_interaction/backwards_compatible_conf.py +++ b/archinstall/lib/user_interaction/backwards_compatible_conf.py @@ -40,7 +40,7 @@ def generic_select( # We check that the options are iterable. If not we abort. Else we copy them to lists # it options is a dictionary we use the values as entries of the list # if options is a string object, each character becomes an entry - # if options is a list, we implictily build a copy to mantain immutability + # if options is a list, we implictily build a copy to maintain immutability if not isinstance(p_options, Iterable): log(f"Objects of type {type(p_options)} is not iterable, and are not supported at generic_select", fg="red") log(f"invalid parameter at Menu() call was at <{sys._getframe(1).f_code.co_name}>", level=logging.WARNING) diff --git a/archinstall/lib/user_interaction/partitioning_conf.py b/archinstall/lib/user_interaction/partitioning_conf.py index 1ecba8be..caf5f5df 100644 --- a/archinstall/lib/user_interaction/partitioning_conf.py +++ b/archinstall/lib/user_interaction/partitioning_conf.py @@ -224,7 +224,7 @@ def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, continue block_device_struct["partitions"].append({ - "type": "primary", # Strictly only allowed under MSDOS, but GPT accepts it so it's "safe" to inject + "type": "primary", # Strictly only allowed under MS-DOS, but GPT accepts it so it's "safe" to inject "start": start, "size": end, "mountpoint": None, -- cgit v1.2.3-70-g09d2