diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-08-31 16:12:50 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-08-31 16:12:50 +0100 |
commit | 1ca3ac3c3b69cac571a7d7a93bf51aea83eb273a (patch) | |
tree | e43a4f7dd73846dad3c89f6619e6384a2ac7f8d2 | |
parent | 95da407b5e2ada81b02fe002c913904c62d7c3da (diff) | |
download | python-ttystatus-1ca3ac3c3b69cac571a7d7a93bf51aea83eb273a.tar.gz |
Refactor: code clarity.
-rw-r--r-- | ttystatus/fmt.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ttystatus/fmt.py b/ttystatus/fmt.py index 16b69de..bc0bbe8 100644 --- a/ttystatus/fmt.py +++ b/ttystatus/fmt.py @@ -45,12 +45,12 @@ def parse(fmt): while fmt: m = pat.match(fmt) if m: - klass = getattr(ttystatus, m.group('class')) - argnames = m.group('args').split(',') - argnames = [x for x in argnames if x] if prefix: result.append(ttystatus.Literal(prefix)) prefix = '' + klass = getattr(ttystatus, m.group('class')) + argnames = m.group('args').split(',') + argnames = [x for x in argnames if x] result.append(klass(*argnames)) fmt = fmt[m.end():] elif fmt.startswith('%%'): |