diff options
| author | Johannes Linke <johannes.linke@posteo.de> | 2016-10-31 17:35:13 +0100 |
|---|---|---|
| committer | Johannes Linke <johannes.linke@posteo.de> | 2016-10-31 17:59:11 +0100 |
| commit | 3ec3e612a5e803b087e32159934524f50f66f345 (patch) | |
| tree | 07cbc1c06ce3da012262c8d8c0584d436a69bee1 /compressor/utils | |
| parent | 427db2a9695e42458d348ec417cd8a3627e169e2 (diff) | |
| download | django-compressor-3ec3e612a5e803b087e32159934524f50f66f345.tar.gz | |
Remove unused find_command
Diffstat (limited to 'compressor/utils')
| -rw-r--r-- | compressor/utils/__init__.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/compressor/utils/__init__.py b/compressor/utils/__init__.py index 1c3479b..c0d067b 100644 --- a/compressor/utils/__init__.py +++ b/compressor/utils/__init__.py @@ -2,8 +2,6 @@ from __future__ import unicode_literals import os -from django.utils import six - from compressor.exceptions import FilterError @@ -42,32 +40,3 @@ def get_pathext(default_pathext=None): if default_pathext is None: default_pathext = os.pathsep.join(['.COM', '.EXE', '.BAT', '.CMD']) return os.environ.get('PATHEXT', default_pathext) - - -def find_command(cmd, paths=None, pathext=None): - """ - Searches the PATH for the given command and returns its path - """ - if paths is None: - paths = os.environ.get('PATH', '').split(os.pathsep) - if isinstance(paths, six.string_types): - paths = [paths] - # check if there are funny path extensions for executables, e.g. Windows - if pathext is None: - pathext = get_pathext() - pathext = [ext for ext in pathext.lower().split(os.pathsep)] - # don't use extensions if the command ends with one of them - if os.path.splitext(cmd)[1].lower() in pathext: - pathext = [''] - # check if we find the command on PATH - for path in paths: - # try without extension first - cmd_path = os.path.join(path, cmd) - for ext in pathext: - # then including the extension - cmd_path_ext = cmd_path + ext - if os.path.isfile(cmd_path_ext): - return cmd_path_ext - if os.path.isfile(cmd_path): - return cmd_path - return None |
