diff options
author | zax <zach.smith@makespace.com> | 2015-11-01 17:39:25 -0500 |
---|---|---|
committer | zax <zach.smith@makespace.com> | 2015-11-01 17:39:25 -0500 |
commit | 0561247cf17ec2b8602d915a3ad051909db82404 (patch) | |
tree | 6ac098ffe73edfed8258e5e98bef37e82680d0ba | |
parent | 90095a9d51cb6cc37d87e0cf37e886c598b3154a (diff) | |
download | pycco-0561247cf17ec2b8602d915a3ad051909db82404.tar.gz |
Move docstring to helper function
-rw-r--r-- | pycco/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pycco/main.py b/pycco/main.py index 32f5dfc..8a20ae6 100644 --- a/pycco/main.py +++ b/pycco/main.py @@ -407,6 +407,8 @@ def shift(list, default): def remove_control_chars(s): + # Sanitization regexp copied from + # http://stackoverflow.com/questions/92438/stripping-non-printable-characters-from-a-string-in-python from .compat import pycco_unichr control_chars = ''.join(map(pycco_unichr, list(range(0, 32)) + list(range(127, 160)))) control_char_re = re.compile(u'[{}]'.format(re.escape(control_chars))) @@ -417,8 +419,6 @@ def ensure_directory(directory): """ Sanitize directory string and ensure that the destination directory exists. """ - # Sanitization regexp copied from - # http://stackoverflow.com/questions/92438/stripping-non-printable-characters-from-a-string-in-python directory = remove_control_chars(directory) if not os.path.isdir(directory): os.makedirs(directory) |