mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
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:
commit
7fe8bbe446
1 changed files with 2 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue