diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-05-31 03:10:46 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-06-05 19:12:58 +0200 |
commit | 78b9d6d77a8a222c375d3762d9c9683b9dceb102 (patch) | |
tree | aba6d5c12c40570cd3e8f4bfe6aa349831cd080e /hostinfo/prefix.py | |
parent | 8a7090271ee3b197d76a989e7b0df7167cbf8bd3 (diff) | |
download | tools-78b9d6d77a8a222c375d3762d9c9683b9dceb102.tar.gz tools-78b9d6d77a8a222c375d3762d9c9683b9dceb102.tar.bz2 tools-78b9d6d77a8a222c375d3762d9c9683b9dceb102.zip |
hostinfo: migration from getopts to argparse
Diffstat (limited to 'hostinfo/prefix.py')
-rw-r--r-- | hostinfo/prefix.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hostinfo/prefix.py b/hostinfo/prefix.py index e9f0bf2..e1b72b5 100644 --- a/hostinfo/prefix.py +++ b/hostinfo/prefix.py @@ -12,7 +12,7 @@ class Printer: self.output = printer.pprint self.parent = printer - self.empty = 'oneline' in self.__class__.flags + self.empty = self.__class__.flags.oneline self.full_key = full_key self.has_output = False self.label = '' @@ -25,8 +25,8 @@ class Printer: return label label = "%s: " % label - if self.parent is not None and self.parent.full_key == '': - if 'nospaces' in self.__class__.flags: + if self.parent is None or self.parent.full_key == '': + if self.__class__.flags.nospaces: return label.rjust(maxlength+4) else: return (label + " ").rjust(maxlength+6) @@ -41,7 +41,7 @@ class Printer: self.empty = True def space(self, force=False): - if 'nospaces' not in self.__class__.flags: + if not self.__class__.flags.nospaces: if self.has_output or force: self.output('') |