summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2013-01-25 16:21:04 -0500
committerChris Lumens <clumens@redhat.com>2013-01-29 10:08:19 -0500
commit6fe8dd63e182ceea67b470fe83585822e9227306 (patch)
treed56071d05a50c9a766de72fe50b509cd18d78338 /pyanaconda/ui
parent9364a664b1054759bae9db4d35491bd051867416 (diff)
downloadanaconda-6fe8dd63e182ceea67b470fe83585822e9227306.tar.gz
anaconda-6fe8dd63e182ceea67b470fe83585822e9227306.tar.xz
anaconda-6fe8dd63e182ceea67b470fe83585822e9227306.zip
Document FileSystemSpaceChecker.
Diffstat (limited to 'pyanaconda/ui')
-rw-r--r--pyanaconda/ui/lib/space.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/pyanaconda/ui/lib/space.py b/pyanaconda/ui/lib/space.py
index 44d1e3c78..9bf6292b4 100644
--- a/pyanaconda/ui/lib/space.py
+++ b/pyanaconda/ui/lib/space.py
@@ -30,21 +30,49 @@ import logging
log = logging.getLogger("anaconda")
class FileSystemSpaceChecker(object):
+ """This object provides for a way to verify that enough space is available
+ on configured filesystems to support the current software selections.
+ It is run as part of completeness checking every time a spoke changes,
+ therefore moving this step up out of both the storage and software
+ spokes.
+ """
error_template = N_("Not enough space in filesystems for the current "
"software selection. An additional %s is needed.")
def __init__(self, storage, payload):
+ """Create a new FileSystemSpaceChecker object.
+
+ Attributes:
+
+ payload -- An instance of a packaging.Payload subclass.
+ storage -- An instance of storage.Storage.
+ """
self.payload = payload
self.storage = storage
self.reset()
def reset(self):
+ """Get rid of any existing error messages and prepare to run the
+ check again.
+ """
self.success = False
self.deficit = Size(bytes=0)
self.error_message = ""
def check(self):
+ """Check configured storage against software selections. When this
+ method is complete (which should be pretty quickly), the following
+ attributes are available for inspection:
+
+ success -- A simple boolean defining whether there's enough
+ space or not.
+ deficit -- If unsuccessful, how much space the system is
+ short for current software selections (in MB).
+ error_message -- If unsuccessful, an error message describing the
+ situation. This message is suitable for putting
+ in the info bar at the bottom of a Hub.
+ """
self.reset()
free = Size(spec="%.2f MB" % self.storage.fileSystemFreeSpace)
needed = self.payload.spaceRequired