Am 13. Dezember 2010 16:51 schrieb Rene Nussbaumer <[email protected]>:
> On Mon, Dec 13, 2010 at 4:26 PM, Michael Hanselmann <[email protected]> wrote:
>> +def FormatQueryResult(result, unit=None, format_override=None,
>> separator=None,
>> + header=False):
>> + """Formats data in L{objects.QueryResponse}.
>> +
>> + �...@type result: L{objects.QueryResponse}
>> + �...@param result: result of query operation
>> + �...@type unit: string
>> + �...@param unit: Unit used for formatting fields of type
>> L{constants.QFT_UNIT}
>> + �...@type format_override: dict
>> + �...@param format_override: Dictionary for overriding field formatting
>> functions,
>> + indexed by field name, contents like L{_DEFAULT_FORMAT_QUERY}
>> + �...@type separator: string or None
>> + �...@param separator: String used to separate fields
>> + �...@type header: bool
>> + �...@param header: Whether to output header row
>> +
>> + """
>> + if unit is None:
>> + if separator:
>> + unit = "m"
>> + else:
>> + unit = "h"
>
> Maybe describe the units. What does this short-hand characters stand
> for? What other units are available?
Thanks for the reviews. Will push with this interdiff:
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -2408,7 +2408,8 @@ def FormatQueryResult(result, unit=None,
format_override=None, separator=None,
@type result: L{objects.QueryResponse}
@param result: result of query operation
@type unit: string
- @param unit: Unit used for formatting fields of type L{constants.QFT_UNIT}
+ @param unit: Unit used for formatting fields of type L{constants.QFT_UNIT},
+ see L{utils.FormatUnit}
@type format_override: dict
@param format_override: Dictionary for overriding field formatting functions,
indexed by field name, contents like L{_DEFAULT_FORMAT_QUERY}
Michael