module: nest align if statement inside min_width if statement
@@ -320,6 +320,16 @@ class Module:
self.module_options['min_width'] = min_width
+ if 'align' in mod_config:
+ align = mod_config['align']
+ if not (isinstance(align, basestring) and
+ align.lower() in ('left', 'center', 'right')):
+ err = 'invalid "align" attribute, valid values are:'
+ err += ' left, center, right'
+ raise ValueError(err)
+
+ self.module_options['align'] = align
+
if 'separator' in mod_config:
separator = mod_config['separator']
if not isinstance(separator, bool):
@@ -337,16 +347,6 @@ class Module:
self.module_options['separator_block_width'] = sep_block_width
- if 'align' in mod_config:
- align = mod_config['align']
- if not (isinstance(align, basestring) and
- align.lower() in ("left", "center", "right")):
- err = 'invalid "align" attribute, valid values are:'
- err += ' left, center, right'
- raise ValueError(err)
-
- self.module_options['align'] = align
-
def process_composite(self, response):
"""
Process a composite response.
