diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-11-14 13:33:53 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-11-14 22:11:23 +0100 |
commit | 8c9ef00cb9701b73af21b04cf774fc633d142148 (patch) | |
tree | c44c9db8394ff955b9ead2be96602e8d781593e6 /formats | |
parent | 3a3eac0097598bdaad18e081f0359d905f24fed5 (diff) | |
download | clufter-8c9ef00cb9701b73af21b04cf774fc633d142148.tar.gz clufter-8c9ef00cb9701b73af21b04cf774fc633d142148.tar.xz clufter-8c9ef00cb9701b73af21b04cf774fc633d142148.zip |
formats/command: use "chained" facility as a DRY measure
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'formats')
-rw-r--r-- | formats/command.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/formats/command.py b/formats/command.py index f38897a..4f795da 100644 --- a/formats/command.py +++ b/formats/command.py @@ -15,15 +15,10 @@ class command(SimpleFormat): BYTESTRING = SimpleFormat.BYTESTRING MERGED = Protocol('merged') - @SimpleFormat.producing(BYTESTRING) + @SimpleFormat.producing(BYTESTRING, chained=True) def get_bytestring(self, *protodecl): """Return command as canonical single string""" - # try to look (indirectly) if we have a file at hand first - ret = super(command, self).get_bytestring(self.BYTESTRING) - if ret is not None: - return ret - - # fallback + # chained fallback return ' '.join(self.MERGED(protect_safe=True)) @SimpleFormat.producing(SEPARATED, protect=True) |