Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbmw <bmw@users.noreply.github.com>2015-10-17 05:01:06 +0300
committerbmw <bmw@users.noreply.github.com>2015-10-17 05:01:06 +0300
commit7fe8bbe446550e6e6ccbb71cf288235d16f66453 (patch)
treecb8c2707cf272376ec411db1beea00e0905cc6c0
parent653474483287fae35ca75fdce1d90ab8a9688376 (diff)
parent670bc1e3d3f6145e98060a069806781cc22695ba (diff)
Merge pull request #984 from lf-/patch-1
Change as_string to __str__ in nginxparser to make it more pythonic.
-rw-r--r--letsencrypt-nginx/letsencrypt_nginx/nginxparser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/letsencrypt-nginx/letsencrypt_nginx/nginxparser.py b/letsencrypt-nginx/letsencrypt_nginx/nginxparser.py
index 2926a43d0..cef0756d7 100644
--- a/letsencrypt-nginx/letsencrypt_nginx/nginxparser.py
+++ b/letsencrypt-nginx/letsencrypt_nginx/nginxparser.py
@@ -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):