OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
virtualenv
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 06:26:52 AM
rwxrwxr-x
📄
__init__.py
147 bytes
05/09/2024 06:58:24 AM
rw-r--r--
📄
__main__.py
2.47 KB
05/09/2024 06:58:24 AM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
activation
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
app_data
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
config
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
create
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
discovery
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
info.py
1.75 KB
05/09/2024 06:58:24 AM
rw-r--r--
📄
report.py
1.29 KB
05/09/2024 06:58:24 AM
rw-r--r--
📁
run
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
seed
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
util
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
version.py
66 bytes
05/09/2024 06:58:24 AM
rw-r--r--
Editing: __main__.py
Close
import logging import os import sys from datetime import datetime def run(args=None, options=None, env=None): env = os.environ if env is None else env start = datetime.now() from virtualenv.run import cli_run from virtualenv.util.error import ProcessCallFailed if args is None: args = sys.argv[1:] try: session = cli_run(args, options, env) logging.warning(LogSession(session, start)) except ProcessCallFailed as exception: print(f"subprocess call failed for {exception.cmd} with code {exception.code}") print(exception.out, file=sys.stdout, end="") print(exception.err, file=sys.stderr, end="") raise SystemExit(exception.code) class LogSession: def __init__(self, session, start): self.session = session self.start = start def __str__(self): spec = self.session.creator.interpreter.spec elapsed = (datetime.now() - self.start).total_seconds() * 1000 lines = [ f"created virtual environment {spec} in {elapsed:.0f}ms", f" creator {str(self.session.creator)}", ] if self.session.seeder.enabled: lines.append(f" seeder {str(self.session.seeder)}") path = self.session.creator.purelib.iterdir() packages = sorted("==".join(i.stem.split("-")) for i in path if i.suffix == ".dist-info") lines.append(f" added seed packages: {', '.join(packages)}") if self.session.activators: lines.append(f" activators {','.join(i.__class__.__name__ for i in self.session.activators)}") return "\n".join(lines) def run_with_catch(args=None, env=None): from virtualenv.config.cli.parser import VirtualEnvOptions env = os.environ if env is None else env options = VirtualEnvOptions() try: run(args, options, env) except (KeyboardInterrupt, SystemExit, Exception) as exception: try: if getattr(options, "with_traceback", False): raise else: if not (isinstance(exception, SystemExit) and exception.code == 0): logging.error("%s: %s", type(exception).__name__, exception) code = exception.code if isinstance(exception, SystemExit) else 1 sys.exit(code) finally: logging.shutdown() # force flush of log messages before the trace is printed if __name__ == "__main__": # pragma: no cov run_with_catch() # pragma: no cov