OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4737
/
lib
/
python3.12
/
site-packages
/
certbot_nginx
/
_internal
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/12/2025 06:19:48 PM
rwxr-xr-x
📄
__init__.py
52 bytes
06/12/2025 06:19:39 PM
rw-r--r--
📁
__pycache__
-
06/12/2025 06:19:48 PM
rwxr-xr-x
📄
configurator.py
55.39 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
constants.py
3.2 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
display_ops.py
1.52 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
http_01.py
9.58 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
nginxparser.py
10.71 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
obj.py
9.96 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
parser.py
33.25 KB
06/12/2025 06:19:39 PM
rw-r--r--
📄
parser_obj.py
15.68 KB
06/12/2025 06:19:39 PM
rw-r--r--
📁
tests
-
06/12/2025 06:19:48 PM
rwxr-xr-x
📁
tls_configs
-
06/12/2025 06:19:48 PM
rwxr-xr-x
Editing: display_ops.py
Close
"""Contains UI methods for Nginx operations.""" import logging from typing import Iterable from typing import List from typing import Optional from certbot.display import util as display_util from certbot_nginx._internal.obj import VirtualHost logger = logging.getLogger(__name__) def select_vhost_multiple(vhosts: Optional[Iterable[VirtualHost]]) -> List[VirtualHost]: """Select multiple Vhosts to install the certificate for :param vhosts: Available Nginx VirtualHosts :type vhosts: :class:`list` of type `~obj.Vhost` :returns: List of VirtualHosts :rtype: :class:`list`of type `~obj.Vhost` """ if not vhosts: return [] tags_list = [vhost.display_repr()+"\n" for vhost in vhosts] # Remove the extra newline from the last entry if tags_list: tags_list[-1] = tags_list[-1][:-1] code, names = display_util.checklist( "Which server blocks would you like to modify?", tags=tags_list, force_interactive=True) if code == display_util.OK: return_vhosts = _reversemap_vhosts(names, vhosts) return return_vhosts return [] def _reversemap_vhosts(names: Iterable[str], vhosts: Iterable[VirtualHost]) -> List[VirtualHost]: """Helper function for select_vhost_multiple for mapping string representations back to actual vhost objects""" return_vhosts = [] for selection in names: for vhost in vhosts: if vhost.display_repr().strip() == selection.strip(): return_vhosts.append(vhost) return return_vhosts