From 4c1ef5b80719888db14642e6b8f8da30bd308cfe Mon Sep 17 00:00:00 2001 From: petersulyok Date: Sat, 6 Jan 2024 12:10:12 +0100 Subject: [PATCH] Change: typos corrected documentation improved. --- DEVELOPMENT.md | 2 +- bin/create_python_env.sh | 2 +- src/diskinfo/disk.py | 8 ++++---- src/diskinfo/diskinfo.py | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 08b1390..2210861 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -86,7 +86,7 @@ The project implemented the following GitHub workflows: - executes `pylint` - generates coverage data and upload it to [codecov.io](https://codecov.io/) -2. **Publish Python distribution packages to PypI** (`publish.yml`). A published release triggers this action: +2. **Publish Python distribution packages to PyPI** (`publish.yml`). A published release triggers this action: - build distribution package on Python `3.10` - upload the new package to PyPI diff --git a/bin/create_python_env.sh b/bin/create_python_env.sh index 90f2497..e776ed1 100755 --- a/bin/create_python_env.sh +++ b/bin/create_python_env.sh @@ -1,7 +1,7 @@ #!/bin/bash # # create_python_env.sh (C) 2024, Peter Sulyok -# This script will install a new virtual Python environment with dependencies. +# This script will create a new virtual Python environment and will install all dependencies. # # Check the first command-line parameter. diff --git a/src/diskinfo/disk.py b/src/diskinfo/disk.py index 3ac12f5..b65261e 100644 --- a/src/diskinfo/disk.py +++ b/src/diskinfo/disk.py @@ -24,11 +24,11 @@ class Disk: directory * a `by-path` name of the disk (e.g. `"pci-0000:00:17.0-ata-3"`) located in `/dev/disk/by-path/` directory - Based on the specified input parameter the disk will be indentified and its attributes will be collected and + Based on the specified input parameter the disk will be identified and its attributes will be collected and stored. A :py:obj:`ValueError` exception will be raised in case of missing or invalid disk identifier. Operators (``<``, ``>`` and ``==``) are also implemented for this class to compare different class instances, - they use the disk name for comparision. + they use the disk name for comparison. .. note:: During the class initialization the disk will not be physically accessed. @@ -45,7 +45,7 @@ class Disk: RuntimeError: in case of any system error Example: - This exampe shows how to create a :class:`~diskinfo.Disk` class then how to get its path and serial number:: + This example shows how to create a :class:`~diskinfo.Disk` class then how to get its path and serial number:: >>> from diskinfo import Disk >>> d=Disk("sda") @@ -573,7 +573,7 @@ def get_temperature(self) -> float: float: disk temperature in C degree Raises: - RuntimeError: if HWMON file cannot be found for this disk (typically drivetemp module is not loaded) + RuntimeError: if HWMON file cannot be found for this disk (typically ``drivetemp`` module is not loaded) Example: An example about the use of this function:: diff --git a/src/diskinfo/diskinfo.py b/src/diskinfo/diskinfo.py index f6dd8a2..93701d2 100644 --- a/src/diskinfo/diskinfo.py +++ b/src/diskinfo/diskinfo.py @@ -17,7 +17,7 @@ class DiskInfo: set of :class:`~diskinfo.DiskType` values. Operator ``in`` is also implemented for this class. Caller can check if a :class:`~diskinfo.Disk` class instance - can be found on the list of the dicovered disks. + can be found on the list of the discovered disks. Example: A code example about the basic use of the class and the use of the ``in`` operator. @@ -46,8 +46,8 @@ def __init__(self): self.__disk_list.append(new_disk) def get_disk_number(self, included: set = None, excluded: set = None) -> int: - """Returns the number of the disks. The caller can specify inclusive and exclusice filters for disk types. - If no filters are specified then the default behaviour is to include all disk types and to exclude nothing. + """Returns the number of the disks. The caller can specify inclusive and exclusive filters for disk types. + If no filters are specified then the default behavior is to include all disk types and to exclude nothing. Args: included (set): filter set for included disk types @@ -91,8 +91,8 @@ def get_disk_number(self, included: set = None, excluded: set = None) -> int: def get_disk_list(self, included: set = None, excluded: set = None, sorting: bool = False, rev_order: bool = False) -> List[Disk]: - """Returns the list of identified disks. The caller can specify inclusive and exclusice filters for disk types. - If no filters are specified the default behaviour is to include all disk types and to exclude nothing. + """Returns the list of identified disks. The caller can specify inclusive and exclusive filters for disk types. + If no filters are specified the default behavior is to include all disk types and to exclude nothing. The list can be sorted based on the disk `name` in alphabetical order. Caller can also request sorting in reverse order.