diff options
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('') |