pydna 5.5.4__py3-none-any.whl → 5.5.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pydna/download.py CHANGED
@@ -6,27 +6,18 @@
6
6
  # as part of this package.
7
7
  """Provides a function for downloading online text files."""
8
8
 
9
- import textwrap as _textwrap
9
+ import textwrap
10
10
 
11
- # import os as _os
12
- from pydna._pretty import pretty_str as _pretty_str
11
+ from pydna._pretty import pretty_str as ps
13
12
 
14
- # from pydna.utils import memorize as _memorize
15
- # import logging as _logging
16
13
 
17
- # _module_logger = _logging.getLogger("pydna." + __name__)
18
-
19
-
20
- # @_memorize("pydna.download.download_text")
21
14
  def download_text(url):
22
15
  """docstring."""
23
16
  import requests
24
17
 
25
- # _module_logger.info("#### DOWNLOAD TEXT ####")
26
- # _module_logger.info("url = %s", url)
27
18
  req = requests.get(url)
28
- # _module_logger.info("url = %s", str(req))
29
- result = _textwrap.dedent(req.text).strip()
19
+
20
+ result = textwrap.dedent(req.text).strip()
30
21
  result = result.replace("\r\n", "\n").replace("\r", "\n")
31
- # _module_logger.info("result[:160] = %s", result[:160])
32
- return _pretty_str(result)
22
+
23
+ return ps(result)