@@ -121,6 +121,13 @@ def display(self):
121121 List filesystems.
122122 """
123123
124+ @staticmethod
125+ def size_triple (mofs : Any ) -> SizeTriple :
126+ """
127+ Calculate size triple
128+ """
129+ return SizeTriple (Range (mofs .Size ()), get_property (mofs .Used (), Range , None ))
130+
124131
125132class Table (ListFilesystem ): # pylint: disable=too-few-public-methods
126133 """
@@ -133,15 +140,14 @@ def display(self):
133140 """
134141
135142 def filesystem_size_quartet (
136- total : Range , used : Optional [ Range ] , limit : Optional [Range ]
143+ size_triple : SizeTriple , limit : Optional [Range ]
137144 ) -> str :
138145 """
139146 Calculate the triple to display for filesystem size.
140147
141148 :returns: a string a formatted string showing all three values
142149 :rtype: str
143150 """
144- size_triple = SizeTriple (total , used )
145151 triple_str = " / " .join (
146152 (
147153 TABLE_FAILURE_STRING if x is None else str (x )
@@ -165,8 +171,7 @@ def filesystem_size_quartet(
165171 )
166172 size_func = catch_missing_property (
167173 lambda mofs : filesystem_size_quartet (
168- Range (mofs .Size ()),
169- get_property (mofs .Used (), Range , None ),
174+ ListFilesystem .size_triple (mofs ),
170175 get_property (mofs .SizeLimit (), Range , None ),
171176 ),
172177 TABLE_UNKNOWN_STRING ,
@@ -215,7 +220,7 @@ def display(self):
215220
216221 fs = self .filesystems_with_props [0 ]
217222
218- size_triple = SizeTriple ( Range ( fs . Size ()), get_property ( fs . Used (), Range , None ) )
223+ size_triple = ListFilesystem . size_triple ( fs )
219224 limit = get_property (fs .SizeLimit (), Range , None )
220225 created = (
221226 date_parser .isoparse (fs .Created ()).astimezone ().strftime ("%b %d %Y %H:%M" )
0 commit comments