From f072477a6201564b3aa677f8b20e21922fb89e54 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 14 2016 09:48:35 +0000 Subject: Adjust docstrings in pagure.lib.encoding_utils --- diff --git a/pagure/lib/encoding_utils.py b/pagure/lib/encoding_utils.py index 0372889..3bf418c 100644 --- a/pagure/lib/encoding_utils.py +++ b/pagure/lib/encoding_utils.py @@ -34,9 +34,9 @@ def detect_encodings(data): :param data: An array of bytes to treat as text data :type data: bytes - :return: A dictionary mapping possible encodings to confidence levels :rtype: dict + """ if not data: # It's an empty string so we can safely say it's ascii @@ -74,6 +74,9 @@ def guess_encodings(data): :param data: An array of bytes to treat as text data :type data: bytes + :return: A dictionary mapping possible encodings to confidence levels + :rtype: dict + """ encodings = detect_encodings(data) @@ -109,8 +112,11 @@ def guess_encoding(data): :param data: An array of bytes to treat as text data :type data: bytes + :return: A string of the best encoding found + :rtype: str :raises PagureException: if no encoding was found that the data could be decoded into + """ encodings = guess_encodings(data)