PATH: //proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/isort
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📄 __main__.py
↓
X
📁 __pycache__/
X
📁 _vendored/
X
📄 _version.py
↓
X
📄 api.py
↓
X
📄 comments.py
↓
X
📄 core.py
↓
X
📁 deprecated/
X
📄 exceptions.py
↓
X
📄 files.py
↓
X
📄 format.py
↓
X
📄 hooks.py
↓
X
📄 identify.py
↓
X
📄 io.py
↓
X
📄 literal.py
↓
X
📄 logo.py
↓
X
📄 main.py
↓
X
📄 output.py
↓
X
📄 parse.py
↓
X
📄 place.py
↓
X
📄 profiles.py
↓
X
📄 py.typed
↓
X
📄 pylama_isort.py
↓
X
📄 sections.py
↓
X
📄 settings.py
↓
X
📄 setuptools_commands.py
↓
X
📄 sorting.py
↓
X
📁 stdlibs/
X
📄 utils.py
↓
X
📄 wrap.py
↓
X
📄 wrap_modes.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: comments.py
from typing import List, Optional, Tuple def parse(line: str) -> Tuple[str, str]: """Parses import lines for comments and returns back the import statement and the associated comment. """ comment_start = line.find("#") if comment_start != -1: return (line[:comment_start], line[comment_start + 1 :].strip()) return (line, "") def add_to_line( comments: Optional[List[str]], original_string: str = "", removed: bool = False, comment_prefix: str = "", ) -> str: """Returns a string with comments added if removed is not set.""" if removed: return parse(original_string)[0] if not comments: return original_string unique_comments: List[str] = [] for comment in comments: if comment not in unique_comments: unique_comments.append(comment) return f"{parse(original_string)[0]}{comment_prefix} {'; '.join(unique_comments)}"
SIMPAN PERUBAHAN