OXIESEC PANEL
- Current Dir:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
isort
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:06 AM
rwxr-xr-x
📄
__init__.py
871 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
__main__.py
36 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📁
__pycache__
-
02/07/2025 10:01:30 PM
rwxr-xr-x
📁
_vendored
-
12/18/2024 10:23:16 AM
rwxr-xr-x
📄
_version.py
72 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
api.py
25.51 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
comments.py
933 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
core.py
22 KB
12/18/2024 10:23:16 AM
rw-r--r--
📁
deprecated
-
02/07/2025 10:01:30 PM
rwxr-xr-x
📄
exceptions.py
6.89 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
files.py
1.55 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
format.py
5.35 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
hooks.py
3.26 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
identify.py
8.18 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
io.py
2.16 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
literal.py
3.63 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
logo.py
388 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
main.py
45.73 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
output.py
27.15 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
parse.py
24.74 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
place.py
5.05 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
profiles.py
2.09 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
py.typed
0 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
pylama_isort.py
1.28 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
sections.py
297 bytes
12/18/2024 10:23:16 AM
rw-r--r--
📄
settings.py
34.75 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
setuptools_commands.py
2.24 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
sorting.py
4.41 KB
12/18/2024 10:23:16 AM
rw-r--r--
📁
stdlibs
-
02/07/2025 10:01:30 PM
rwxr-xr-x
📄
utils.py
2.36 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
wrap.py
6.17 KB
12/18/2024 10:23:16 AM
rw-r--r--
📄
wrap_modes.py
13.25 KB
12/18/2024 10:23:16 AM
rw-r--r--
Editing: setuptools_commands.py
Close
import glob import os import sys from typing import Any, Dict, Iterator, List from warnings import warn import setuptools # type: ignore from . import api from .settings import DEFAULT_CONFIG class ISortCommand(setuptools.Command): # type: ignore """The :class:`ISortCommand` class is used by setuptools to perform imports checks on registered modules. """ description = "Run isort on modules registered in setuptools" user_options: List[Any] = [] def initialize_options(self) -> None: default_settings = vars(DEFAULT_CONFIG).copy() for key, value in default_settings.items(): setattr(self, key, value) def finalize_options(self) -> None: """Get options from config files.""" self.arguments: Dict[str, Any] = {} # skipcq: PYL-W0201 self.arguments["settings_path"] = os.getcwd() def distribution_files(self) -> Iterator[str]: """Find distribution packages.""" # This is verbatim from flake8 if self.distribution.packages: # pragma: no cover package_dirs = self.distribution.package_dir or {} for package in self.distribution.packages: pkg_dir = package if package in package_dirs: pkg_dir = package_dirs[package] elif "" in package_dirs: # pragma: no cover pkg_dir = package_dirs[""] + os.path.sep + pkg_dir yield pkg_dir.replace(".", os.path.sep) if self.distribution.py_modules: for filename in self.distribution.py_modules: yield f"{filename}.py" # Don't miss the setup.py file itself yield "setup.py" def run(self) -> None: arguments = self.arguments wrong_sorted_files = False for path in self.distribution_files(): for python_file in glob.iglob(os.path.join(path, "*.py")): try: if not api.check_file(python_file, **arguments): wrong_sorted_files = True # pragma: no cover except OSError as error: # pragma: no cover warn(f"Unable to parse file {python_file} due to {error}") if wrong_sorted_files: sys.exit(1) # pragma: no cover