Merge pull request #984 from lf-/patch-1

Change as_string to __str__ in nginxparser to make it more pythonic.
This commit is contained in:
bmw 2015-10-16 19:01:06 -07:00
commit 7fe8bbe446

View file

@ -84,7 +84,7 @@ class RawNginxDumper(object):
else:
yield spacer * current_indent + key + spacer + values + ';'
def as_string(self):
def __str__(self):
"""Return the parsed block as a string."""
return '\n'.join(self) + '\n'
@ -122,7 +122,7 @@ def dumps(blocks, indentation=4):
:rtype: str
"""
return RawNginxDumper(blocks, indentation).as_string()
return str(RawNginxDumper(blocks, indentation))
def dump(blocks, _file, indentation=4):