Skip to content

Commit

Permalink
Merge pull request certbot#984 from lf-/patch-1
Browse files Browse the repository at this point in the history
Change as_string to __str__ in nginxparser to make it more pythonic.
  • Loading branch information
bmw committed Oct 17, 2015
2 parents 6534744 + 670bc1e commit 7fe8bbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions letsencrypt-nginx/letsencrypt_nginx/nginxparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __iter__(self, blocks=None, current_indent=0, spacer=' '):
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'

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7fe8bbe

Please sign in to comment.