]> git.seodisparate.com - AnotherAURHelper/commitdiff
Add some docstrings to the ArchPkgVersion class
authorStephen Seo <seo.disparate@gmail.com>
Sat, 4 Feb 2023 08:04:56 +0000 (17:04 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 4 Feb 2023 08:04:56 +0000 (17:04 +0900)
update.py

index 0b6e3f4af909a9bc0e8d6b29fbbff5f8c482d44e..d124edf8b07be3ace1d03c8a64b70597b5d27924 100755 (executable)
--- a/update.py
+++ b/update.py
@@ -27,6 +27,8 @@ IS_DIGIT_REGEX = re.compile("^[0-9]+$")
 
 
 class ArchPkgVersion:
+    """Holds a version (typically of an ArchLinux package) for comparison."""
+
     def __init__(self, version_str):
         self.versions = []
         self.pkgver = 0
@@ -72,6 +74,8 @@ class ArchPkgVersion:
         self.versions = tuple(self.versions)
 
     def compare_with(self, other_self):
+        """Returns -1 if self is less than other_self, 0 if they are equal, and
+        1 if self is greater than other_self."""
         self_count = len(self.versions)
         other_count = len(other_self.versions)
         if other_count < self_count: