mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 08:09:10 +02: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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user